diff --git a/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java b/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java index e17c6d0c..afbf48c4 100644 --- a/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java +++ b/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java @@ -2,6 +2,7 @@ public enum DeidentifyFileStatus { IN_PROGRESS("IN_PROGRESS"), + FAILED("FAILED"), SUCCESS("SUCCESS"); private final String value; diff --git a/src/main/java/com/skyflow/enums/DetectEntities.java b/src/main/java/com/skyflow/enums/DetectEntities.java index f2c21eff..3fd15a67 100644 --- a/src/main/java/com/skyflow/enums/DetectEntities.java +++ b/src/main/java/com/skyflow/enums/DetectEntities.java @@ -13,17 +13,19 @@ public enum DetectEntities { CREDIT_CARD_EXPIRATION("credit_card_expiration"), CVV("cvv"), DATE("date"), + DAY("day"), DATE_INTERVAL("date_interval"), DOB("dob"), DOSE("dose"), DRIVER_LICENSE("driver_license"), DRUG("drug"), DURATION("duration"), + EFFECT("effect"), EMAIL_ADDRESS("email_address"), EVENT("event"), FILENAME("filename"), FINANCIAL_METRIC("financial_metric"), - GENDER_SEXUALITY("gender_sexuality"), + GENDER("gender"), HEALTHCARE_NUMBER("healthcare_number"), INJURY("injury"), IP_ADDRESS("ip_address"), @@ -40,6 +42,7 @@ public enum DetectEntities { MEDICAL_CODE("medical_code"), MEDICAL_PROCESS("medical_process"), MONEY("money"), + MONTH("month"), NAME("name"), NAME_FAMILY("name_family"), NAME_GIVEN("name_given"), @@ -47,16 +50,19 @@ public enum DetectEntities { NUMERICAL_PII("numerical_pii"), OCCUPATION("occupation"), ORGANIZATION("organization"), + ORGANIZATION_ID("organization_id"), ORGANIZATION_MEDICAL_FACILITY("organization_medical_facility"), ORIGIN("origin"), PASSPORT_NUMBER("passport_number"), PASSWORD("password"), PHONE_NUMBER("phone_number"), + PROJECT("project"), PHYSICAL_ATTRIBUTE("physical_attribute"), POLITICAL_AFFILIATION("political_affiliation"), PRODUCT("product"), RELIGION("religion"), ROUTING_NUMBER("routing_number"), + SEXUALITY("sexuality"), SSN("ssn"), STATISTICS("statistics"), TIME("time"), @@ -64,6 +70,7 @@ public enum DetectEntities { URL("url"), USERNAME("username"), VEHICLE_ID("vehicle_id"), + YEAR("year"), ZODIAC_SIGN("zodiac_sign"); private final String detectEntities; diff --git a/src/main/java/com/skyflow/generated/rest/ApiClient.java b/src/main/java/com/skyflow/generated/rest/ApiClient.java index 296a553f..7c5ae554 100644 --- a/src/main/java/com/skyflow/generated/rest/ApiClient.java +++ b/src/main/java/com/skyflow/generated/rest/ApiClient.java @@ -8,8 +8,8 @@ import com.skyflow.generated.rest.resources.audit.AuditClient; import com.skyflow.generated.rest.resources.authentication.AuthenticationClient; import com.skyflow.generated.rest.resources.binlookup.BinLookupClient; -import com.skyflow.generated.rest.resources.deprecated.DeprecatedClient; import com.skyflow.generated.rest.resources.files.FilesClient; +import com.skyflow.generated.rest.resources.guardrails.GuardrailsClient; import com.skyflow.generated.rest.resources.query.QueryClient; import com.skyflow.generated.rest.resources.records.RecordsClient; import com.skyflow.generated.rest.resources.strings.StringsClient; @@ -31,7 +31,7 @@ public class ApiClient { protected final Supplier authenticationClient; - protected final Supplier deprecatedClient; + protected final Supplier guardrailsClient; protected final Supplier stringsClient; @@ -45,7 +45,7 @@ public ApiClient(ClientOptions clientOptions) { this.tokensClient = Suppliers.memoize(() -> new TokensClient(clientOptions)); this.queryClient = Suppliers.memoize(() -> new QueryClient(clientOptions)); this.authenticationClient = Suppliers.memoize(() -> new AuthenticationClient(clientOptions)); - this.deprecatedClient = Suppliers.memoize(() -> new DeprecatedClient(clientOptions)); + this.guardrailsClient = Suppliers.memoize(() -> new GuardrailsClient(clientOptions)); this.stringsClient = Suppliers.memoize(() -> new StringsClient(clientOptions)); this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions)); } @@ -74,8 +74,8 @@ public AuthenticationClient authentication() { return this.authenticationClient.get(); } - public DeprecatedClient deprecated() { - return this.deprecatedClient.get(); + public GuardrailsClient guardrails() { + return this.guardrailsClient.get(); } public StringsClient strings() { diff --git a/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java b/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java index d36c8141..8bfe2628 100644 --- a/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java +++ b/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java @@ -3,18 +3,19 @@ */ package com.skyflow.generated.rest; +import java.util.function.Supplier; + import com.skyflow.generated.rest.core.ClientOptions; import com.skyflow.generated.rest.core.Suppliers; import com.skyflow.generated.rest.resources.audit.AsyncAuditClient; import com.skyflow.generated.rest.resources.authentication.AsyncAuthenticationClient; import com.skyflow.generated.rest.resources.binlookup.AsyncBinLookupClient; -import com.skyflow.generated.rest.resources.deprecated.AsyncDeprecatedClient; import com.skyflow.generated.rest.resources.files.AsyncFilesClient; +import com.skyflow.generated.rest.resources.guardrails.AsyncGuardrailsClient; import com.skyflow.generated.rest.resources.query.AsyncQueryClient; import com.skyflow.generated.rest.resources.records.AsyncRecordsClient; import com.skyflow.generated.rest.resources.strings.AsyncStringsClient; import com.skyflow.generated.rest.resources.tokens.AsyncTokensClient; -import java.util.function.Supplier; public class AsyncApiClient { protected final ClientOptions clientOptions; @@ -31,7 +32,7 @@ public class AsyncApiClient { protected final Supplier authenticationClient; - protected final Supplier deprecatedClient; + protected final Supplier guardrailsClient; protected final Supplier stringsClient; @@ -45,7 +46,7 @@ public AsyncApiClient(ClientOptions clientOptions) { this.tokensClient = Suppliers.memoize(() -> new AsyncTokensClient(clientOptions)); this.queryClient = Suppliers.memoize(() -> new AsyncQueryClient(clientOptions)); this.authenticationClient = Suppliers.memoize(() -> new AsyncAuthenticationClient(clientOptions)); - this.deprecatedClient = Suppliers.memoize(() -> new AsyncDeprecatedClient(clientOptions)); + this.guardrailsClient = Suppliers.memoize(() -> new AsyncGuardrailsClient(clientOptions)); this.stringsClient = Suppliers.memoize(() -> new AsyncStringsClient(clientOptions)); this.filesClient = Suppliers.memoize(() -> new AsyncFilesClient(clientOptions)); } @@ -74,8 +75,8 @@ public AsyncAuthenticationClient authentication() { return this.authenticationClient.get(); } - public AsyncDeprecatedClient deprecated() { - return this.deprecatedClient.get(); + public AsyncGuardrailsClient guardrails() { + return this.guardrailsClient.get(); } public AsyncStringsClient strings() { diff --git a/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java b/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java index badaddd3..4d181dea 100644 --- a/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java +++ b/src/main/java/com/skyflow/generated/rest/core/ClientOptions.java @@ -34,7 +34,7 @@ private ClientOptions( { put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.skyflow.fern:api-sdk"); - put("X-Fern-SDK-Version", "0.0.219"); + put("X-Fern-SDK-Version", "0.0.276"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/skyflow/generated/rest/core/QueryStringMapperTest.java b/src/main/java/com/skyflow/generated/rest/core/QueryStringMapperTest.java deleted file mode 100644 index c5728721..00000000 --- a/src/main/java/com/skyflow/generated/rest/core/QueryStringMapperTest.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.core; - -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.HttpUrl; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class QueryStringMapperTest { - @Test - public void testObjectWithQuotedString_indexedArrays() { - Map map = new HashMap() { - { - put("hello", "\"world\""); - } - }; - - String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; - - String actualQueryString = queryString( - new HashMap() { - { - put("withquoted", map); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectWithQuotedString_arraysAsRepeats() { - Map map = new HashMap() { - { - put("hello", "\"world\""); - } - }; - - String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; - - String actualQueryString = queryString( - new HashMap() { - { - put("withquoted", map); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObject_indexedArrays() { - Map map = new HashMap() { - { - put("foo", "bar"); - put("baz", "qux"); - } - }; - - String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; - - String actualQueryString = queryString( - new HashMap() { - { - put("metadata", map); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObject_arraysAsRepeats() { - Map map = new HashMap() { - { - put("foo", "bar"); - put("baz", "qux"); - } - }; - - String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; - - String actualQueryString = queryString( - new HashMap() { - { - put("metadata", map); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testNestedObject_indexedArrays() { - Map> nestedMap = new HashMap>() { - { - put("mapkey1", new HashMap() { - { - put("mapkey1mapkey1", "mapkey1mapkey1value"); - put("mapkey1mapkey2", "mapkey1mapkey2value"); - } - }); - put("mapkey2", new HashMap() { - { - put("mapkey2mapkey1", "mapkey2mapkey1value"); - } - }); - } - }; - - String expectedQueryString = - "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" - + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; - - String actualQueryString = queryString( - new HashMap() { - { - put("nested", nestedMap); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testNestedObject_arraysAsRepeats() { - Map> nestedMap = new HashMap>() { - { - put("mapkey1", new HashMap() { - { - put("mapkey1mapkey1", "mapkey1mapkey1value"); - put("mapkey1mapkey2", "mapkey1mapkey2value"); - } - }); - put("mapkey2", new HashMap() { - { - put("mapkey2mapkey1", "mapkey2mapkey1value"); - } - }); - } - }; - - String expectedQueryString = - "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" - + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; - - String actualQueryString = queryString( - new HashMap() { - { - put("nested", nestedMap); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testDateTime_indexedArrays() { - OffsetDateTime dateTime = - OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); - - String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; - - String actualQueryString = queryString( - new HashMap() { - { - put("datetime", dateTime); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testDateTime_arraysAsRepeats() { - OffsetDateTime dateTime = - OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); - - String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; - - String actualQueryString = queryString( - new HashMap() { - { - put("datetime", dateTime); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectArray_indexedArrays() { - List> mapArray = new ArrayList>() { - { - add(new HashMap() { - { - put("key", "hello"); - put("value", "world"); - } - }); - add(new HashMap() { - { - put("key", "foo"); - put("value", "bar"); - } - }); - add(new HashMap<>()); - } - }; - - String expectedQueryString = "objects%5B0%5D%5Bvalue%5D=world&objects%5B0%5D%5Bkey%5D=hello&objects%5B1%5D" - + "%5Bvalue%5D=bar&objects%5B1%5D%5Bkey%5D=foo"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objects", mapArray); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectArray_arraysAsRepeats() { - List> mapArray = new ArrayList>() { - { - add(new HashMap() { - { - put("key", "hello"); - put("value", "world"); - } - }); - add(new HashMap() { - { - put("key", "foo"); - put("value", "bar"); - } - }); - add(new HashMap<>()); - } - }; - - String expectedQueryString = - "objects%5Bvalue%5D=world&objects%5Bkey%5D=hello&objects%5Bvalue" + "%5D=bar&objects%5Bkey%5D=foo"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objects", mapArray); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectWithArray_indexedArrays() { - Map objectWithArray = new HashMap() { - { - put("id", "abc123"); - put("contactIds", new ArrayList() { - { - add("id1"); - add("id2"); - add("id3"); - } - }); - } - }; - - String expectedQueryString = - "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds%5D%5B0%5D=id1&objectwitharray" - + "%5BcontactIds%5D%5B1%5D=id2&objectwitharray%5BcontactIds%5D%5B2%5D=id3"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objectwitharray", objectWithArray); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectWithArray_arraysAsRepeats() { - Map objectWithArray = new HashMap() { - { - put("id", "abc123"); - put("contactIds", new ArrayList() { - { - add("id1"); - add("id2"); - add("id3"); - } - }); - } - }; - - String expectedQueryString = "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds" - + "%5D=id1&objectwitharray%5BcontactIds%5D=id2&objectwitharray%5BcontactIds%5D=id3"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objectwitharray", objectWithArray); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - private static String queryString(Map params, boolean arraysAsRepeats) { - HttpUrl.Builder httpUrl = HttpUrl.parse("http://www.fakewebsite.com/").newBuilder(); - params.forEach((paramName, paramValue) -> - QueryStringMapper.addQueryParameter(httpUrl, paramName, paramValue, arraysAsRepeats)); - return httpUrl.build().encodedQuery(); - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/AsyncDeprecatedClient.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/AsyncDeprecatedClient.java deleted file mode 100644 index c1709f7f..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/AsyncDeprecatedClient.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated; - -import com.skyflow.generated.rest.core.ClientOptions; -import com.skyflow.generated.rest.core.RequestOptions; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectStatusRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectTextRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.V1DetectFileRequest; -import com.skyflow.generated.rest.types.V1DetectFileResponse; -import com.skyflow.generated.rest.types.V1DetectStatusResponse; -import com.skyflow.generated.rest.types.V1DetectTextResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncDeprecatedClient { - protected final ClientOptions clientOptions; - - private final AsyncRawDeprecatedClient rawClient; - - public AsyncDeprecatedClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawDeprecatedClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawDeprecatedClient withRawResponse() { - return this.rawClient; - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public CompletableFuture detectServiceDetectFileInput(V1DetectFileRequest request) { - return this.rawClient.detectServiceDetectFileInput(request).thenApply(response -> response.body()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public CompletableFuture detectServiceDetectFileInput( - V1DetectFileRequest request, RequestOptions requestOptions) { - return this.rawClient - .detectServiceDetectFileInput(request, requestOptions) - .thenApply(response -> response.body()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public CompletableFuture detectServiceDetectStatus(String id) { - return this.rawClient.detectServiceDetectStatus(id).thenApply(response -> response.body()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public CompletableFuture detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request) { - return this.rawClient.detectServiceDetectStatus(id, request).thenApply(response -> response.body()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public CompletableFuture detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request, RequestOptions requestOptions) { - return this.rawClient - .detectServiceDetectStatus(id, request, requestOptions) - .thenApply(response -> response.body()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public CompletableFuture detectServiceDetectText(DetectServiceDetectTextRequest request) { - return this.rawClient.detectServiceDetectText(request).thenApply(response -> response.body()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public CompletableFuture detectServiceDetectText( - DetectServiceDetectTextRequest request, RequestOptions requestOptions) { - return this.rawClient.detectServiceDetectText(request, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/AsyncRawDeprecatedClient.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/AsyncRawDeprecatedClient.java deleted file mode 100644 index 9c9ec79a..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/AsyncRawDeprecatedClient.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.skyflow.generated.rest.core.ApiClientApiException; -import com.skyflow.generated.rest.core.ApiClientException; -import com.skyflow.generated.rest.core.ApiClientHttpResponse; -import com.skyflow.generated.rest.core.ClientOptions; -import com.skyflow.generated.rest.core.MediaTypes; -import com.skyflow.generated.rest.core.ObjectMappers; -import com.skyflow.generated.rest.core.QueryStringMapper; -import com.skyflow.generated.rest.core.RequestOptions; -import com.skyflow.generated.rest.errors.NotFoundError; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectStatusRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectTextRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.V1DetectFileRequest; -import com.skyflow.generated.rest.types.V1DetectFileResponse; -import com.skyflow.generated.rest.types.V1DetectStatusResponse; -import com.skyflow.generated.rest.types.V1DetectTextResponse; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawDeprecatedClient { - protected final ClientOptions clientOptions; - - public AsyncRawDeprecatedClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public CompletableFuture> detectServiceDetectFileInput( - V1DetectFileRequest request) { - return detectServiceDetectFileInput(request, null); - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public CompletableFuture> detectServiceDetectFileInput( - V1DetectFileRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/detect/file") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new ApiClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture> future = new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - if (response.isSuccessful()) { - future.complete(new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), V1DetectFileResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - if (response.code() == 404) { - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - future.completeExceptionally(new ApiClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public CompletableFuture> detectServiceDetectStatus(String id) { - return detectServiceDetectStatus( - id, DetectServiceDetectStatusRequest.builder().build()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public CompletableFuture> detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request) { - return detectServiceDetectStatus(id, request, null); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public CompletableFuture> detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/detect/status") - .addPathSegment(id); - if (request.getVaultId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "vault_id", request.getVaultId().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture> future = new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - if (response.isSuccessful()) { - future.complete(new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), V1DetectStatusResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - if (response.code() == 404) { - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - future.completeExceptionally(new ApiClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public CompletableFuture> detectServiceDetectText( - DetectServiceDetectTextRequest request) { - return detectServiceDetectText(request, null); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public CompletableFuture> detectServiceDetectText( - DetectServiceDetectTextRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/detect/text") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new ApiClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture> future = new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - if (response.isSuccessful()) { - future.complete(new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), V1DetectTextResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - if (response.code() == 404) { - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - future.completeExceptionally(new ApiClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/DeprecatedClient.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/DeprecatedClient.java deleted file mode 100644 index 820a349b..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/DeprecatedClient.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated; - -import com.skyflow.generated.rest.core.ClientOptions; -import com.skyflow.generated.rest.core.RequestOptions; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectStatusRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectTextRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.V1DetectFileRequest; -import com.skyflow.generated.rest.types.V1DetectFileResponse; -import com.skyflow.generated.rest.types.V1DetectStatusResponse; -import com.skyflow.generated.rest.types.V1DetectTextResponse; - -public class DeprecatedClient { - protected final ClientOptions clientOptions; - - private final RawDeprecatedClient rawClient; - - public DeprecatedClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawDeprecatedClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawDeprecatedClient withRawResponse() { - return this.rawClient; - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public V1DetectFileResponse detectServiceDetectFileInput(V1DetectFileRequest request) { - return this.rawClient.detectServiceDetectFileInput(request).body(); - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public V1DetectFileResponse detectServiceDetectFileInput( - V1DetectFileRequest request, RequestOptions requestOptions) { - return this.rawClient - .detectServiceDetectFileInput(request, requestOptions) - .body(); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public V1DetectStatusResponse detectServiceDetectStatus(String id) { - return this.rawClient.detectServiceDetectStatus(id).body(); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public V1DetectStatusResponse detectServiceDetectStatus(String id, DetectServiceDetectStatusRequest request) { - return this.rawClient.detectServiceDetectStatus(id, request).body(); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public V1DetectStatusResponse detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request, RequestOptions requestOptions) { - return this.rawClient - .detectServiceDetectStatus(id, request, requestOptions) - .body(); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public V1DetectTextResponse detectServiceDetectText(DetectServiceDetectTextRequest request) { - return this.rawClient.detectServiceDetectText(request).body(); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public V1DetectTextResponse detectServiceDetectText( - DetectServiceDetectTextRequest request, RequestOptions requestOptions) { - return this.rawClient.detectServiceDetectText(request, requestOptions).body(); - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/RawDeprecatedClient.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/RawDeprecatedClient.java deleted file mode 100644 index 4472487f..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/RawDeprecatedClient.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.skyflow.generated.rest.core.ApiClientApiException; -import com.skyflow.generated.rest.core.ApiClientException; -import com.skyflow.generated.rest.core.ApiClientHttpResponse; -import com.skyflow.generated.rest.core.ClientOptions; -import com.skyflow.generated.rest.core.MediaTypes; -import com.skyflow.generated.rest.core.ObjectMappers; -import com.skyflow.generated.rest.core.QueryStringMapper; -import com.skyflow.generated.rest.core.RequestOptions; -import com.skyflow.generated.rest.errors.NotFoundError; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectStatusRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.DetectServiceDetectTextRequest; -import com.skyflow.generated.rest.resources.deprecated.requests.V1DetectFileRequest; -import com.skyflow.generated.rest.types.V1DetectFileResponse; -import com.skyflow.generated.rest.types.V1DetectStatusResponse; -import com.skyflow.generated.rest.types.V1DetectTextResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawDeprecatedClient { - protected final ClientOptions clientOptions; - - public RawDeprecatedClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public ApiClientHttpResponse detectServiceDetectFileInput(V1DetectFileRequest request) { - return detectServiceDetectFileInput(request, null); - } - - /** - * <b>Note</b>: This operation is deprecated. Use one of the <a href=#De-identify%20File>De-identify File</a> operations.<br/><br/>Detects and deidentifies sensitive data from image, audio, and video files. - */ - public ApiClientHttpResponse detectServiceDetectFileInput( - V1DetectFileRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/detect/file") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new ApiClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), V1DetectFileResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - if (response.code() == 404) { - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - throw new ApiClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new ApiClientException("Network error executing HTTP request", e); - } - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public ApiClientHttpResponse detectServiceDetectStatus(String id) { - return detectServiceDetectStatus( - id, DetectServiceDetectStatusRequest.builder().build()); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public ApiClientHttpResponse detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request) { - return detectServiceDetectStatus(id, request, null); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#get_detect_run>Get Detect Run</a>.<br/><br/>Returns the status of a file deidentification request. - */ - public ApiClientHttpResponse detectServiceDetectStatus( - String id, DetectServiceDetectStatusRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/detect/status") - .addPathSegment(id); - if (request.getVaultId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "vault_id", request.getVaultId().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), V1DetectStatusResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - if (response.code() == 404) { - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - throw new ApiClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new ApiClientException("Network error executing HTTP request", e); - } - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public ApiClientHttpResponse detectServiceDetectText(DetectServiceDetectTextRequest request) { - return detectServiceDetectText(request, null); - } - - /** - * <b>Note</b>: This operation is deprecated. Use <a href=#deidentify_string>De-identify String</a>.<br/><br/>Detects and deidentifies sensitive data from text. - */ - public ApiClientHttpResponse detectServiceDetectText( - DetectServiceDetectTextRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/detect/text") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new ApiClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), V1DetectTextResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - if (response.code() == 404) { - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - throw new ApiClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new ApiClientException("Network error executing HTTP request", e); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/DetectServiceDetectStatusRequest.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/DetectServiceDetectStatusRequest.java deleted file mode 100644 index 45997db3..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/DetectServiceDetectStatusRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated.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.skyflow.generated.rest.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 = DetectServiceDetectStatusRequest.Builder.class) -public final class DetectServiceDetectStatusRequest { - private final Optional vaultId; - - private final Map additionalProperties; - - private DetectServiceDetectStatusRequest(Optional vaultId, Map additionalProperties) { - this.vaultId = vaultId; - this.additionalProperties = additionalProperties; - } - - /** - * @return ID of the vault. - */ - @JsonProperty("vault_id") - public Optional getVaultId() { - return vaultId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DetectServiceDetectStatusRequest && equalTo((DetectServiceDetectStatusRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DetectServiceDetectStatusRequest other) { - return vaultId.equals(other.vaultId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.vaultId); - } - - @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 vaultId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(DetectServiceDetectStatusRequest other) { - vaultId(other.getVaultId()); - return this; - } - - /** - *

ID of the vault.

- */ - @JsonSetter(value = "vault_id", nulls = Nulls.SKIP) - public Builder vaultId(Optional vaultId) { - this.vaultId = vaultId; - return this; - } - - public Builder vaultId(String vaultId) { - this.vaultId = Optional.ofNullable(vaultId); - return this; - } - - public DetectServiceDetectStatusRequest build() { - return new DetectServiceDetectStatusRequest(vaultId, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/DetectServiceDetectTextRequest.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/DetectServiceDetectTextRequest.java deleted file mode 100644 index 3c4b4ea2..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/DetectServiceDetectTextRequest.java +++ /dev/null @@ -1,526 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated.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.skyflow.generated.rest.core.ObjectMappers; -import com.skyflow.generated.rest.types.DetectDataAccuracy; -import com.skyflow.generated.rest.types.DetectDataEntities; -import com.skyflow.generated.rest.types.DetectRequestDeidentifyOption; -import com.skyflow.generated.rest.types.V1AdvancedOptions; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DetectServiceDetectTextRequest.Builder.class) -public final class DetectServiceDetectTextRequest { - private final String text; - - private final String vaultId; - - private final Optional sessionId; - - private final Optional> restrictEntityTypes; - - private final Optional deidentifyTokenFormat; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional returnEntities; - - private final Optional accuracy; - - private final Optional advancedOptions; - - private final Optional storeEntities; - - private final Map additionalProperties; - - private DetectServiceDetectTextRequest( - String text, - String vaultId, - Optional sessionId, - Optional> restrictEntityTypes, - Optional deidentifyTokenFormat, - Optional> allowRegex, - Optional> restrictRegex, - Optional returnEntities, - Optional accuracy, - Optional advancedOptions, - Optional storeEntities, - Map additionalProperties) { - this.text = text; - this.vaultId = vaultId; - this.sessionId = sessionId; - this.restrictEntityTypes = restrictEntityTypes; - this.deidentifyTokenFormat = deidentifyTokenFormat; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.returnEntities = returnEntities; - this.accuracy = accuracy; - this.advancedOptions = advancedOptions; - this.storeEntities = storeEntities; - this.additionalProperties = additionalProperties; - } - - /** - * @return Data to deidentify. - */ - @JsonProperty("text") - public String getText() { - return text; - } - - /** - * @return ID of the vault. - */ - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return Will give a handle to delete the tokens generated during a specific interaction. - */ - @JsonProperty("session_id") - public Optional getSessionId() { - return sessionId; - } - - /** - * @return Entities to detect and deidentify. - */ - @JsonProperty("restrict_entity_types") - public Optional> getRestrictEntityTypes() { - return restrictEntityTypes; - } - - @JsonProperty("deidentify_token_format") - public Optional getDeidentifyTokenFormat() { - return deidentifyTokenFormat; - } - - /** - * @return Regular expressions to ignore when detecting entities. - */ - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - /** - * @return Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'. - */ - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - /** - * @return If true, returns the details for the detected entities. - */ - @JsonProperty("return_entities") - public Optional getReturnEntities() { - return returnEntities; - } - - @JsonProperty("accuracy") - public Optional getAccuracy() { - return accuracy; - } - - @JsonProperty("advanced_options") - public Optional getAdvancedOptions() { - return advancedOptions; - } - - /** - * @return Indicates whether entities should be stored in the vault. - */ - @JsonProperty("store_entities") - public Optional getStoreEntities() { - return storeEntities; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DetectServiceDetectTextRequest && equalTo((DetectServiceDetectTextRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DetectServiceDetectTextRequest other) { - return text.equals(other.text) - && vaultId.equals(other.vaultId) - && sessionId.equals(other.sessionId) - && restrictEntityTypes.equals(other.restrictEntityTypes) - && deidentifyTokenFormat.equals(other.deidentifyTokenFormat) - && allowRegex.equals(other.allowRegex) - && restrictRegex.equals(other.restrictRegex) - && returnEntities.equals(other.returnEntities) - && accuracy.equals(other.accuracy) - && advancedOptions.equals(other.advancedOptions) - && storeEntities.equals(other.storeEntities); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.text, - this.vaultId, - this.sessionId, - this.restrictEntityTypes, - this.deidentifyTokenFormat, - this.allowRegex, - this.restrictRegex, - this.returnEntities, - this.accuracy, - this.advancedOptions, - this.storeEntities); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TextStage builder() { - return new Builder(); - } - - public interface TextStage { - /** - * Data to deidentify. - */ - VaultIdStage text(@NotNull String text); - - Builder from(DetectServiceDetectTextRequest other); - } - - public interface VaultIdStage { - /** - * ID of the vault. - */ - _FinalStage vaultId(@NotNull String vaultId); - } - - public interface _FinalStage { - DetectServiceDetectTextRequest build(); - - /** - *

Will give a handle to delete the tokens generated during a specific interaction.

- */ - _FinalStage sessionId(Optional sessionId); - - _FinalStage sessionId(String sessionId); - - /** - *

Entities to detect and deidentify.

- */ - _FinalStage restrictEntityTypes(Optional> restrictEntityTypes); - - _FinalStage restrictEntityTypes(List restrictEntityTypes); - - _FinalStage deidentifyTokenFormat(Optional deidentifyTokenFormat); - - _FinalStage deidentifyTokenFormat(DetectRequestDeidentifyOption deidentifyTokenFormat); - - /** - *

Regular expressions to ignore when detecting entities.

- */ - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - /** - *

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

- */ - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - /** - *

If true, returns the details for the detected entities.

- */ - _FinalStage returnEntities(Optional returnEntities); - - _FinalStage returnEntities(Boolean returnEntities); - - _FinalStage accuracy(Optional accuracy); - - _FinalStage accuracy(DetectDataAccuracy accuracy); - - _FinalStage advancedOptions(Optional advancedOptions); - - _FinalStage advancedOptions(V1AdvancedOptions advancedOptions); - - /** - *

Indicates whether entities should be stored in the vault.

- */ - _FinalStage storeEntities(Optional storeEntities); - - _FinalStage storeEntities(Boolean storeEntities); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TextStage, VaultIdStage, _FinalStage { - private String text; - - private String vaultId; - - private Optional storeEntities = Optional.empty(); - - private Optional advancedOptions = Optional.empty(); - - private Optional accuracy = Optional.empty(); - - private Optional returnEntities = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional deidentifyTokenFormat = Optional.empty(); - - private Optional> restrictEntityTypes = Optional.empty(); - - private Optional sessionId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DetectServiceDetectTextRequest other) { - text(other.getText()); - vaultId(other.getVaultId()); - sessionId(other.getSessionId()); - restrictEntityTypes(other.getRestrictEntityTypes()); - deidentifyTokenFormat(other.getDeidentifyTokenFormat()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - returnEntities(other.getReturnEntities()); - accuracy(other.getAccuracy()); - advancedOptions(other.getAdvancedOptions()); - storeEntities(other.getStoreEntities()); - return this; - } - - /** - * Data to deidentify.

Data to deidentify.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("text") - public VaultIdStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); - return this; - } - - /** - * ID of the vault.

ID of the vault.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("vault_id") - public _FinalStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - *

Indicates whether entities should be stored in the vault.

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

Indicates whether entities should be stored in the vault.

- */ - @java.lang.Override - @JsonSetter(value = "store_entities", nulls = Nulls.SKIP) - public _FinalStage storeEntities(Optional storeEntities) { - this.storeEntities = storeEntities; - return this; - } - - @java.lang.Override - public _FinalStage advancedOptions(V1AdvancedOptions advancedOptions) { - this.advancedOptions = Optional.ofNullable(advancedOptions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_options", nulls = Nulls.SKIP) - public _FinalStage advancedOptions(Optional advancedOptions) { - this.advancedOptions = advancedOptions; - return this; - } - - @java.lang.Override - public _FinalStage accuracy(DetectDataAccuracy accuracy) { - this.accuracy = Optional.ofNullable(accuracy); - return this; - } - - @java.lang.Override - @JsonSetter(value = "accuracy", nulls = Nulls.SKIP) - public _FinalStage accuracy(Optional accuracy) { - this.accuracy = accuracy; - return this; - } - - /** - *

If true, returns the details for the detected entities.

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

If true, returns the details for the detected entities.

- */ - @java.lang.Override - @JsonSetter(value = "return_entities", nulls = Nulls.SKIP) - public _FinalStage returnEntities(Optional returnEntities) { - this.returnEntities = returnEntities; - return this; - } - - /** - *

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

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

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

- */ - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - /** - *

Regular expressions to ignore when detecting entities.

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

Regular expressions to ignore when detecting entities.

- */ - @java.lang.Override - @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) - public _FinalStage allowRegex(Optional> allowRegex) { - this.allowRegex = allowRegex; - return this; - } - - @java.lang.Override - public _FinalStage deidentifyTokenFormat(DetectRequestDeidentifyOption deidentifyTokenFormat) { - this.deidentifyTokenFormat = Optional.ofNullable(deidentifyTokenFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "deidentify_token_format", nulls = Nulls.SKIP) - public _FinalStage deidentifyTokenFormat(Optional deidentifyTokenFormat) { - this.deidentifyTokenFormat = deidentifyTokenFormat; - return this; - } - - /** - *

Entities to detect and deidentify.

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

Entities to detect and deidentify.

- */ - @java.lang.Override - @JsonSetter(value = "restrict_entity_types", nulls = Nulls.SKIP) - public _FinalStage restrictEntityTypes(Optional> restrictEntityTypes) { - this.restrictEntityTypes = restrictEntityTypes; - return this; - } - - /** - *

Will give a handle to delete the tokens generated during a specific interaction.

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

Will give a handle to delete the tokens generated during a specific interaction.

- */ - @java.lang.Override - @JsonSetter(value = "session_id", nulls = Nulls.SKIP) - public _FinalStage sessionId(Optional sessionId) { - this.sessionId = sessionId; - return this; - } - - @java.lang.Override - public DetectServiceDetectTextRequest build() { - return new DetectServiceDetectTextRequest( - text, - vaultId, - sessionId, - restrictEntityTypes, - deidentifyTokenFormat, - allowRegex, - restrictRegex, - returnEntities, - accuracy, - advancedOptions, - storeEntities, - additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/V1DetectFileRequest.java b/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/V1DetectFileRequest.java deleted file mode 100644 index 8bdee935..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/deprecated/requests/V1DetectFileRequest.java +++ /dev/null @@ -1,634 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.deprecated.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.skyflow.generated.rest.core.ObjectMappers; -import com.skyflow.generated.rest.types.DetectDataAccuracy; -import com.skyflow.generated.rest.types.DetectDataEntities; -import com.skyflow.generated.rest.types.DetectFileRequestDataType; -import com.skyflow.generated.rest.types.DetectRequestDeidentifyOption; -import com.skyflow.generated.rest.types.V1AdvancedOptions; -import com.skyflow.generated.rest.types.V1AudioConfig; -import com.skyflow.generated.rest.types.V1FileDataFormat; -import com.skyflow.generated.rest.types.V1ImageOptions; -import com.skyflow.generated.rest.types.V1PdfConfig; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = V1DetectFileRequest.Builder.class) -public final class V1DetectFileRequest { - private final String file; - - private final V1FileDataFormat dataFormat; - - private final DetectFileRequestDataType inputType; - - private final String vaultId; - - private final Optional sessionId; - - private final Optional> restrictEntityTypes; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional returnEntities; - - private final Optional accuracy; - - private final Optional audio; - - private final Optional image; - - private final Optional pdf; - - private final Optional advancedOptions; - - private final Optional deidentifyTokenFormat; - - private final Map additionalProperties; - - private V1DetectFileRequest( - String file, - V1FileDataFormat dataFormat, - DetectFileRequestDataType inputType, - String vaultId, - Optional sessionId, - Optional> restrictEntityTypes, - Optional> allowRegex, - Optional> restrictRegex, - Optional returnEntities, - Optional accuracy, - Optional audio, - Optional image, - Optional pdf, - Optional advancedOptions, - Optional deidentifyTokenFormat, - Map additionalProperties) { - this.file = file; - this.dataFormat = dataFormat; - this.inputType = inputType; - this.vaultId = vaultId; - this.sessionId = sessionId; - this.restrictEntityTypes = restrictEntityTypes; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.returnEntities = returnEntities; - this.accuracy = accuracy; - this.audio = audio; - this.image = image; - this.pdf = pdf; - this.advancedOptions = advancedOptions; - this.deidentifyTokenFormat = deidentifyTokenFormat; - this.additionalProperties = additionalProperties; - } - - /** - * @return Path of the file or base64-encoded data that has to be processed. - */ - @JsonProperty("file") - public String getFile() { - return file; - } - - @JsonProperty("data_format") - public V1FileDataFormat getDataFormat() { - return dataFormat; - } - - @JsonProperty("input_type") - public DetectFileRequestDataType getInputType() { - return inputType; - } - - /** - * @return ID of the vault. - */ - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return Will give a handle to delete the tokens generated during a specific interaction. - */ - @JsonProperty("session_id") - public Optional getSessionId() { - return sessionId; - } - - /** - * @return Entities to detect and deidentify. - */ - @JsonProperty("restrict_entity_types") - public Optional> getRestrictEntityTypes() { - return restrictEntityTypes; - } - - /** - * @return Regular expressions to ignore when detecting entities. - */ - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - /** - * @return Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'. - */ - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - /** - * @return If true, returns the details for the detected entities. - */ - @JsonProperty("return_entities") - public Optional getReturnEntities() { - return returnEntities; - } - - @JsonProperty("accuracy") - public Optional getAccuracy() { - return accuracy; - } - - @JsonProperty("audio") - public Optional getAudio() { - return audio; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("pdf") - public Optional getPdf() { - return pdf; - } - - @JsonProperty("advanced_options") - public Optional getAdvancedOptions() { - return advancedOptions; - } - - @JsonProperty("deidentify_token_format") - public Optional getDeidentifyTokenFormat() { - return deidentifyTokenFormat; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1DetectFileRequest && equalTo((V1DetectFileRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1DetectFileRequest other) { - return file.equals(other.file) - && dataFormat.equals(other.dataFormat) - && inputType.equals(other.inputType) - && vaultId.equals(other.vaultId) - && sessionId.equals(other.sessionId) - && restrictEntityTypes.equals(other.restrictEntityTypes) - && allowRegex.equals(other.allowRegex) - && restrictRegex.equals(other.restrictRegex) - && returnEntities.equals(other.returnEntities) - && accuracy.equals(other.accuracy) - && audio.equals(other.audio) - && image.equals(other.image) - && pdf.equals(other.pdf) - && advancedOptions.equals(other.advancedOptions) - && deidentifyTokenFormat.equals(other.deidentifyTokenFormat); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.file, - this.dataFormat, - this.inputType, - this.vaultId, - this.sessionId, - this.restrictEntityTypes, - this.allowRegex, - this.restrictRegex, - this.returnEntities, - this.accuracy, - this.audio, - this.image, - this.pdf, - this.advancedOptions, - this.deidentifyTokenFormat); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FileStage builder() { - return new Builder(); - } - - public interface FileStage { - /** - * Path of the file or base64-encoded data that has to be processed. - */ - DataFormatStage file(@NotNull String file); - - Builder from(V1DetectFileRequest other); - } - - public interface DataFormatStage { - InputTypeStage dataFormat(@NotNull V1FileDataFormat dataFormat); - } - - public interface InputTypeStage { - VaultIdStage inputType(@NotNull DetectFileRequestDataType inputType); - } - - public interface VaultIdStage { - /** - * ID of the vault. - */ - _FinalStage vaultId(@NotNull String vaultId); - } - - public interface _FinalStage { - V1DetectFileRequest build(); - - /** - *

Will give a handle to delete the tokens generated during a specific interaction.

- */ - _FinalStage sessionId(Optional sessionId); - - _FinalStage sessionId(String sessionId); - - /** - *

Entities to detect and deidentify.

- */ - _FinalStage restrictEntityTypes(Optional> restrictEntityTypes); - - _FinalStage restrictEntityTypes(List restrictEntityTypes); - - /** - *

Regular expressions to ignore when detecting entities.

- */ - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - /** - *

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

- */ - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - /** - *

If true, returns the details for the detected entities.

- */ - _FinalStage returnEntities(Optional returnEntities); - - _FinalStage returnEntities(Boolean returnEntities); - - _FinalStage accuracy(Optional accuracy); - - _FinalStage accuracy(DetectDataAccuracy accuracy); - - _FinalStage audio(Optional audio); - - _FinalStage audio(V1AudioConfig audio); - - _FinalStage image(Optional image); - - _FinalStage image(V1ImageOptions image); - - _FinalStage pdf(Optional pdf); - - _FinalStage pdf(V1PdfConfig pdf); - - _FinalStage advancedOptions(Optional advancedOptions); - - _FinalStage advancedOptions(V1AdvancedOptions advancedOptions); - - _FinalStage deidentifyTokenFormat(Optional deidentifyTokenFormat); - - _FinalStage deidentifyTokenFormat(DetectRequestDeidentifyOption deidentifyTokenFormat); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FileStage, DataFormatStage, InputTypeStage, VaultIdStage, _FinalStage { - private String file; - - private V1FileDataFormat dataFormat; - - private DetectFileRequestDataType inputType; - - private String vaultId; - - private Optional deidentifyTokenFormat = Optional.empty(); - - private Optional advancedOptions = Optional.empty(); - - private Optional pdf = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional audio = Optional.empty(); - - private Optional accuracy = Optional.empty(); - - private Optional returnEntities = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional> restrictEntityTypes = Optional.empty(); - - private Optional sessionId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(V1DetectFileRequest other) { - file(other.getFile()); - dataFormat(other.getDataFormat()); - inputType(other.getInputType()); - vaultId(other.getVaultId()); - sessionId(other.getSessionId()); - restrictEntityTypes(other.getRestrictEntityTypes()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - returnEntities(other.getReturnEntities()); - accuracy(other.getAccuracy()); - audio(other.getAudio()); - image(other.getImage()); - pdf(other.getPdf()); - advancedOptions(other.getAdvancedOptions()); - deidentifyTokenFormat(other.getDeidentifyTokenFormat()); - return this; - } - - /** - * Path of the file or base64-encoded data that has to be processed.

Path of the file or base64-encoded data that has to be processed.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("file") - public DataFormatStage file(@NotNull String file) { - this.file = Objects.requireNonNull(file, "file must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("data_format") - public InputTypeStage dataFormat(@NotNull V1FileDataFormat dataFormat) { - this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("input_type") - public VaultIdStage inputType(@NotNull DetectFileRequestDataType inputType) { - this.inputType = Objects.requireNonNull(inputType, "inputType must not be null"); - return this; - } - - /** - * ID of the vault.

ID of the vault.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("vault_id") - public _FinalStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage deidentifyTokenFormat(DetectRequestDeidentifyOption deidentifyTokenFormat) { - this.deidentifyTokenFormat = Optional.ofNullable(deidentifyTokenFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "deidentify_token_format", nulls = Nulls.SKIP) - public _FinalStage deidentifyTokenFormat(Optional deidentifyTokenFormat) { - this.deidentifyTokenFormat = deidentifyTokenFormat; - return this; - } - - @java.lang.Override - public _FinalStage advancedOptions(V1AdvancedOptions advancedOptions) { - this.advancedOptions = Optional.ofNullable(advancedOptions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_options", nulls = Nulls.SKIP) - public _FinalStage advancedOptions(Optional advancedOptions) { - this.advancedOptions = advancedOptions; - return this; - } - - @java.lang.Override - public _FinalStage pdf(V1PdfConfig pdf) { - this.pdf = Optional.ofNullable(pdf); - return this; - } - - @java.lang.Override - @JsonSetter(value = "pdf", nulls = Nulls.SKIP) - public _FinalStage pdf(Optional pdf) { - this.pdf = pdf; - return this; - } - - @java.lang.Override - public _FinalStage image(V1ImageOptions image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage audio(V1AudioConfig audio) { - this.audio = Optional.ofNullable(audio); - return this; - } - - @java.lang.Override - @JsonSetter(value = "audio", nulls = Nulls.SKIP) - public _FinalStage audio(Optional audio) { - this.audio = audio; - return this; - } - - @java.lang.Override - public _FinalStage accuracy(DetectDataAccuracy accuracy) { - this.accuracy = Optional.ofNullable(accuracy); - return this; - } - - @java.lang.Override - @JsonSetter(value = "accuracy", nulls = Nulls.SKIP) - public _FinalStage accuracy(Optional accuracy) { - this.accuracy = accuracy; - return this; - } - - /** - *

If true, returns the details for the detected entities.

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

If true, returns the details for the detected entities.

- */ - @java.lang.Override - @JsonSetter(value = "return_entities", nulls = Nulls.SKIP) - public _FinalStage returnEntities(Optional returnEntities) { - this.returnEntities = returnEntities; - return this; - } - - /** - *

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

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

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

- */ - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - /** - *

Regular expressions to ignore when detecting entities.

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

Regular expressions to ignore when detecting entities.

- */ - @java.lang.Override - @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) - public _FinalStage allowRegex(Optional> allowRegex) { - this.allowRegex = allowRegex; - return this; - } - - /** - *

Entities to detect and deidentify.

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

Entities to detect and deidentify.

- */ - @java.lang.Override - @JsonSetter(value = "restrict_entity_types", nulls = Nulls.SKIP) - public _FinalStage restrictEntityTypes(Optional> restrictEntityTypes) { - this.restrictEntityTypes = restrictEntityTypes; - return this; - } - - /** - *

Will give a handle to delete the tokens generated during a specific interaction.

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

Will give a handle to delete the tokens generated during a specific interaction.

- */ - @java.lang.Override - @JsonSetter(value = "session_id", nulls = Nulls.SKIP) - public _FinalStage sessionId(Optional sessionId) { - this.sessionId = sessionId; - return this; - } - - @java.lang.Override - public V1DetectFileRequest build() { - return new V1DetectFileRequest( - file, - dataFormat, - inputType, - vaultId, - sessionId, - restrictEntityTypes, - allowRegex, - restrictRegex, - returnEntities, - accuracy, - audio, - image, - pdf, - advancedOptions, - deidentifyTokenFormat, - additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/AsyncFilesClient.java b/src/main/java/com/skyflow/generated/rest/resources/files/AsyncFilesClient.java index 48692d9f..782d2d2b 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/AsyncFilesClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/AsyncFilesClient.java @@ -15,8 +15,10 @@ import com.skyflow.generated.rest.resources.files.requests.DeidentifyStructuredTextRequest; import com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; import com.skyflow.generated.rest.types.DeidentifyFileResponse; import com.skyflow.generated.rest.types.DeidentifyStatusResponse; +import com.skyflow.generated.rest.types.ReidentifyFileResponse; import java.util.concurrent.CompletableFuture; public class AsyncFilesClient { @@ -185,4 +187,19 @@ public CompletableFuture getRun( String runId, GetRunRequest request, RequestOptions requestOptions) { return this.rawClient.getRun(runId, request, requestOptions).thenApply(response -> response.body()); } + + /** + * Re-identifies tokens in a file. + */ + public CompletableFuture reidentifyFile(ReidentifyFileRequest request) { + return this.rawClient.reidentifyFile(request).thenApply(response -> response.body()); + } + + /** + * Re-identifies tokens in a file. + */ + public CompletableFuture reidentifyFile( + ReidentifyFileRequest request, RequestOptions requestOptions) { + return this.rawClient.reidentifyFile(request, requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/AsyncRawFilesClient.java b/src/main/java/com/skyflow/generated/rest/resources/files/AsyncRawFilesClient.java index f400bb2a..4672288a 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/AsyncRawFilesClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/AsyncRawFilesClient.java @@ -26,9 +26,11 @@ import com.skyflow.generated.rest.resources.files.requests.DeidentifyStructuredTextRequest; import com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; import com.skyflow.generated.rest.types.DeidentifyFileResponse; import com.skyflow.generated.rest.types.DeidentifyStatusResponse; import com.skyflow.generated.rest.types.ErrorResponse; +import com.skyflow.generated.rest.types.ReidentifyFileResponse; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -926,4 +928,92 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { }); return future; } + + /** + * Re-identifies tokens in a file. + */ + public CompletableFuture> reidentifyFile( + ReidentifyFileRequest request) { + return reidentifyFile(request, null); + } + + /** + * Re-identifies tokens in a file. + */ + public CompletableFuture> reidentifyFile( + ReidentifyFileRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/detect/reidentify/file") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ApiClientException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ApiClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ReidentifyFileResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + future.completeExceptionally(new ApiClientApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); + } + }); + return future; + } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/FilesClient.java b/src/main/java/com/skyflow/generated/rest/resources/files/FilesClient.java index 89898d41..5eee1560 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/FilesClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/FilesClient.java @@ -15,8 +15,10 @@ import com.skyflow.generated.rest.resources.files.requests.DeidentifyStructuredTextRequest; import com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; import com.skyflow.generated.rest.types.DeidentifyFileResponse; import com.skyflow.generated.rest.types.DeidentifyStatusResponse; +import com.skyflow.generated.rest.types.ReidentifyFileResponse; public class FilesClient { protected final ClientOptions clientOptions; @@ -177,4 +179,18 @@ public DeidentifyStatusResponse getRun(String runId, GetRunRequest request) { public DeidentifyStatusResponse getRun(String runId, GetRunRequest request, RequestOptions requestOptions) { return this.rawClient.getRun(runId, request, requestOptions).body(); } + + /** + * Re-identifies tokens in a file. + */ + public ReidentifyFileResponse reidentifyFile(ReidentifyFileRequest request) { + return this.rawClient.reidentifyFile(request).body(); + } + + /** + * Re-identifies tokens in a file. + */ + public ReidentifyFileResponse reidentifyFile(ReidentifyFileRequest request, RequestOptions requestOptions) { + return this.rawClient.reidentifyFile(request, requestOptions).body(); + } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/RawFilesClient.java b/src/main/java/com/skyflow/generated/rest/resources/files/RawFilesClient.java index 85939625..d0fb0bfc 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/RawFilesClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/RawFilesClient.java @@ -26,9 +26,11 @@ import com.skyflow.generated.rest.resources.files.requests.DeidentifyStructuredTextRequest; import com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; import com.skyflow.generated.rest.types.DeidentifyFileResponse; import com.skyflow.generated.rest.types.DeidentifyStatusResponse; import com.skyflow.generated.rest.types.ErrorResponse; +import com.skyflow.generated.rest.types.ReidentifyFileResponse; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -711,4 +713,71 @@ public ApiClientHttpResponse getRun( throw new ApiClientException("Network error executing HTTP request", e); } } + + /** + * Re-identifies tokens in a file. + */ + public ApiClientHttpResponse reidentifyFile(ReidentifyFileRequest request) { + return reidentifyFile(request, null); + } + + /** + * Re-identifies tokens in a file. + */ + public ApiClientHttpResponse reidentifyFile( + ReidentifyFileRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/detect/reidentify/file") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ApiClientException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ApiClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReidentifyFileResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new ApiClientApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new ApiClientException("Network error executing HTTP request", e); + } + } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyAudioRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyAudioRequest.java index 5f4929aa..b9f02d97 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyAudioRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyAudioRequest.java @@ -31,6 +31,8 @@ public final class DeidentifyAudioRequest { private final DeidentifyAudioRequestFile file; + private final Optional configurationId; + private final Optional outputProcessedAudio; private final Optional outputTranscription; @@ -58,6 +60,7 @@ public final class DeidentifyAudioRequest { private DeidentifyAudioRequest( String vaultId, DeidentifyAudioRequestFile file, + Optional configurationId, Optional outputProcessedAudio, Optional outputTranscription, Optional bleepGain, @@ -72,6 +75,7 @@ private DeidentifyAudioRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.outputProcessedAudio = outputProcessedAudio; this.outputTranscription = outputTranscription; this.bleepGain = bleepGain; @@ -99,6 +103,11 @@ public DeidentifyAudioRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + /** * @return If true, includes processed audio file in the response. */ @@ -186,6 +195,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyAudioRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && outputProcessedAudio.equals(other.outputProcessedAudio) && outputTranscription.equals(other.outputTranscription) && bleepGain.equals(other.bleepGain) @@ -204,6 +214,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.outputProcessedAudio, this.outputTranscription, this.bleepGain, @@ -242,6 +253,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyAudioRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + /** *

If true, includes processed audio file in the response.

*/ @@ -333,6 +348,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional outputProcessedAudio = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -342,6 +359,7 @@ private Builder() {} public Builder from(DeidentifyAudioRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); outputProcessedAudio(other.getOutputProcessedAudio()); outputTranscription(other.getOutputTranscription()); bleepGain(other.getBleepGain()); @@ -560,11 +578,25 @@ public _FinalStage outputProcessedAudio(Optional outputProcessedAudio) return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyAudioRequest build() { return new DeidentifyAudioRequest( vaultId, file, + configurationId, outputProcessedAudio, outputTranscription, bleepGain, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyDocumentRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyDocumentRequest.java index bf6f307e..dd2d1548 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyDocumentRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyDocumentRequest.java @@ -30,6 +30,8 @@ public final class DeidentifyDocumentRequest { private final DeidentifyDocumentRequestFile file; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -45,6 +47,7 @@ public final class DeidentifyDocumentRequest { private DeidentifyDocumentRequest( String vaultId, DeidentifyDocumentRequestFile file, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -53,6 +56,7 @@ private DeidentifyDocumentRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -74,6 +78,11 @@ public DeidentifyDocumentRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -113,6 +122,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyDocumentRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -125,6 +135,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -157,6 +168,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyDocumentRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -194,6 +209,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -203,6 +220,7 @@ private Builder() {} public Builder from(DeidentifyDocumentRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -294,11 +312,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyDocumentRequest build() { return new DeidentifyDocumentRequest( vaultId, file, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequest.java index 1cbcd8f1..ae21845d 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequest.java @@ -30,6 +30,8 @@ public final class DeidentifyFileRequest { private final DeidentifyFileRequestFile file; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -45,6 +47,7 @@ public final class DeidentifyFileRequest { private DeidentifyFileRequest( String vaultId, DeidentifyFileRequestFile file, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -53,6 +56,7 @@ private DeidentifyFileRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -74,6 +78,11 @@ public DeidentifyFileRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -113,6 +122,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyFileRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -125,6 +135,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -157,6 +168,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyFileRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -194,6 +209,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -203,6 +220,7 @@ private Builder() {} public Builder from(DeidentifyFileRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -294,11 +312,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyFileRequest build() { return new DeidentifyFileRequest( vaultId, file, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyImageRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyImageRequest.java index 41de24b2..92445d02 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyImageRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyImageRequest.java @@ -31,6 +31,8 @@ public final class DeidentifyImageRequest { private final DeidentifyImageRequestFile file; + private final Optional configurationId; + private final Optional outputProcessedImage; private final Optional outputOcrText; @@ -52,6 +54,7 @@ public final class DeidentifyImageRequest { private DeidentifyImageRequest( String vaultId, DeidentifyImageRequestFile file, + Optional configurationId, Optional outputProcessedImage, Optional outputOcrText, Optional maskingMethod, @@ -63,6 +66,7 @@ private DeidentifyImageRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.outputProcessedImage = outputProcessedImage; this.outputOcrText = outputOcrText; this.maskingMethod = maskingMethod; @@ -87,6 +91,11 @@ public DeidentifyImageRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + /** * @return If true, includes processed image in the output. */ @@ -150,6 +159,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyImageRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && outputProcessedImage.equals(other.outputProcessedImage) && outputOcrText.equals(other.outputOcrText) && maskingMethod.equals(other.maskingMethod) @@ -165,6 +175,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.outputProcessedImage, this.outputOcrText, this.maskingMethod, @@ -200,6 +211,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyImageRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + /** *

If true, includes processed image in the output.

*/ @@ -264,6 +279,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional outputProcessedImage = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -273,6 +290,7 @@ private Builder() {} public Builder from(DeidentifyImageRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); outputProcessedImage(other.getOutputProcessedImage()); outputOcrText(other.getOutputOcrText()); maskingMethod(other.getMaskingMethod()); @@ -427,11 +445,25 @@ public _FinalStage outputProcessedImage(Optional outputProcessedImage) return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyImageRequest build() { return new DeidentifyImageRequest( vaultId, file, + configurationId, outputProcessedImage, outputOcrText, maskingMethod, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPdfRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPdfRequest.java index 83fbb14f..82486662 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPdfRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPdfRequest.java @@ -30,6 +30,8 @@ public final class DeidentifyPdfRequest { private final DeidentifyPdfRequestFile file; + private final Optional configurationId; + private final Optional density; private final Optional maxResolution; @@ -49,6 +51,7 @@ public final class DeidentifyPdfRequest { private DeidentifyPdfRequest( String vaultId, DeidentifyPdfRequestFile file, + Optional configurationId, Optional density, Optional maxResolution, Optional> entityTypes, @@ -59,6 +62,7 @@ private DeidentifyPdfRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.density = density; this.maxResolution = maxResolution; this.entityTypes = entityTypes; @@ -82,6 +86,11 @@ public DeidentifyPdfRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + /** * @return Pixel density at which to process the PDF file. */ @@ -137,6 +146,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyPdfRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && density.equals(other.density) && maxResolution.equals(other.maxResolution) && entityTypes.equals(other.entityTypes) @@ -151,6 +161,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.density, this.maxResolution, this.entityTypes, @@ -185,6 +196,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyPdfRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + /** *

Pixel density at which to process the PDF file.

*/ @@ -240,6 +255,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional density = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -249,6 +266,7 @@ private Builder() {} public Builder from(DeidentifyPdfRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); density(other.getDensity()); maxResolution(other.getMaxResolution()); entityTypes(other.getEntityTypes()); @@ -382,11 +400,25 @@ public _FinalStage density(Optional density) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyPdfRequest build() { return new DeidentifyPdfRequest( vaultId, file, + configurationId, density, maxResolution, entityTypes, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPresentationRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPresentationRequest.java index 47a63a5b..95ced625 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPresentationRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPresentationRequest.java @@ -30,6 +30,8 @@ public final class DeidentifyPresentationRequest { private final DeidentifyPresentationRequestFile file; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -45,6 +47,7 @@ public final class DeidentifyPresentationRequest { private DeidentifyPresentationRequest( String vaultId, DeidentifyPresentationRequestFile file, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -53,6 +56,7 @@ private DeidentifyPresentationRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -74,6 +78,11 @@ public DeidentifyPresentationRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -113,6 +122,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyPresentationRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -125,6 +135,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -157,6 +168,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyPresentationRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -194,6 +209,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -203,6 +220,7 @@ private Builder() {} public Builder from(DeidentifyPresentationRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -294,11 +312,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyPresentationRequest build() { return new DeidentifyPresentationRequest( vaultId, file, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifySpreadsheetRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifySpreadsheetRequest.java index b72b412b..283457f8 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifySpreadsheetRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifySpreadsheetRequest.java @@ -30,6 +30,8 @@ public final class DeidentifySpreadsheetRequest { private final DeidentifySpreadsheetRequestFile file; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -45,6 +47,7 @@ public final class DeidentifySpreadsheetRequest { private DeidentifySpreadsheetRequest( String vaultId, DeidentifySpreadsheetRequestFile file, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -53,6 +56,7 @@ private DeidentifySpreadsheetRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -74,6 +78,11 @@ public DeidentifySpreadsheetRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -113,6 +122,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifySpreadsheetRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -125,6 +135,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -157,6 +168,10 @@ public interface FileStage { public interface _FinalStage { DeidentifySpreadsheetRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -194,6 +209,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -203,6 +220,7 @@ private Builder() {} public Builder from(DeidentifySpreadsheetRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -294,11 +312,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifySpreadsheetRequest build() { return new DeidentifySpreadsheetRequest( vaultId, file, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyStructuredTextRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyStructuredTextRequest.java index a61a5ba0..8ff7e195 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyStructuredTextRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyStructuredTextRequest.java @@ -30,6 +30,8 @@ public final class DeidentifyStructuredTextRequest { private final DeidentifyStructuredTextRequestFile file; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -45,6 +47,7 @@ public final class DeidentifyStructuredTextRequest { private DeidentifyStructuredTextRequest( String vaultId, DeidentifyStructuredTextRequestFile file, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -53,6 +56,7 @@ private DeidentifyStructuredTextRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -74,6 +78,11 @@ public DeidentifyStructuredTextRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -113,6 +122,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyStructuredTextRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -125,6 +135,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -157,6 +168,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyStructuredTextRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -194,6 +209,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -203,6 +220,7 @@ private Builder() {} public Builder from(DeidentifyStructuredTextRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -294,11 +312,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyStructuredTextRequest build() { return new DeidentifyStructuredTextRequest( vaultId, file, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyTextRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyTextRequest.java index 4eb0ac6c..e65d89e8 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyTextRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyTextRequest.java @@ -30,6 +30,8 @@ public final class DeidentifyTextRequest { private final DeidentifyTextRequestFile file; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -45,6 +47,7 @@ public final class DeidentifyTextRequest { private DeidentifyTextRequest( String vaultId, DeidentifyTextRequestFile file, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -53,6 +56,7 @@ private DeidentifyTextRequest( Map additionalProperties) { this.vaultId = vaultId; this.file = file; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -74,6 +78,11 @@ public DeidentifyTextRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -113,6 +122,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyTextRequest other) { return vaultId.equals(other.vaultId) && file.equals(other.file) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -125,6 +135,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -157,6 +168,10 @@ public interface FileStage { public interface _FinalStage { DeidentifyTextRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -194,6 +209,8 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -203,6 +220,7 @@ private Builder() {} public Builder from(DeidentifyTextRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -294,11 +312,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyTextRequest build() { return new DeidentifyTextRequest( vaultId, file, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequest.java new file mode 100644 index 00000000..4afb0146 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequest.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.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.skyflow.generated.rest.core.ObjectMappers; +import com.skyflow.generated.rest.resources.files.types.ReidentifyFileRequestFile; +import com.skyflow.generated.rest.resources.files.types.ReidentifyFileRequestFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReidentifyFileRequest.Builder.class) +public final class ReidentifyFileRequest { + private final String vaultId; + + private final ReidentifyFileRequestFile file; + + private final Optional format; + + private final Map additionalProperties; + + private ReidentifyFileRequest( + String vaultId, + ReidentifyFileRequestFile file, + Optional format, + Map additionalProperties) { + this.vaultId = vaultId; + this.file = file; + this.format = format; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return File to re-identify. Files are specified as Base64-encoded data or an EFS path. + */ + @JsonProperty("file") + public ReidentifyFileRequestFile getFile() { + return file; + } + + /** + * @return Mapping of preferred data formatting options to entity types. Returned values are dependent on the configuration of the vault storing the data and the permissions of the user or account making the request. + */ + @JsonProperty("format") + public Optional getFormat() { + return format; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReidentifyFileRequest && equalTo((ReidentifyFileRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReidentifyFileRequest other) { + return vaultId.equals(other.vaultId) && file.equals(other.file) && format.equals(other.format); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.vaultId, this.file, this.format); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VaultIdStage builder() { + return new Builder(); + } + + public interface VaultIdStage { + FileStage vaultId(@NotNull String vaultId); + + Builder from(ReidentifyFileRequest other); + } + + public interface FileStage { + /** + * File to re-identify. Files are specified as Base64-encoded data or an EFS path. + */ + _FinalStage file(@NotNull ReidentifyFileRequestFile file); + } + + public interface _FinalStage { + ReidentifyFileRequest build(); + + /** + *

Mapping of preferred data formatting options to entity types. Returned values are dependent on the configuration of the vault storing the data and the permissions of the user or account making the request.

+ */ + _FinalStage format(Optional format); + + _FinalStage format(ReidentifyFileRequestFormat format); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VaultIdStage, FileStage, _FinalStage { + private String vaultId; + + private ReidentifyFileRequestFile file; + + private Optional format = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReidentifyFileRequest other) { + vaultId(other.getVaultId()); + file(other.getFile()); + format(other.getFormat()); + return this; + } + + @java.lang.Override + @JsonSetter("vault_id") + public FileStage vaultId(@NotNull String vaultId) { + this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); + return this; + } + + /** + * File to re-identify. Files are specified as Base64-encoded data or an EFS path.

File to re-identify. Files are specified as Base64-encoded data or an EFS path.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("file") + public _FinalStage file(@NotNull ReidentifyFileRequestFile file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + *

Mapping of preferred data formatting options to entity types. Returned values are dependent on the configuration of the vault storing the data and the permissions of the user or account making the request.

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

Mapping of preferred data formatting options to entity types. Returned values are dependent on the configuration of the vault storing the data and the permissions of the user or account making the request.

+ */ + @java.lang.Override + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public _FinalStage format(Optional format) { + this.format = format; + return this; + } + + @java.lang.Override + public ReidentifyFileRequest build() { + return new ReidentifyFileRequest(vaultId, file, format, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFileDataFormat.java index afc90bc3..b0ab22b9 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFileDataFormat.java @@ -10,6 +10,8 @@ public enum DeidentifyFileRequestFileDataFormat { CSV("csv"), + DCM("dcm"), + DOC("doc"), DOCX("docx"), diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFile.java new file mode 100644 index 00000000..bea9b303 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFile.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.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.skyflow.generated.rest.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReidentifyFileRequestFile.Builder.class) +public final class ReidentifyFileRequestFile { + private final String base64; + + private final ReidentifyFileRequestFileDataFormat dataFormat; + + private final Map additionalProperties; + + private ReidentifyFileRequestFile( + String base64, ReidentifyFileRequestFileDataFormat dataFormat, Map additionalProperties) { + this.base64 = base64; + this.dataFormat = dataFormat; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded data of the file to re-identify. + */ + @JsonProperty("base64") + public String getBase64() { + return base64; + } + + /** + * @return Data format of the file. + */ + @JsonProperty("data_format") + public ReidentifyFileRequestFileDataFormat getDataFormat() { + return dataFormat; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReidentifyFileRequestFile && equalTo((ReidentifyFileRequestFile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReidentifyFileRequestFile other) { + return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.base64, this.dataFormat); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Base64Stage builder() { + return new Builder(); + } + + public interface Base64Stage { + /** + * Base64-encoded data of the file to re-identify. + */ + DataFormatStage base64(@NotNull String base64); + + Builder from(ReidentifyFileRequestFile other); + } + + public interface DataFormatStage { + /** + * Data format of the file. + */ + _FinalStage dataFormat(@NotNull ReidentifyFileRequestFileDataFormat dataFormat); + } + + public interface _FinalStage { + ReidentifyFileRequestFile build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { + private String base64; + + private ReidentifyFileRequestFileDataFormat dataFormat; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReidentifyFileRequestFile other) { + base64(other.getBase64()); + dataFormat(other.getDataFormat()); + return this; + } + + /** + * Base64-encoded data of the file to re-identify.

Base64-encoded data of the file to re-identify.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("base64") + public DataFormatStage base64(@NotNull String base64) { + this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); + return this; + } + + /** + * Data format of the file.

Data format of the file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data_format") + public _FinalStage dataFormat(@NotNull ReidentifyFileRequestFileDataFormat dataFormat) { + this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); + return this; + } + + @java.lang.Override + public ReidentifyFileRequestFile build() { + return new ReidentifyFileRequestFile(base64, dataFormat, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1FileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFileDataFormat.java similarity index 54% rename from src/main/java/com/skyflow/generated/rest/types/V1FileDataFormat.java rename to src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFileDataFormat.java index a384af7f..3e1555f3 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1FileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFileDataFormat.java @@ -1,52 +1,30 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.types; +package com.skyflow.generated.rest.resources.files.types; import com.fasterxml.jackson.annotation.JsonValue; -public enum V1FileDataFormat { - BMP("bmp"), - +public enum ReidentifyFileRequestFileDataFormat { CSV("csv"), DOC("doc"), DOCX("docx"), - JPEG("jpeg"), - - JPG("jpg"), - JSON("json"), - MP_3("mp3"), - - PDF("pdf"), - - PNG("png"), - - PPT("ppt"), - - PPTX("pptx"), - - TIF("tif"), - - TIFF("tiff"), - TXT("txt"), - UNKNOWN("unknown"), - - WAV("wav"), - XLS("xls"), - XLSX("xlsx"); + XLSX("xlsx"), + + XML("xml"); private final String value; - V1FileDataFormat(String value) { + ReidentifyFileRequestFileDataFormat(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFormat.java new file mode 100644 index 00000000..232fcd55 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFormat.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.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.skyflow.generated.rest.core.ObjectMappers; +import com.skyflow.generated.rest.types.EntityType; +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 = ReidentifyFileRequestFormat.Builder.class) +public final class ReidentifyFileRequestFormat { + private final Optional> redacted; + + private final Optional> masked; + + private final Optional> plaintext; + + private final Map additionalProperties; + + private ReidentifyFileRequestFormat( + Optional> redacted, + Optional> masked, + Optional> plaintext, + Map additionalProperties) { + this.redacted = redacted; + this.masked = masked; + this.plaintext = plaintext; + this.additionalProperties = additionalProperties; + } + + /** + * @return Entity types to fully redact. + */ + @JsonProperty("redacted") + public Optional> getRedacted() { + return redacted; + } + + /** + * @return Entity types to mask. + */ + @JsonProperty("masked") + public Optional> getMasked() { + return masked; + } + + /** + * @return Entity types to return in plaintext. + */ + @JsonProperty("plaintext") + public Optional> getPlaintext() { + return plaintext; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReidentifyFileRequestFormat && equalTo((ReidentifyFileRequestFormat) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReidentifyFileRequestFormat other) { + return redacted.equals(other.redacted) && masked.equals(other.masked) && plaintext.equals(other.plaintext); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.redacted, this.masked, this.plaintext); + } + + @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> redacted = Optional.empty(); + + private Optional> masked = Optional.empty(); + + private Optional> plaintext = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ReidentifyFileRequestFormat other) { + redacted(other.getRedacted()); + masked(other.getMasked()); + plaintext(other.getPlaintext()); + return this; + } + + /** + *

Entity types to fully redact.

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

Entity types to mask.

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

Entity types to return in plaintext.

+ */ + @JsonSetter(value = "plaintext", nulls = Nulls.SKIP) + public Builder plaintext(Optional> plaintext) { + this.plaintext = plaintext; + return this; + } + + public Builder plaintext(List plaintext) { + this.plaintext = Optional.ofNullable(plaintext); + return this; + } + + public ReidentifyFileRequestFormat build() { + return new ReidentifyFileRequestFormat(redacted, masked, plaintext, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncGuardrailsClient.java b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncGuardrailsClient.java new file mode 100644 index 00000000..1caa38aa --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncGuardrailsClient.java @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.guardrails; + +import com.skyflow.generated.rest.core.ClientOptions; +import com.skyflow.generated.rest.core.RequestOptions; +import com.skyflow.generated.rest.resources.guardrails.requests.CheckGuardrailsRequest; +import com.skyflow.generated.rest.types.CheckGuardrailsResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncGuardrailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGuardrailsClient rawClient; + + public AsyncGuardrailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGuardrailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGuardrailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Preserve safety and compliance with usage policies. + */ + public CompletableFuture checkGuardrails(CheckGuardrailsRequest request) { + return this.rawClient.checkGuardrails(request).thenApply(response -> response.body()); + } + + /** + * Preserve safety and compliance with usage policies. + */ + public CompletableFuture checkGuardrails( + CheckGuardrailsRequest request, RequestOptions requestOptions) { + return this.rawClient.checkGuardrails(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncRawGuardrailsClient.java b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncRawGuardrailsClient.java new file mode 100644 index 00000000..fcea229b --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncRawGuardrailsClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.guardrails; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.skyflow.generated.rest.core.ApiClientApiException; +import com.skyflow.generated.rest.core.ApiClientException; +import com.skyflow.generated.rest.core.ApiClientHttpResponse; +import com.skyflow.generated.rest.core.ClientOptions; +import com.skyflow.generated.rest.core.MediaTypes; +import com.skyflow.generated.rest.core.ObjectMappers; +import com.skyflow.generated.rest.core.RequestOptions; +import com.skyflow.generated.rest.errors.BadRequestError; +import com.skyflow.generated.rest.errors.InternalServerError; +import com.skyflow.generated.rest.errors.UnauthorizedError; +import com.skyflow.generated.rest.resources.guardrails.requests.CheckGuardrailsRequest; +import com.skyflow.generated.rest.types.CheckGuardrailsResponse; +import com.skyflow.generated.rest.types.ErrorResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGuardrailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawGuardrailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Preserve safety and compliance with usage policies. + */ + public CompletableFuture> checkGuardrails( + CheckGuardrailsRequest request) { + return checkGuardrails(request, null); + } + + /** + * Preserve safety and compliance with usage policies. + */ + public CompletableFuture> checkGuardrails( + CheckGuardrailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/detect/guardrails") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ApiClientException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ApiClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), CheckGuardrailsResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + future.completeExceptionally(new ApiClientApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ApiClientException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/guardrails/GuardrailsClient.java b/src/main/java/com/skyflow/generated/rest/resources/guardrails/GuardrailsClient.java new file mode 100644 index 00000000..fe4ab899 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/GuardrailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.guardrails; + +import com.skyflow.generated.rest.core.ClientOptions; +import com.skyflow.generated.rest.core.RequestOptions; +import com.skyflow.generated.rest.resources.guardrails.requests.CheckGuardrailsRequest; +import com.skyflow.generated.rest.types.CheckGuardrailsResponse; + +public class GuardrailsClient { + protected final ClientOptions clientOptions; + + private final RawGuardrailsClient rawClient; + + public GuardrailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGuardrailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGuardrailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Preserve safety and compliance with usage policies. + */ + public CheckGuardrailsResponse checkGuardrails(CheckGuardrailsRequest request) { + return this.rawClient.checkGuardrails(request).body(); + } + + /** + * Preserve safety and compliance with usage policies. + */ + public CheckGuardrailsResponse checkGuardrails(CheckGuardrailsRequest request, RequestOptions requestOptions) { + return this.rawClient.checkGuardrails(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/guardrails/RawGuardrailsClient.java b/src/main/java/com/skyflow/generated/rest/resources/guardrails/RawGuardrailsClient.java new file mode 100644 index 00000000..2667b55a --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/RawGuardrailsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.guardrails; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.skyflow.generated.rest.core.ApiClientApiException; +import com.skyflow.generated.rest.core.ApiClientException; +import com.skyflow.generated.rest.core.ApiClientHttpResponse; +import com.skyflow.generated.rest.core.ClientOptions; +import com.skyflow.generated.rest.core.MediaTypes; +import com.skyflow.generated.rest.core.ObjectMappers; +import com.skyflow.generated.rest.core.RequestOptions; +import com.skyflow.generated.rest.errors.BadRequestError; +import com.skyflow.generated.rest.errors.InternalServerError; +import com.skyflow.generated.rest.errors.UnauthorizedError; +import com.skyflow.generated.rest.resources.guardrails.requests.CheckGuardrailsRequest; +import com.skyflow.generated.rest.types.CheckGuardrailsResponse; +import com.skyflow.generated.rest.types.ErrorResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGuardrailsClient { + protected final ClientOptions clientOptions; + + public RawGuardrailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Preserve safety and compliance with usage policies. + */ + public ApiClientHttpResponse checkGuardrails(CheckGuardrailsRequest request) { + return checkGuardrails(request, null); + } + + /** + * Preserve safety and compliance with usage policies. + */ + public ApiClientHttpResponse checkGuardrails( + CheckGuardrailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/detect/guardrails") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ApiClientException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ApiClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CheckGuardrailsResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new ApiClientApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new ApiClientException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/CheckGuardrailsRequest.java b/src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/CheckGuardrailsRequest.java new file mode 100644 index 00000000..8fbf90f7 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/CheckGuardrailsRequest.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.guardrails.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.skyflow.generated.rest.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckGuardrailsRequest.Builder.class) +public final class CheckGuardrailsRequest { + private final String vaultId; + + private final String text; + + private final Optional checkToxicity; + + private final Optional> denyTopics; + + private final Map additionalProperties; + + private CheckGuardrailsRequest( + String vaultId, + String text, + Optional checkToxicity, + Optional> denyTopics, + Map additionalProperties) { + this.vaultId = vaultId; + this.text = text; + this.checkToxicity = checkToxicity; + this.denyTopics = denyTopics; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return Text to check against guardrails. + */ + @JsonProperty("text") + public String getText() { + return text; + } + + /** + * @return Check for toxicity in the text. + */ + @JsonProperty("check_toxicity") + public Optional getCheckToxicity() { + return checkToxicity; + } + + /** + * @return List of topics to deny. + */ + @JsonProperty("deny_topics") + public Optional> getDenyTopics() { + return denyTopics; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckGuardrailsRequest && equalTo((CheckGuardrailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckGuardrailsRequest other) { + return vaultId.equals(other.vaultId) + && text.equals(other.text) + && checkToxicity.equals(other.checkToxicity) + && denyTopics.equals(other.denyTopics); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.vaultId, this.text, this.checkToxicity, this.denyTopics); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VaultIdStage builder() { + return new Builder(); + } + + public interface VaultIdStage { + TextStage vaultId(@NotNull String vaultId); + + Builder from(CheckGuardrailsRequest other); + } + + public interface TextStage { + /** + * Text to check against guardrails. + */ + _FinalStage text(@NotNull String text); + } + + public interface _FinalStage { + CheckGuardrailsRequest build(); + + /** + *

Check for toxicity in the text.

+ */ + _FinalStage checkToxicity(Optional checkToxicity); + + _FinalStage checkToxicity(Boolean checkToxicity); + + /** + *

List of topics to deny.

+ */ + _FinalStage denyTopics(Optional> denyTopics); + + _FinalStage denyTopics(List denyTopics); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements VaultIdStage, TextStage, _FinalStage { + private String vaultId; + + private String text; + + private Optional> denyTopics = Optional.empty(); + + private Optional checkToxicity = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckGuardrailsRequest other) { + vaultId(other.getVaultId()); + text(other.getText()); + checkToxicity(other.getCheckToxicity()); + denyTopics(other.getDenyTopics()); + return this; + } + + @java.lang.Override + @JsonSetter("vault_id") + public TextStage vaultId(@NotNull String vaultId) { + this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); + return this; + } + + /** + * Text to check against guardrails.

Text to check against guardrails.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("text") + public _FinalStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + /** + *

List of topics to deny.

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

List of topics to deny.

+ */ + @java.lang.Override + @JsonSetter(value = "deny_topics", nulls = Nulls.SKIP) + public _FinalStage denyTopics(Optional> denyTopics) { + this.denyTopics = denyTopics; + return this; + } + + /** + *

Check for toxicity in the text.

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

Check for toxicity in the text.

+ */ + @java.lang.Override + @JsonSetter(value = "check_toxicity", nulls = Nulls.SKIP) + public _FinalStage checkToxicity(Optional checkToxicity) { + this.checkToxicity = checkToxicity; + return this; + } + + @java.lang.Override + public CheckGuardrailsRequest build() { + return new CheckGuardrailsRequest(vaultId, text, checkToxicity, denyTopics, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRawRecordsClient.java b/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRawRecordsClient.java index 757ee8e4..b8487e65 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRawRecordsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRawRecordsClient.java @@ -703,12 +703,12 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Uploads a file to the specified record. */ public CompletableFuture> fileServiceUploadFile( - String vaultId, String objectName, String id, Optional fileColumnName) { + String vaultId, String objectName, String id, Optional file) { return fileServiceUploadFile( vaultId, objectName, id, - fileColumnName, + file, FileServiceUploadFileRequest.builder().build()); } @@ -716,12 +716,8 @@ public CompletableFuture> fileServ * Uploads a file to the specified record. */ public CompletableFuture> fileServiceUploadFile( - String vaultId, - String objectName, - String id, - Optional fileColumnName, - FileServiceUploadFileRequest request) { - return fileServiceUploadFile(vaultId, objectName, id, fileColumnName, request, null); + String vaultId, String objectName, String id, Optional file, FileServiceUploadFileRequest request) { + return fileServiceUploadFile(vaultId, objectName, id, file, request, null); } /** @@ -731,7 +727,7 @@ public CompletableFuture> fileServ String vaultId, String objectName, String id, - Optional fileColumnName, + Optional file, FileServiceUploadFileRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -744,15 +740,17 @@ public CompletableFuture> fileServ .build(); MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM); try { - if (fileColumnName.isPresent()) { - String fileColumnNameMimeType = - Files.probeContentType(fileColumnName.get().toPath()); - MediaType fileColumnNameMimeTypeMediaType = - fileColumnNameMimeType != null ? MediaType.parse(fileColumnNameMimeType) : null; + if (file.isPresent()) { + String fileMimeType = Files.probeContentType(file.get().toPath()); + MediaType fileMimeTypeMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; + body.addFormDataPart( + "file", file.get().getName(), RequestBody.create(file.get(), fileMimeTypeMediaType)); + } + if (request.getColumnName().isPresent()) { body.addFormDataPart( - "fileColumnName", - fileColumnName.get().getName(), - RequestBody.create(fileColumnName.get(), fileColumnNameMimeTypeMediaType)); + "columnName", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getColumnName().get())); } } catch (Exception e) { throw new RuntimeException(e); diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRecordsClient.java b/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRecordsClient.java index baf98c1d..d82aef9e 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRecordsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRecordsClient.java @@ -240,9 +240,9 @@ public CompletableFuture recordServiceDeleteRecord( * Uploads a file to the specified record. */ public CompletableFuture fileServiceUploadFile( - String vaultId, String objectName, String id, Optional fileColumnName) { + String vaultId, String objectName, String id, Optional file) { return this.rawClient - .fileServiceUploadFile(vaultId, objectName, id, fileColumnName) + .fileServiceUploadFile(vaultId, objectName, id, file) .thenApply(response -> response.body()); } @@ -250,13 +250,9 @@ public CompletableFuture fileServiceUploadFile( * Uploads a file to the specified record. */ public CompletableFuture fileServiceUploadFile( - String vaultId, - String objectName, - String id, - Optional fileColumnName, - FileServiceUploadFileRequest request) { + String vaultId, String objectName, String id, Optional file, FileServiceUploadFileRequest request) { return this.rawClient - .fileServiceUploadFile(vaultId, objectName, id, fileColumnName, request) + .fileServiceUploadFile(vaultId, objectName, id, file, request) .thenApply(response -> response.body()); } @@ -267,11 +263,11 @@ public CompletableFuture fileServiceUploadFile( String vaultId, String objectName, String id, - Optional fileColumnName, + Optional file, FileServiceUploadFileRequest request, RequestOptions requestOptions) { return this.rawClient - .fileServiceUploadFile(vaultId, objectName, id, fileColumnName, request, requestOptions) + .fileServiceUploadFile(vaultId, objectName, id, file, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/RawRecordsClient.java b/src/main/java/com/skyflow/generated/rest/resources/records/RawRecordsClient.java index 593f5e3d..2a839096 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/RawRecordsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/RawRecordsClient.java @@ -591,12 +591,12 @@ public ApiClientHttpResponse recordServiceDeleteRecord( * Uploads a file to the specified record. */ public ApiClientHttpResponse fileServiceUploadFile( - String vaultId, String objectName, String id, Optional fileColumnName) { + String vaultId, String objectName, String id, Optional file) { return fileServiceUploadFile( vaultId, objectName, id, - fileColumnName, + file, FileServiceUploadFileRequest.builder().build()); } @@ -604,12 +604,8 @@ public ApiClientHttpResponse fileServiceUploadFile( * Uploads a file to the specified record. */ public ApiClientHttpResponse fileServiceUploadFile( - String vaultId, - String objectName, - String id, - Optional fileColumnName, - FileServiceUploadFileRequest request) { - return fileServiceUploadFile(vaultId, objectName, id, fileColumnName, request, null); + String vaultId, String objectName, String id, Optional file, FileServiceUploadFileRequest request) { + return fileServiceUploadFile(vaultId, objectName, id, file, request, null); } /** @@ -619,7 +615,7 @@ public ApiClientHttpResponse fileServiceUploadFile( String vaultId, String objectName, String id, - Optional fileColumnName, + Optional file, FileServiceUploadFileRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -632,15 +628,17 @@ public ApiClientHttpResponse fileServiceUploadFile( .build(); MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM); try { - if (fileColumnName.isPresent()) { - String fileColumnNameMimeType = - Files.probeContentType(fileColumnName.get().toPath()); - MediaType fileColumnNameMimeTypeMediaType = - fileColumnNameMimeType != null ? MediaType.parse(fileColumnNameMimeType) : null; + if (file.isPresent()) { + String fileMimeType = Files.probeContentType(file.get().toPath()); + MediaType fileMimeTypeMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; + body.addFormDataPart( + "file", file.get().getName(), RequestBody.create(file.get(), fileMimeTypeMediaType)); + } + if (request.getColumnName().isPresent()) { body.addFormDataPart( - "fileColumnName", - fileColumnName.get().getName(), - RequestBody.create(fileColumnName.get(), fileColumnNameMimeTypeMediaType)); + "columnName", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getColumnName().get())); } } catch (Exception e) { throw new RuntimeException(e); diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/RecordsClient.java b/src/main/java/com/skyflow/generated/rest/resources/records/RecordsClient.java index fee9d49b..a9a6930d 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/RecordsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/RecordsClient.java @@ -236,9 +236,9 @@ public V1DeleteRecordResponse recordServiceDeleteRecord( * Uploads a file to the specified record. */ public V1UpdateRecordResponse fileServiceUploadFile( - String vaultId, String objectName, String id, Optional fileColumnName) { + String vaultId, String objectName, String id, Optional file) { return this.rawClient - .fileServiceUploadFile(vaultId, objectName, id, fileColumnName) + .fileServiceUploadFile(vaultId, objectName, id, file) .body(); } @@ -246,13 +246,9 @@ public V1UpdateRecordResponse fileServiceUploadFile( * Uploads a file to the specified record. */ public V1UpdateRecordResponse fileServiceUploadFile( - String vaultId, - String objectName, - String id, - Optional fileColumnName, - FileServiceUploadFileRequest request) { + String vaultId, String objectName, String id, Optional file, FileServiceUploadFileRequest request) { return this.rawClient - .fileServiceUploadFile(vaultId, objectName, id, fileColumnName, request) + .fileServiceUploadFile(vaultId, objectName, id, file, request) .body(); } @@ -263,11 +259,11 @@ public V1UpdateRecordResponse fileServiceUploadFile( String vaultId, String objectName, String id, - Optional fileColumnName, + Optional file, FileServiceUploadFileRequest request, RequestOptions requestOptions) { return this.rawClient - .fileServiceUploadFile(vaultId, objectName, id, fileColumnName, request, requestOptions) + .fileServiceUploadFile(vaultId, objectName, id, file, request, requestOptions) .body(); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/requests/FileServiceUploadFileRequest.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/FileServiceUploadFileRequest.java index d1b64906..8152e4d7 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/FileServiceUploadFileRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/FileServiceUploadFileRequest.java @@ -7,24 +7,40 @@ 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.skyflow.generated.rest.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 = FileServiceUploadFileRequest.Builder.class) public final class FileServiceUploadFileRequest { + private final Optional columnName; + private final Map additionalProperties; - private FileServiceUploadFileRequest(Map additionalProperties) { + private FileServiceUploadFileRequest(Optional columnName, Map additionalProperties) { + this.columnName = columnName; this.additionalProperties = additionalProperties; } + /** + * @return Name of the column to store the file in. The column must have a file data type. + */ + @JsonProperty("columnName") + public Optional getColumnName() { + return columnName; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof FileServiceUploadFileRequest; + return other instanceof FileServiceUploadFileRequest && equalTo((FileServiceUploadFileRequest) other); } @JsonAnyGetter @@ -32,6 +48,15 @@ public Map getAdditionalProperties() { return this.additionalProperties; } + private boolean equalTo(FileServiceUploadFileRequest other) { + return columnName.equals(other.columnName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.columnName); + } + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); @@ -43,17 +68,34 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional columnName = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(FileServiceUploadFileRequest other) { + columnName(other.getColumnName()); + return this; + } + + /** + *

Name of the column to store the file in. The column must have a file data type.

+ */ + @JsonSetter(value = "columnName", nulls = Nulls.SKIP) + public Builder columnName(Optional columnName) { + this.columnName = columnName; + return this; + } + + public Builder columnName(String columnName) { + this.columnName = Optional.ofNullable(columnName); return this; } public FileServiceUploadFileRequest build() { - return new FileServiceUploadFileRequest(additionalProperties); + return new FileServiceUploadFileRequest(columnName, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/requests/DeidentifyStringRequest.java b/src/main/java/com/skyflow/generated/rest/resources/strings/requests/DeidentifyStringRequest.java index 4a74fcba..18b6cd98 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/requests/DeidentifyStringRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/requests/DeidentifyStringRequest.java @@ -29,6 +29,8 @@ public final class DeidentifyStringRequest { private final String text; + private final Optional configurationId; + private final Optional> entityTypes; private final Optional tokenType; @@ -44,6 +46,7 @@ public final class DeidentifyStringRequest { private DeidentifyStringRequest( String vaultId, String text, + Optional configurationId, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -52,6 +55,7 @@ private DeidentifyStringRequest( Map additionalProperties) { this.vaultId = vaultId; this.text = text; + this.configurationId = configurationId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; @@ -73,6 +77,11 @@ public String getText() { return text; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @JsonProperty("entity_types") public Optional> getEntityTypes() { return entityTypes; @@ -112,6 +121,7 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyStringRequest other) { return vaultId.equals(other.vaultId) && text.equals(other.text) + && configurationId.equals(other.configurationId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) @@ -124,6 +134,7 @@ public int hashCode() { return Objects.hash( this.vaultId, this.text, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -156,6 +167,10 @@ public interface TextStage { public interface _FinalStage { DeidentifyStringRequest build(); + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + _FinalStage entityTypes(Optional> entityTypes); _FinalStage entityTypes(List entityTypes); @@ -193,6 +208,8 @@ public static final class Builder implements VaultIdStage, TextStage, _FinalStag private Optional> entityTypes = Optional.empty(); + private Optional configurationId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -202,6 +219,7 @@ private Builder() {} public Builder from(DeidentifyStringRequest other) { vaultId(other.getVaultId()); text(other.getText()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -293,11 +311,25 @@ public _FinalStage entityTypes(Optional> entityTypes) { return this; } + @java.lang.Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + @java.lang.Override public DeidentifyStringRequest build() { return new DeidentifyStringRequest( vaultId, text, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsColumnMapping.java b/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsColumnMapping.java deleted file mode 100644 index 0f5d1fc2..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsColumnMapping.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedOptionsColumnMapping.Builder.class) -public final class AdvancedOptionsColumnMapping { - private final String sessionId; - - private final String default_; - - private final Optional> entityColumnMap; - - private final Map additionalProperties; - - private AdvancedOptionsColumnMapping( - String sessionId, - String default_, - Optional> entityColumnMap, - Map additionalProperties) { - this.sessionId = sessionId; - this.default_ = default_; - this.entityColumnMap = entityColumnMap; - this.additionalProperties = additionalProperties; - } - - /** - * @return Table name of the vault. - */ - @JsonProperty("session_id") - public String getSessionId() { - return sessionId; - } - - /** - * @return Name of column to store data in when no explicit mapping exists. - */ - @JsonProperty("default") - public String getDefault() { - return default_; - } - - /** - * @return Column mapping for different entities. - */ - @JsonProperty("entity_column_map") - public Optional> getEntityColumnMap() { - return entityColumnMap; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedOptionsColumnMapping && equalTo((AdvancedOptionsColumnMapping) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedOptionsColumnMapping other) { - return sessionId.equals(other.sessionId) - && default_.equals(other.default_) - && entityColumnMap.equals(other.entityColumnMap); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.sessionId, this.default_, this.entityColumnMap); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static SessionIdStage builder() { - return new Builder(); - } - - public interface SessionIdStage { - /** - * Table name of the vault. - */ - DefaultStage sessionId(@NotNull String sessionId); - - Builder from(AdvancedOptionsColumnMapping other); - } - - public interface DefaultStage { - /** - * Name of column to store data in when no explicit mapping exists. - */ - _FinalStage default_(@NotNull String default_); - } - - public interface _FinalStage { - AdvancedOptionsColumnMapping build(); - - /** - *

Column mapping for different entities.

- */ - _FinalStage entityColumnMap(Optional> entityColumnMap); - - _FinalStage entityColumnMap(List entityColumnMap); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements SessionIdStage, DefaultStage, _FinalStage { - private String sessionId; - - private String default_; - - private Optional> entityColumnMap = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedOptionsColumnMapping other) { - sessionId(other.getSessionId()); - default_(other.getDefault()); - entityColumnMap(other.getEntityColumnMap()); - return this; - } - - /** - * Table name of the vault.

Table name of the vault.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("session_id") - public DefaultStage sessionId(@NotNull String sessionId) { - this.sessionId = Objects.requireNonNull(sessionId, "sessionId must not be null"); - return this; - } - - /** - * Name of column to store data in when no explicit mapping exists.

Name of column to store data in when no explicit mapping exists.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("default") - public _FinalStage default_(@NotNull String default_) { - this.default_ = Objects.requireNonNull(default_, "default_ must not be null"); - return this; - } - - /** - *

Column mapping for different entities.

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

Column mapping for different entities.

- */ - @java.lang.Override - @JsonSetter(value = "entity_column_map", nulls = Nulls.SKIP) - public _FinalStage entityColumnMap(Optional> entityColumnMap) { - this.entityColumnMap = entityColumnMap; - return this; - } - - @java.lang.Override - public AdvancedOptionsColumnMapping build() { - return new AdvancedOptionsColumnMapping(sessionId, default_, entityColumnMap, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsEntityColumnMap.java b/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsEntityColumnMap.java deleted file mode 100644 index 3df03da3..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsEntityColumnMap.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = AdvancedOptionsEntityColumnMap.Builder.class) -public final class AdvancedOptionsEntityColumnMap { - private final Optional entityType; - - private final Optional columnName; - - private final Map additionalProperties; - - private AdvancedOptionsEntityColumnMap( - Optional entityType, - Optional columnName, - Map additionalProperties) { - this.entityType = entityType; - this.columnName = columnName; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("entity_type") - public Optional getEntityType() { - return entityType; - } - - /** - * @return Column name where the entity has to be stored. - */ - @JsonProperty("column_name") - public Optional getColumnName() { - return columnName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedOptionsEntityColumnMap && equalTo((AdvancedOptionsEntityColumnMap) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedOptionsEntityColumnMap other) { - return entityType.equals(other.entityType) && columnName.equals(other.columnName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.entityType, this.columnName); - } - - @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 entityType = Optional.empty(); - - private Optional columnName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AdvancedOptionsEntityColumnMap other) { - entityType(other.getEntityType()); - columnName(other.getColumnName()); - return this; - } - - @JsonSetter(value = "entity_type", nulls = Nulls.SKIP) - public Builder entityType(Optional entityType) { - this.entityType = entityType; - return this; - } - - public Builder entityType(DetectDataEntities entityType) { - this.entityType = Optional.ofNullable(entityType); - return this; - } - - /** - *

Column name where the entity has to be stored.

- */ - @JsonSetter(value = "column_name", nulls = Nulls.SKIP) - public Builder columnName(Optional columnName) { - this.columnName = columnName; - return this; - } - - public Builder columnName(String columnName) { - this.columnName = Optional.ofNullable(columnName); - return this; - } - - public AdvancedOptionsEntityColumnMap build() { - return new AdvancedOptionsEntityColumnMap(entityType, columnName, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsVaultSchema.java b/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsVaultSchema.java deleted file mode 100644 index dcacb09f..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/AdvancedOptionsVaultSchema.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedOptionsVaultSchema.Builder.class) -public final class AdvancedOptionsVaultSchema { - private final String tableName; - - private final AdvancedOptionsColumnMapping mapping; - - private final Map additionalProperties; - - private AdvancedOptionsVaultSchema( - String tableName, AdvancedOptionsColumnMapping mapping, Map additionalProperties) { - this.tableName = tableName; - this.mapping = mapping; - this.additionalProperties = additionalProperties; - } - - /** - * @return Table name of the vault. - */ - @JsonProperty("table_name") - public String getTableName() { - return tableName; - } - - @JsonProperty("mapping") - public AdvancedOptionsColumnMapping getMapping() { - return mapping; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedOptionsVaultSchema && equalTo((AdvancedOptionsVaultSchema) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedOptionsVaultSchema other) { - return tableName.equals(other.tableName) && mapping.equals(other.mapping); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.tableName, this.mapping); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TableNameStage builder() { - return new Builder(); - } - - public interface TableNameStage { - /** - * Table name of the vault. - */ - MappingStage tableName(@NotNull String tableName); - - Builder from(AdvancedOptionsVaultSchema other); - } - - public interface MappingStage { - _FinalStage mapping(@NotNull AdvancedOptionsColumnMapping mapping); - } - - public interface _FinalStage { - AdvancedOptionsVaultSchema build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TableNameStage, MappingStage, _FinalStage { - private String tableName; - - private AdvancedOptionsColumnMapping mapping; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedOptionsVaultSchema other) { - tableName(other.getTableName()); - mapping(other.getMapping()); - return this; - } - - /** - * Table name of the vault.

Table name of the vault.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("table_name") - public MappingStage tableName(@NotNull String tableName) { - this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("mapping") - public _FinalStage mapping(@NotNull AdvancedOptionsColumnMapping mapping) { - this.mapping = Objects.requireNonNull(mapping, "mapping must not be null"); - return this; - } - - @java.lang.Override - public AdvancedOptionsVaultSchema build() { - return new AdvancedOptionsVaultSchema(tableName, mapping, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/AudioConfigTranscriptionType.java b/src/main/java/com/skyflow/generated/rest/types/AudioConfigTranscriptionType.java deleted file mode 100644 index e9052d16..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/AudioConfigTranscriptionType.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AudioConfigTranscriptionType { - NONE("none"), - - SKYFLOW_TRANSCRIPTION("skyflow_transcription"), - - AWS_TRANSCRIPTION("aws_transcription"), - - AWS_TRANSCRIPTION_DIARIZE("aws_transcription_diarize"), - - AWS_MEDICAL_TRANSCRIPTION("aws_medical_transcription"), - - AWS_MEDICAL_TRANSCRIPTION_DIARIZE("aws_medical_transcription_diarize"), - - AWS_TRANSCRIPTION_DIARIZE_JSON("aws_transcription_diarize_json"), - - DEEPGRAM_TRANSCRIPTION_DIARIZE("deepgram_transcription_diarize"), - - DEEPGRAM_TRANSCRIPTION_JSON("deepgram_transcription_json"), - - DEEPGRAM_WRAPPER("deepgram_wrapper"); - - private final String value; - - AudioConfigTranscriptionType(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponse.java b/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponse.java new file mode 100644 index 00000000..324cd1e6 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponse.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = CheckGuardrailsResponse.Builder.class) +public final class CheckGuardrailsResponse { + private final Optional text; + + private final Optional toxicity; + + private final Optional deniedTopics; + + private final Optional validation; + + private final Map additionalProperties; + + private CheckGuardrailsResponse( + Optional text, + Optional toxicity, + Optional deniedTopics, + Optional validation, + Map additionalProperties) { + this.text = text; + this.toxicity = toxicity; + this.deniedTopics = deniedTopics; + this.validation = validation; + this.additionalProperties = additionalProperties; + } + + /** + * @return Text that was checked against guardrails. + */ + @JsonProperty("text") + public Optional getText() { + return text; + } + + /** + * @return Whether the text is toxic. + */ + @JsonProperty("toxicity") + public Optional getToxicity() { + return toxicity; + } + + /** + * @return Whether any denied topics were found. + */ + @JsonProperty("denied_topics") + public Optional getDeniedTopics() { + return deniedTopics; + } + + /** + * @return Validation result. + */ + @JsonProperty("validation") + public Optional getValidation() { + return validation; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckGuardrailsResponse && equalTo((CheckGuardrailsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckGuardrailsResponse other) { + return text.equals(other.text) + && toxicity.equals(other.toxicity) + && deniedTopics.equals(other.deniedTopics) + && validation.equals(other.validation); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text, this.toxicity, this.deniedTopics, this.validation); + } + + @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 text = Optional.empty(); + + private Optional toxicity = Optional.empty(); + + private Optional deniedTopics = Optional.empty(); + + private Optional validation = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CheckGuardrailsResponse other) { + text(other.getText()); + toxicity(other.getToxicity()); + deniedTopics(other.getDeniedTopics()); + validation(other.getValidation()); + return this; + } + + /** + *

Text that was checked against guardrails.

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

Whether the text is toxic.

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

Whether any denied topics were found.

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

Validation result.

+ */ + @JsonSetter(value = "validation", nulls = Nulls.SKIP) + public Builder validation(Optional validation) { + this.validation = validation; + return this; + } + + public Builder validation(CheckGuardrailsResponseValidation validation) { + this.validation = Optional.ofNullable(validation); + return this; + } + + public CheckGuardrailsResponse build() { + return new CheckGuardrailsResponse(text, toxicity, deniedTopics, validation, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectFileRequestDataType.java b/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java similarity index 70% rename from src/main/java/com/skyflow/generated/rest/types/DetectFileRequestDataType.java rename to src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java index e039bc86..2ff9edb8 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DetectFileRequestDataType.java +++ b/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java @@ -5,14 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DetectFileRequestDataType { - UNKNOWN("UNKNOWN"), +public enum CheckGuardrailsResponseValidation { + FAILED("failed"), - BASE_64("BASE64"); + PASSED("passed"); private final String value; - DetectFileRequestDataType(String value) { + CheckGuardrailsResponseValidation(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java index 9f73e9ad..233cdfdf 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java @@ -27,7 +27,7 @@ public final class DeidentifyStatusResponse { private final List output; - private final DeidentifyStatusResponseOutputType outputType; + private final Optional outputType; private final String message; @@ -48,7 +48,7 @@ public final class DeidentifyStatusResponse { private DeidentifyStatusResponse( DeidentifyStatusResponseStatus status, List output, - DeidentifyStatusResponseOutputType outputType, + Optional outputType, String message, Optional wordCount, Optional characterCount, @@ -90,7 +90,7 @@ public List getOutput() { * @return How the output file is specified. */ @JsonProperty("output_type") - public DeidentifyStatusResponseOutputType getOutputType() { + public Optional getOutputType() { return outputType; } @@ -202,18 +202,11 @@ public interface StatusStage { /** * Status of the detect run. */ - OutputTypeStage status(@NotNull DeidentifyStatusResponseStatus status); + MessageStage status(@NotNull DeidentifyStatusResponseStatus status); Builder from(DeidentifyStatusResponse other); } - public interface OutputTypeStage { - /** - * How the output file is specified. - */ - MessageStage outputType(@NotNull DeidentifyStatusResponseOutputType outputType); - } - public interface MessageStage { /** * Status details about the detect run. @@ -233,6 +226,13 @@ public interface _FinalStage { _FinalStage addAllOutput(List output); + /** + *

How the output file is specified.

+ */ + _FinalStage outputType(Optional outputType); + + _FinalStage outputType(DeidentifyStatusResponseOutputType outputType); + /** *

Number of words in the processed text.

*/ @@ -277,11 +277,9 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements StatusStage, OutputTypeStage, MessageStage, _FinalStage { + public static final class Builder implements StatusStage, MessageStage, _FinalStage { private DeidentifyStatusResponseStatus status; - private DeidentifyStatusResponseOutputType outputType; - private String message; private Optional slides = Optional.empty(); @@ -296,6 +294,8 @@ public static final class Builder implements StatusStage, OutputTypeStage, Messa private Optional wordCount = Optional.empty(); + private Optional outputType = Optional.empty(); + private List output = new ArrayList<>(); @JsonAnySetter @@ -324,22 +324,11 @@ public Builder from(DeidentifyStatusResponse other) { */ @java.lang.Override @JsonSetter("status") - public OutputTypeStage status(@NotNull DeidentifyStatusResponseStatus status) { + public MessageStage status(@NotNull DeidentifyStatusResponseStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - /** - * How the output file is specified.

How the output file is specified.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("output_type") - public MessageStage outputType(@NotNull DeidentifyStatusResponseOutputType outputType) { - this.outputType = Objects.requireNonNull(outputType, "outputType must not be null"); - return this; - } - /** * Status details about the detect run.

Status details about the detect run.

* @return Reference to {@code this} so that method calls can be chained together. @@ -471,6 +460,26 @@ public _FinalStage wordCount(Optional wordCount) { return this; } + /** + *

How the output file is specified.

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

How the output file is specified.

+ */ + @java.lang.Override + @JsonSetter(value = "output_type", nulls = Nulls.SKIP) + public _FinalStage outputType(Optional outputType) { + this.outputType = outputType; + return this; + } + /** *

How the input file was specified.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java index 547bf414..a03fcbf4 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java @@ -8,9 +8,7 @@ public enum DeidentifyStatusResponseOutputType { BASE_64("BASE64"), - EFS_PATH("EFS_PATH"), - - UNKNOWN("UNKNOWN"); + EFS_PATH("EFS_PATH"); private final String value; diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectDataAccuracy.java b/src/main/java/com/skyflow/generated/rest/types/DetectDataAccuracy.java deleted file mode 100644 index 64afed64..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/DetectDataAccuracy.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DetectDataAccuracy { - UNKNOWN("unknown"), - - STANDARD("standard"), - - STANDARD_PLUS("standard_plus"), - - STANDARD_PLUS_MULTILINGUAL("standard_plus_multilingual"), - - STANDARD_PLUS_AUTOMATIC("standard_plus_automatic"), - - HIGH("high"), - - HIGH_MULTILINGUAL("high_multilingual"), - - HIGH_AUTOMATIC("high_automatic"); - - private final String value; - - DetectDataAccuracy(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectDataEntities.java b/src/main/java/com/skyflow/generated/rest/types/DetectDataEntities.java deleted file mode 100644 index d655bb64..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/DetectDataEntities.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DetectDataEntities { - AGE("age"), - - BANK_ACCOUNT("bank_account"), - - CREDIT_CARD("credit_card"), - - CREDIT_CARD_EXPIRATION("credit_card_expiration"), - - CVV("cvv"), - - DATE("date"), - - DATE_INTERVAL("date_interval"), - - DOB("dob"), - - DRIVER_LICENSE("driver_license"), - - EMAIL_ADDRESS("email_address"), - - HEALTHCARE_NUMBER("healthcare_number"), - - IP_ADDRESS("ip_address"), - - LOCATION("location"), - - NAME("name"), - - NUMERICAL_PII("numerical_pii"), - - PHONE_NUMBER("phone_number"), - - SSN("ssn"), - - URL("url"), - - VEHICLE_ID("vehicle_id"), - - MEDICAL_CODE("medical_code"), - - NAME_FAMILY("name_family"), - - NAME_GIVEN("name_given"), - - ACCOUNT_NUMBER("account_number"), - - EVENT("event"), - - FILENAME("filename"), - - GENDER_SEXUALITY("gender_sexuality"), - - LANGUAGE("language"), - - LOCATION_ADDRESS("location_address"), - - LOCATION_CITY("location_city"), - - LOCATION_COORDINATE("location_coordinate"), - - LOCATION_COUNTRY("location_country"), - - LOCATION_STATE("location_state"), - - LOCATION_ZIP("location_zip"), - - MARITAL_STATUS("marital_status"), - - MONEY("money"), - - NAME_MEDICAL_PROFESSIONAL("name_medical_professional"), - - OCCUPATION("occupation"), - - ORGANIZATION("organization"), - - ORGANIZATION_MEDICAL_FACILITY("organization_medical_facility"), - - ORIGIN("origin"), - - PASSPORT_NUMBER("passport_number"), - - PASSWORD("password"), - - PHYSICAL_ATTRIBUTE("physical_attribute"), - - POLITICAL_AFFILIATION("political_affiliation"), - - RELIGION("religion"), - - TIME("time"), - - USERNAME("username"), - - ZODIAC_SIGN("zodiac_sign"), - - BLOOD_TYPE("blood_type"), - - CONDITION("condition"), - - DOSE("dose"), - - DRUG("drug"), - - INJURY("injury"), - - MEDICAL_PROCESS("medical_process"), - - STATISTICS("statistics"), - - ROUTING_NUMBER("routing_number"), - - CORPORATE_ACTION("corporate_action"), - - FINANCIAL_METRIC("financial_metric"), - - PRODUCT("product"), - - TREND("trend"), - - DURATION("duration"), - - LOCATION_ADDRESS_STREET("location_address_street"), - - ALL("all"); - - private final String value; - - DetectDataEntities(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectRequestDeidentifyOption.java b/src/main/java/com/skyflow/generated/rest/types/DetectRequestDeidentifyOption.java deleted file mode 100644 index bdc82ccf..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/DetectRequestDeidentifyOption.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DetectRequestDeidentifyOption { - UNKNOWN("UNKNOWN"), - - ENTITY_UNQ_COUNTER("ENTITY_UNQ_COUNTER"), - - ENTITY_ONLY("ENTITY_ONLY"); - - private final String value; - - DetectRequestDeidentifyOption(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/EntityType.java b/src/main/java/com/skyflow/generated/rest/types/EntityType.java index 605282ed..1c491acc 100644 --- a/src/main/java/com/skyflow/generated/rest/types/EntityType.java +++ b/src/main/java/com/skyflow/generated/rest/types/EntityType.java @@ -28,6 +28,8 @@ public enum EntityType { DATE("date"), + DAY("day"), + DATE_INTERVAL("date_interval"), DOB("dob"), @@ -40,6 +42,8 @@ public enum EntityType { DURATION("duration"), + EFFECT("effect"), + EMAIL_ADDRESS("email_address"), EVENT("event"), @@ -48,7 +52,7 @@ public enum EntityType { FINANCIAL_METRIC("financial_metric"), - GENDER_SEXUALITY("gender_sexuality"), + GENDER("gender"), HEALTHCARE_NUMBER("healthcare_number"), @@ -82,6 +86,8 @@ public enum EntityType { MONEY("money"), + MONTH("month"), + NAME("name"), NAME_FAMILY("name_family"), @@ -96,6 +102,8 @@ public enum EntityType { ORGANIZATION("organization"), + ORGANIZATION_ID("organization_id"), + ORGANIZATION_MEDICAL_FACILITY("organization_medical_facility"), ORIGIN("origin"), @@ -106,6 +114,8 @@ public enum EntityType { PHONE_NUMBER("phone_number"), + PROJECT("project"), + PHYSICAL_ATTRIBUTE("physical_attribute"), POLITICAL_AFFILIATION("political_affiliation"), @@ -116,6 +126,8 @@ public enum EntityType { ROUTING_NUMBER("routing_number"), + SEXUALITY("sexuality"), + SSN("ssn"), STATISTICS("statistics"), @@ -130,6 +142,8 @@ public enum EntityType { VEHICLE_ID("vehicle_id"), + YEAR("year"), + ZODIAC_SIGN("zodiac_sign"); private final String value; diff --git a/src/main/java/com/skyflow/generated/rest/types/ProcessedFileOutputProcessedFileType.java b/src/main/java/com/skyflow/generated/rest/types/ProcessedFileOutputProcessedFileType.java deleted file mode 100644 index 0563503c..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/ProcessedFileOutputProcessedFileType.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ProcessedFileOutputProcessedFileType { - NONE("none"), - - REDACTED_AUDIO("redacted_audio"), - - REDACTED_IMAGE("redacted_image"), - - REDACTED_TRANSCRIPTION("redacted_transcription"), - - REDACTED_FILE("redacted_file"), - - REDACTED_TEXT("redacted_text"), - - ENTITIES("entities"), - - REDACTED_AWS_TRANSCRIPTION_DIARIZE_JSON("redacted_aws_transcription_diarize_json"), - - REDACTED_DEEPGRAM_TRANSCRIPTION_DIARIZE_JSON("redacted_deepgram_transcription_diarize_json"), - - PLAINTEXT_TRANSCRIBED("plaintext_transcribed"); - - private final String value; - - ProcessedFileOutputProcessedFileType(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java new file mode 100644 index 00000000..fc22ff36 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReidentifyFileResponse.Builder.class) +public final class ReidentifyFileResponse { + private final ReidentifyFileResponseStatus status; + + private final ReidentifyFileResponseOutput output; + + private final Map additionalProperties; + + private ReidentifyFileResponse( + ReidentifyFileResponseStatus status, + ReidentifyFileResponseOutput output, + Map additionalProperties) { + this.status = status; + this.output = output; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of the re-identify operation. + */ + @JsonProperty("status") + public ReidentifyFileResponseStatus getStatus() { + return status; + } + + /** + * @return Format of the output file. + */ + @JsonProperty("output_type") + public String getOutputType() { + return "BASE64"; + } + + @JsonProperty("output") + public ReidentifyFileResponseOutput getOutput() { + return output; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReidentifyFileResponse && equalTo((ReidentifyFileResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReidentifyFileResponse other) { + return status.equals(other.status) && output.equals(other.output); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status, this.output); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + * Status of the re-identify operation. + */ + OutputStage status(@NotNull ReidentifyFileResponseStatus status); + + Builder from(ReidentifyFileResponse other); + } + + public interface OutputStage { + _FinalStage output(@NotNull ReidentifyFileResponseOutput output); + } + + public interface _FinalStage { + ReidentifyFileResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, OutputStage, _FinalStage { + private ReidentifyFileResponseStatus status; + + private ReidentifyFileResponseOutput output; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReidentifyFileResponse other) { + status(other.getStatus()); + output(other.getOutput()); + return this; + } + + /** + * Status of the re-identify operation.

Status of the re-identify operation.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public OutputStage status(@NotNull ReidentifyFileResponseStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("output") + public _FinalStage output(@NotNull ReidentifyFileResponseOutput output) { + this.output = Objects.requireNonNull(output, "output must not be null"); + return this; + } + + @java.lang.Override + public ReidentifyFileResponse build() { + return new ReidentifyFileResponse(status, output, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutput.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutput.java new file mode 100644 index 00000000..266a9475 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutput.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReidentifyFileResponseOutput.Builder.class) +public final class ReidentifyFileResponseOutput { + private final String processedFile; + + private final String processedFileExtension; + + private final Map additionalProperties; + + private ReidentifyFileResponseOutput( + String processedFile, String processedFileExtension, Map additionalProperties) { + this.processedFile = processedFile; + this.processedFileExtension = processedFileExtension; + this.additionalProperties = additionalProperties; + } + + /** + * @return Re-identified file content in base64 format. + */ + @JsonProperty("processed_file") + public String getProcessedFile() { + return processedFile; + } + + /** + * @return Type of the processed file. + */ + @JsonProperty("processed_file_type") + public String getProcessedFileType() { + return "reidentified_file"; + } + + /** + * @return Extension of the processed file. + */ + @JsonProperty("processed_file_extension") + public String getProcessedFileExtension() { + return processedFileExtension; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReidentifyFileResponseOutput && equalTo((ReidentifyFileResponseOutput) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReidentifyFileResponseOutput other) { + return processedFile.equals(other.processedFile) && processedFileExtension.equals(other.processedFileExtension); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.processedFile, this.processedFileExtension); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProcessedFileStage builder() { + return new Builder(); + } + + public interface ProcessedFileStage { + /** + * Re-identified file content in base64 format. + */ + ProcessedFileExtensionStage processedFile(@NotNull String processedFile); + + Builder from(ReidentifyFileResponseOutput other); + } + + public interface ProcessedFileExtensionStage { + /** + * Extension of the processed file. + */ + _FinalStage processedFileExtension(@NotNull String processedFileExtension); + } + + public interface _FinalStage { + ReidentifyFileResponseOutput build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProcessedFileStage, ProcessedFileExtensionStage, _FinalStage { + private String processedFile; + + private String processedFileExtension; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReidentifyFileResponseOutput other) { + processedFile(other.getProcessedFile()); + processedFileExtension(other.getProcessedFileExtension()); + return this; + } + + /** + * Re-identified file content in base64 format.

Re-identified file content in base64 format.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("processed_file") + public ProcessedFileExtensionStage processedFile(@NotNull String processedFile) { + this.processedFile = Objects.requireNonNull(processedFile, "processedFile must not be null"); + return this; + } + + /** + * Extension of the processed file.

Extension of the processed file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("processed_file_extension") + public _FinalStage processedFileExtension(@NotNull String processedFileExtension) { + this.processedFileExtension = + Objects.requireNonNull(processedFileExtension, "processedFileExtension must not be null"); + return this; + } + + @java.lang.Override + public ReidentifyFileResponseOutput build() { + return new ReidentifyFileResponseOutput(processedFile, processedFileExtension, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponseStatus.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java similarity index 67% rename from src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponseStatus.java rename to src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java index c819b167..b367176a 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponseStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java @@ -5,18 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum V1DetectStatusResponseStatus { - UNKNOWN("UNKNOWN"), - +public enum ReidentifyFileResponseStatus { FAILED("FAILED"), - - SUCCESS("SUCCESS"), - - IN_PROGRESS("IN_PROGRESS"); + IN_PROGRESS("IN_PROGRESS"), + SUCCESS("SUCCESS"); private final String value; - V1DetectStatusResponseStatus(String value) { + ReidentifyFileResponseStatus(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AdvancedOptions.java b/src/main/java/com/skyflow/generated/rest/types/V1AdvancedOptions.java deleted file mode 100644 index 999153e4..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1AdvancedOptions.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1AdvancedOptions.Builder.class) -public final class V1AdvancedOptions { - private final Optional dateShift; - - private final Optional customClient; - - private final Optional schema; - - private final Map additionalProperties; - - private V1AdvancedOptions( - Optional dateShift, - Optional customClient, - Optional schema, - Map additionalProperties) { - this.dateShift = dateShift; - this.customClient = customClient; - this.schema = schema; - this.additionalProperties = additionalProperties; - } - - /** - * @return No. of days by which original date has to be shifted to. - */ - @JsonProperty("date_shift") - public Optional getDateShift() { - return dateShift; - } - - /** - * @return Custom client specific logic. - */ - @JsonProperty("custom_client") - public Optional getCustomClient() { - return customClient; - } - - @JsonProperty("schema") - public Optional getSchema() { - return schema; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1AdvancedOptions && equalTo((V1AdvancedOptions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1AdvancedOptions other) { - return dateShift.equals(other.dateShift) - && customClient.equals(other.customClient) - && schema.equals(other.schema); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.dateShift, this.customClient, this.schema); - } - - @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 dateShift = Optional.empty(); - - private Optional customClient = Optional.empty(); - - private Optional schema = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1AdvancedOptions other) { - dateShift(other.getDateShift()); - customClient(other.getCustomClient()); - schema(other.getSchema()); - return this; - } - - /** - *

No. of days by which original date has to be shifted to.

- */ - @JsonSetter(value = "date_shift", nulls = Nulls.SKIP) - public Builder dateShift(Optional dateShift) { - this.dateShift = dateShift; - return this; - } - - public Builder dateShift(Integer dateShift) { - this.dateShift = Optional.ofNullable(dateShift); - return this; - } - - /** - *

Custom client specific logic.

- */ - @JsonSetter(value = "custom_client", nulls = Nulls.SKIP) - public Builder customClient(Optional customClient) { - this.customClient = customClient; - return this; - } - - public Builder customClient(Boolean customClient) { - this.customClient = Optional.ofNullable(customClient); - return this; - } - - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public Builder schema(Optional schema) { - this.schema = schema; - return this; - } - - public Builder schema(AdvancedOptionsVaultSchema schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - public V1AdvancedOptions build() { - return new V1AdvancedOptions(dateShift, customClient, schema, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AudioConfig.java b/src/main/java/com/skyflow/generated/rest/types/V1AudioConfig.java deleted file mode 100644 index 50e5508a..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1AudioConfig.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1AudioConfig.Builder.class) -public final class V1AudioConfig { - private final Optional outputTranscription; - - private final Optional outputProcessedAudio; - - private final Optional options; - - private final Map additionalProperties; - - private V1AudioConfig( - Optional outputTranscription, - Optional outputProcessedAudio, - Optional options, - Map additionalProperties) { - this.outputTranscription = outputTranscription; - this.outputProcessedAudio = outputProcessedAudio; - this.options = options; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("output_transcription") - public Optional getOutputTranscription() { - return outputTranscription; - } - - /** - * @return If true, includes processed audio file in the response. - */ - @JsonProperty("output_processed_audio") - public Optional getOutputProcessedAudio() { - return outputProcessedAudio; - } - - @JsonProperty("options") - public Optional getOptions() { - return options; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1AudioConfig && equalTo((V1AudioConfig) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1AudioConfig other) { - return outputTranscription.equals(other.outputTranscription) - && outputProcessedAudio.equals(other.outputProcessedAudio) - && options.equals(other.options); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.outputTranscription, this.outputProcessedAudio, this.options); - } - - @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 outputTranscription = Optional.empty(); - - private Optional outputProcessedAudio = Optional.empty(); - - private Optional options = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1AudioConfig other) { - outputTranscription(other.getOutputTranscription()); - outputProcessedAudio(other.getOutputProcessedAudio()); - options(other.getOptions()); - return this; - } - - @JsonSetter(value = "output_transcription", nulls = Nulls.SKIP) - public Builder outputTranscription(Optional outputTranscription) { - this.outputTranscription = outputTranscription; - return this; - } - - public Builder outputTranscription(AudioConfigTranscriptionType outputTranscription) { - this.outputTranscription = Optional.ofNullable(outputTranscription); - return this; - } - - /** - *

If true, includes processed audio file in the response.

- */ - @JsonSetter(value = "output_processed_audio", nulls = Nulls.SKIP) - public Builder outputProcessedAudio(Optional outputProcessedAudio) { - this.outputProcessedAudio = outputProcessedAudio; - return this; - } - - public Builder outputProcessedAudio(Boolean outputProcessedAudio) { - this.outputProcessedAudio = Optional.ofNullable(outputProcessedAudio); - return this; - } - - @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional options) { - this.options = options; - return this; - } - - public Builder options(V1AudioOptions options) { - this.options = Optional.ofNullable(options); - return this; - } - - public V1AudioConfig build() { - return new V1AudioConfig(outputTranscription, outputProcessedAudio, options, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AudioOptions.java b/src/main/java/com/skyflow/generated/rest/types/V1AudioOptions.java deleted file mode 100644 index d71b77a0..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1AudioOptions.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1AudioOptions.Builder.class) -public final class V1AudioOptions { - private final Optional bleepStartPadding; - - private final Optional bleepEndPadding; - - private final Optional distortionSteps; - - private final Optional bleepFrequency; - - private final Optional bleepGain; - - private final Map additionalProperties; - - private V1AudioOptions( - Optional bleepStartPadding, - Optional bleepEndPadding, - Optional distortionSteps, - Optional bleepFrequency, - Optional bleepGain, - Map additionalProperties) { - this.bleepStartPadding = bleepStartPadding; - this.bleepEndPadding = bleepEndPadding; - this.distortionSteps = distortionSteps; - this.bleepFrequency = bleepFrequency; - this.bleepGain = bleepGain; - this.additionalProperties = additionalProperties; - } - - /** - * @return Padding added to the beginning of a bleep, in seconds. - */ - @JsonProperty("bleep_start_padding") - public Optional getBleepStartPadding() { - return bleepStartPadding; - } - - /** - * @return Padding added to the end of a bleep, in seconds. - */ - @JsonProperty("bleep_end_padding") - public Optional getBleepEndPadding() { - return bleepEndPadding; - } - - /** - * @return Specifies how the distortion will be made. Providing a number more than 0 will result in a higher tone and a coefficient less than 0 will result in a lower tone. - */ - @JsonProperty("distortion_steps") - public Optional getDistortionSteps() { - return distortionSteps; - } - - /** - * @return This parameter configures the frequency of the sine wave used for the bleep sound in an audio segment. - */ - @JsonProperty("bleep_frequency") - public Optional getBleepFrequency() { - return bleepFrequency; - } - - /** - * @return It controls the relative loudness of the bleep,positive values increase its loudness, and negative values decrease it. - */ - @JsonProperty("bleep_gain") - public Optional getBleepGain() { - return bleepGain; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1AudioOptions && equalTo((V1AudioOptions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1AudioOptions other) { - return bleepStartPadding.equals(other.bleepStartPadding) - && bleepEndPadding.equals(other.bleepEndPadding) - && distortionSteps.equals(other.distortionSteps) - && bleepFrequency.equals(other.bleepFrequency) - && bleepGain.equals(other.bleepGain); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.bleepStartPadding, - this.bleepEndPadding, - this.distortionSteps, - this.bleepFrequency, - this.bleepGain); - } - - @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 bleepStartPadding = Optional.empty(); - - private Optional bleepEndPadding = Optional.empty(); - - private Optional distortionSteps = Optional.empty(); - - private Optional bleepFrequency = Optional.empty(); - - private Optional bleepGain = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1AudioOptions other) { - bleepStartPadding(other.getBleepStartPadding()); - bleepEndPadding(other.getBleepEndPadding()); - distortionSteps(other.getDistortionSteps()); - bleepFrequency(other.getBleepFrequency()); - bleepGain(other.getBleepGain()); - return this; - } - - /** - *

Padding added to the beginning of a bleep, in seconds.

- */ - @JsonSetter(value = "bleep_start_padding", nulls = Nulls.SKIP) - public Builder bleepStartPadding(Optional bleepStartPadding) { - this.bleepStartPadding = bleepStartPadding; - return this; - } - - public Builder bleepStartPadding(Float bleepStartPadding) { - this.bleepStartPadding = Optional.ofNullable(bleepStartPadding); - return this; - } - - /** - *

Padding added to the end of a bleep, in seconds.

- */ - @JsonSetter(value = "bleep_end_padding", nulls = Nulls.SKIP) - public Builder bleepEndPadding(Optional bleepEndPadding) { - this.bleepEndPadding = bleepEndPadding; - return this; - } - - public Builder bleepEndPadding(Float bleepEndPadding) { - this.bleepEndPadding = Optional.ofNullable(bleepEndPadding); - return this; - } - - /** - *

Specifies how the distortion will be made. Providing a number more than 0 will result in a higher tone and a coefficient less than 0 will result in a lower tone.

- */ - @JsonSetter(value = "distortion_steps", nulls = Nulls.SKIP) - public Builder distortionSteps(Optional distortionSteps) { - this.distortionSteps = distortionSteps; - return this; - } - - public Builder distortionSteps(Integer distortionSteps) { - this.distortionSteps = Optional.ofNullable(distortionSteps); - return this; - } - - /** - *

This parameter configures the frequency of the sine wave used for the bleep sound in an audio segment.

- */ - @JsonSetter(value = "bleep_frequency", nulls = Nulls.SKIP) - public Builder bleepFrequency(Optional bleepFrequency) { - this.bleepFrequency = bleepFrequency; - return this; - } - - public Builder bleepFrequency(Integer bleepFrequency) { - this.bleepFrequency = Optional.ofNullable(bleepFrequency); - return this; - } - - /** - *

It controls the relative loudness of the bleep,positive values increase its loudness, and negative values decrease it.

- */ - @JsonSetter(value = "bleep_gain", nulls = Nulls.SKIP) - public Builder bleepGain(Optional bleepGain) { - this.bleepGain = bleepGain; - return this; - } - - public Builder bleepGain(Integer bleepGain) { - this.bleepGain = Optional.ofNullable(bleepGain); - return this; - } - - public V1AudioOptions build() { - return new V1AudioOptions( - bleepStartPadding, - bleepEndPadding, - distortionSteps, - bleepFrequency, - bleepGain, - additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetectFileResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DetectFileResponse.java deleted file mode 100644 index 0c309cb9..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetectFileResponse.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1DetectFileResponse.Builder.class) -public final class V1DetectFileResponse { - private final Optional statusUrl; - - private final Map additionalProperties; - - private V1DetectFileResponse(Optional statusUrl, Map additionalProperties) { - this.statusUrl = statusUrl; - this.additionalProperties = additionalProperties; - } - - /** - * @return Status URL for the deidentification request. - */ - @JsonProperty("status_url") - public Optional getStatusUrl() { - return statusUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1DetectFileResponse && equalTo((V1DetectFileResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1DetectFileResponse other) { - return statusUrl.equals(other.statusUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.statusUrl); - } - - @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 statusUrl = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1DetectFileResponse other) { - statusUrl(other.getStatusUrl()); - return this; - } - - /** - *

Status URL for the deidentification request.

- */ - @JsonSetter(value = "status_url", nulls = Nulls.SKIP) - public Builder statusUrl(Optional statusUrl) { - this.statusUrl = statusUrl; - return this; - } - - public Builder statusUrl(String statusUrl) { - this.statusUrl = Optional.ofNullable(statusUrl); - return this; - } - - public V1DetectFileResponse build() { - return new V1DetectFileResponse(statusUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponse.java deleted file mode 100644 index 95e7845c..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponse.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; -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 = V1DetectStatusResponse.Builder.class) -public final class V1DetectStatusResponse { - private final Optional status; - - private final Optional> output; - - private final Optional message; - - private final Map additionalProperties; - - private V1DetectStatusResponse( - Optional status, - Optional> output, - Optional message, - Map additionalProperties) { - this.status = status; - this.output = output; - this.message = message; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return How the input file was specified. - */ - @JsonProperty("output") - public Optional> getOutput() { - return output; - } - - /** - * @return Status details about the deidentification request. - */ - @JsonProperty("message") - public Optional getMessage() { - return message; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1DetectStatusResponse && equalTo((V1DetectStatusResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1DetectStatusResponse other) { - return status.equals(other.status) && output.equals(other.output) && message.equals(other.message); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.status, this.output, this.message); - } - - @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 status = Optional.empty(); - - private Optional> output = Optional.empty(); - - private Optional message = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1DetectStatusResponse other) { - status(other.getStatus()); - output(other.getOutput()); - message(other.getMessage()); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(V1DetectStatusResponseStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - /** - *

How the input file was specified.

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

Status details about the deidentification request.

- */ - @JsonSetter(value = "message", nulls = Nulls.SKIP) - public Builder message(Optional message) { - this.message = message; - return this; - } - - public Builder message(String message) { - this.message = Optional.ofNullable(message); - return this; - } - - public V1DetectStatusResponse build() { - return new V1DetectStatusResponse(status, output, message, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetectTextRequest.java b/src/main/java/com/skyflow/generated/rest/types/V1DetectTextRequest.java deleted file mode 100644 index 57778d80..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetectTextRequest.java +++ /dev/null @@ -1,522 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = V1DetectTextRequest.Builder.class) -public final class V1DetectTextRequest { - private final String text; - - private final String vaultId; - - private final Optional sessionId; - - private final Optional> restrictEntityTypes; - - private final Optional deidentifyTokenFormat; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional returnEntities; - - private final Optional accuracy; - - private final Optional advancedOptions; - - private final Optional storeEntities; - - private final Map additionalProperties; - - private V1DetectTextRequest( - String text, - String vaultId, - Optional sessionId, - Optional> restrictEntityTypes, - Optional deidentifyTokenFormat, - Optional> allowRegex, - Optional> restrictRegex, - Optional returnEntities, - Optional accuracy, - Optional advancedOptions, - Optional storeEntities, - Map additionalProperties) { - this.text = text; - this.vaultId = vaultId; - this.sessionId = sessionId; - this.restrictEntityTypes = restrictEntityTypes; - this.deidentifyTokenFormat = deidentifyTokenFormat; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.returnEntities = returnEntities; - this.accuracy = accuracy; - this.advancedOptions = advancedOptions; - this.storeEntities = storeEntities; - this.additionalProperties = additionalProperties; - } - - /** - * @return Data to deidentify. - */ - @JsonProperty("text") - public String getText() { - return text; - } - - /** - * @return ID of the vault. - */ - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return Will give a handle to delete the tokens generated during a specific interaction. - */ - @JsonProperty("session_id") - public Optional getSessionId() { - return sessionId; - } - - /** - * @return Entities to detect and deidentify. - */ - @JsonProperty("restrict_entity_types") - public Optional> getRestrictEntityTypes() { - return restrictEntityTypes; - } - - @JsonProperty("deidentify_token_format") - public Optional getDeidentifyTokenFormat() { - return deidentifyTokenFormat; - } - - /** - * @return Regular expressions to ignore when detecting entities. - */ - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - /** - * @return Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'. - */ - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - /** - * @return If true, returns the details for the detected entities. - */ - @JsonProperty("return_entities") - public Optional getReturnEntities() { - return returnEntities; - } - - @JsonProperty("accuracy") - public Optional getAccuracy() { - return accuracy; - } - - @JsonProperty("advanced_options") - public Optional getAdvancedOptions() { - return advancedOptions; - } - - /** - * @return Indicates whether entities should be stored in the vault. - */ - @JsonProperty("store_entities") - public Optional getStoreEntities() { - return storeEntities; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1DetectTextRequest && equalTo((V1DetectTextRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1DetectTextRequest other) { - return text.equals(other.text) - && vaultId.equals(other.vaultId) - && sessionId.equals(other.sessionId) - && restrictEntityTypes.equals(other.restrictEntityTypes) - && deidentifyTokenFormat.equals(other.deidentifyTokenFormat) - && allowRegex.equals(other.allowRegex) - && restrictRegex.equals(other.restrictRegex) - && returnEntities.equals(other.returnEntities) - && accuracy.equals(other.accuracy) - && advancedOptions.equals(other.advancedOptions) - && storeEntities.equals(other.storeEntities); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.text, - this.vaultId, - this.sessionId, - this.restrictEntityTypes, - this.deidentifyTokenFormat, - this.allowRegex, - this.restrictRegex, - this.returnEntities, - this.accuracy, - this.advancedOptions, - this.storeEntities); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TextStage builder() { - return new Builder(); - } - - public interface TextStage { - /** - * Data to deidentify. - */ - VaultIdStage text(@NotNull String text); - - Builder from(V1DetectTextRequest other); - } - - public interface VaultIdStage { - /** - * ID of the vault. - */ - _FinalStage vaultId(@NotNull String vaultId); - } - - public interface _FinalStage { - V1DetectTextRequest build(); - - /** - *

Will give a handle to delete the tokens generated during a specific interaction.

- */ - _FinalStage sessionId(Optional sessionId); - - _FinalStage sessionId(String sessionId); - - /** - *

Entities to detect and deidentify.

- */ - _FinalStage restrictEntityTypes(Optional> restrictEntityTypes); - - _FinalStage restrictEntityTypes(List restrictEntityTypes); - - _FinalStage deidentifyTokenFormat(Optional deidentifyTokenFormat); - - _FinalStage deidentifyTokenFormat(DetectRequestDeidentifyOption deidentifyTokenFormat); - - /** - *

Regular expressions to ignore when detecting entities.

- */ - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - /** - *

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

- */ - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - /** - *

If true, returns the details for the detected entities.

- */ - _FinalStage returnEntities(Optional returnEntities); - - _FinalStage returnEntities(Boolean returnEntities); - - _FinalStage accuracy(Optional accuracy); - - _FinalStage accuracy(DetectDataAccuracy accuracy); - - _FinalStage advancedOptions(Optional advancedOptions); - - _FinalStage advancedOptions(V1AdvancedOptions advancedOptions); - - /** - *

Indicates whether entities should be stored in the vault.

- */ - _FinalStage storeEntities(Optional storeEntities); - - _FinalStage storeEntities(Boolean storeEntities); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TextStage, VaultIdStage, _FinalStage { - private String text; - - private String vaultId; - - private Optional storeEntities = Optional.empty(); - - private Optional advancedOptions = Optional.empty(); - - private Optional accuracy = Optional.empty(); - - private Optional returnEntities = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional deidentifyTokenFormat = Optional.empty(); - - private Optional> restrictEntityTypes = Optional.empty(); - - private Optional sessionId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(V1DetectTextRequest other) { - text(other.getText()); - vaultId(other.getVaultId()); - sessionId(other.getSessionId()); - restrictEntityTypes(other.getRestrictEntityTypes()); - deidentifyTokenFormat(other.getDeidentifyTokenFormat()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - returnEntities(other.getReturnEntities()); - accuracy(other.getAccuracy()); - advancedOptions(other.getAdvancedOptions()); - storeEntities(other.getStoreEntities()); - return this; - } - - /** - * Data to deidentify.

Data to deidentify.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("text") - public VaultIdStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); - return this; - } - - /** - * ID of the vault.

ID of the vault.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("vault_id") - public _FinalStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - *

Indicates whether entities should be stored in the vault.

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

Indicates whether entities should be stored in the vault.

- */ - @java.lang.Override - @JsonSetter(value = "store_entities", nulls = Nulls.SKIP) - public _FinalStage storeEntities(Optional storeEntities) { - this.storeEntities = storeEntities; - return this; - } - - @java.lang.Override - public _FinalStage advancedOptions(V1AdvancedOptions advancedOptions) { - this.advancedOptions = Optional.ofNullable(advancedOptions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_options", nulls = Nulls.SKIP) - public _FinalStage advancedOptions(Optional advancedOptions) { - this.advancedOptions = advancedOptions; - return this; - } - - @java.lang.Override - public _FinalStage accuracy(DetectDataAccuracy accuracy) { - this.accuracy = Optional.ofNullable(accuracy); - return this; - } - - @java.lang.Override - @JsonSetter(value = "accuracy", nulls = Nulls.SKIP) - public _FinalStage accuracy(Optional accuracy) { - this.accuracy = accuracy; - return this; - } - - /** - *

If true, returns the details for the detected entities.

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

If true, returns the details for the detected entities.

- */ - @java.lang.Override - @JsonSetter(value = "return_entities", nulls = Nulls.SKIP) - public _FinalStage returnEntities(Optional returnEntities) { - this.returnEntities = returnEntities; - return this; - } - - /** - *

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

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

Regular expressions to always restrict. Strings matching these regular expressions are replaced with 'RESTRICTED'.

- */ - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - /** - *

Regular expressions to ignore when detecting entities.

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

Regular expressions to ignore when detecting entities.

- */ - @java.lang.Override - @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) - public _FinalStage allowRegex(Optional> allowRegex) { - this.allowRegex = allowRegex; - return this; - } - - @java.lang.Override - public _FinalStage deidentifyTokenFormat(DetectRequestDeidentifyOption deidentifyTokenFormat) { - this.deidentifyTokenFormat = Optional.ofNullable(deidentifyTokenFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "deidentify_token_format", nulls = Nulls.SKIP) - public _FinalStage deidentifyTokenFormat(Optional deidentifyTokenFormat) { - this.deidentifyTokenFormat = deidentifyTokenFormat; - return this; - } - - /** - *

Entities to detect and deidentify.

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

Entities to detect and deidentify.

- */ - @java.lang.Override - @JsonSetter(value = "restrict_entity_types", nulls = Nulls.SKIP) - public _FinalStage restrictEntityTypes(Optional> restrictEntityTypes) { - this.restrictEntityTypes = restrictEntityTypes; - return this; - } - - /** - *

Will give a handle to delete the tokens generated during a specific interaction.

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

Will give a handle to delete the tokens generated during a specific interaction.

- */ - @java.lang.Override - @JsonSetter(value = "session_id", nulls = Nulls.SKIP) - public _FinalStage sessionId(Optional sessionId) { - this.sessionId = sessionId; - return this; - } - - @java.lang.Override - public V1DetectTextRequest build() { - return new V1DetectTextRequest( - text, - vaultId, - sessionId, - restrictEntityTypes, - deidentifyTokenFormat, - allowRegex, - restrictRegex, - returnEntities, - accuracy, - advancedOptions, - storeEntities, - additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetectTextResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DetectTextResponse.java deleted file mode 100644 index a07c3344..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetectTextResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.core.ObjectMappers; -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 = V1DetectTextResponse.Builder.class) -public final class V1DetectTextResponse { - private final Optional processedText; - - private final Optional> entities; - - private final Map additionalProperties; - - private V1DetectTextResponse( - Optional processedText, - Optional> entities, - Map additionalProperties) { - this.processedText = processedText; - this.entities = entities; - this.additionalProperties = additionalProperties; - } - - /** - * @return Deidentified text. If the input was a file, text that was extracted or transcribed from the file and deidentified. - */ - @JsonProperty("processed_text") - public Optional getProcessedText() { - return processedText; - } - - /** - * @return Detected entities. - */ - @JsonProperty("entities") - public Optional> getEntities() { - return entities; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1DetectTextResponse && equalTo((V1DetectTextResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1DetectTextResponse other) { - return processedText.equals(other.processedText) && entities.equals(other.entities); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.processedText, this.entities); - } - - @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 processedText = Optional.empty(); - - private Optional> entities = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1DetectTextResponse other) { - processedText(other.getProcessedText()); - entities(other.getEntities()); - return this; - } - - /** - *

Deidentified text. If the input was a file, text that was extracted or transcribed from the file and deidentified.

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

Detected entities.

- */ - @JsonSetter(value = "entities", nulls = Nulls.SKIP) - public Builder entities(Optional> entities) { - this.entities = entities; - return this; - } - - public Builder entities(List entities) { - this.entities = Optional.ofNullable(entities); - return this; - } - - public V1DetectTextResponse build() { - return new V1DetectTextResponse(processedText, entities, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1ImageOptions.java b/src/main/java/com/skyflow/generated/rest/types/V1ImageOptions.java deleted file mode 100644 index cd40fb5b..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1ImageOptions.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1ImageOptions.Builder.class) -public final class V1ImageOptions { - private final Optional outputProcessedImage; - - private final Optional outputOcrText; - - private final Map additionalProperties; - - private V1ImageOptions( - Optional outputProcessedImage, - Optional outputOcrText, - Map additionalProperties) { - this.outputProcessedImage = outputProcessedImage; - this.outputOcrText = outputOcrText; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, includes processed image in the output. - */ - @JsonProperty("output_processed_image") - public Optional getOutputProcessedImage() { - return outputProcessedImage; - } - - /** - * @return If true, includes OCR text output in the response. - */ - @JsonProperty("output_ocr_text") - public Optional getOutputOcrText() { - return outputOcrText; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1ImageOptions && equalTo((V1ImageOptions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1ImageOptions other) { - return outputProcessedImage.equals(other.outputProcessedImage) && outputOcrText.equals(other.outputOcrText); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.outputProcessedImage, this.outputOcrText); - } - - @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 outputProcessedImage = Optional.empty(); - - private Optional outputOcrText = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1ImageOptions other) { - outputProcessedImage(other.getOutputProcessedImage()); - outputOcrText(other.getOutputOcrText()); - return this; - } - - /** - *

If true, includes processed image in the output.

- */ - @JsonSetter(value = "output_processed_image", nulls = Nulls.SKIP) - public Builder outputProcessedImage(Optional outputProcessedImage) { - this.outputProcessedImage = outputProcessedImage; - return this; - } - - public Builder outputProcessedImage(Boolean outputProcessedImage) { - this.outputProcessedImage = Optional.ofNullable(outputProcessedImage); - return this; - } - - /** - *

If true, includes OCR text output in the response.

- */ - @JsonSetter(value = "output_ocr_text", nulls = Nulls.SKIP) - public Builder outputOcrText(Optional outputOcrText) { - this.outputOcrText = outputOcrText; - return this; - } - - public Builder outputOcrText(Boolean outputOcrText) { - this.outputOcrText = Optional.ofNullable(outputOcrText); - return this; - } - - public V1ImageOptions build() { - return new V1ImageOptions(outputProcessedImage, outputOcrText, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1Locations.java b/src/main/java/com/skyflow/generated/rest/types/V1Locations.java deleted file mode 100644 index ef1593ca..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1Locations.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1Locations.Builder.class) -public final class V1Locations { - private final Optional startIndex; - - private final Optional endIndex; - - private final Optional startIndexProcessed; - - private final Optional endIndexProcessed; - - private final Map additionalProperties; - - private V1Locations( - Optional startIndex, - Optional endIndex, - Optional startIndexProcessed, - Optional endIndexProcessed, - Map additionalProperties) { - this.startIndex = startIndex; - this.endIndex = endIndex; - this.startIndexProcessed = startIndexProcessed; - this.endIndexProcessed = endIndexProcessed; - this.additionalProperties = additionalProperties; - } - - /** - * @return Index of the first character of the string in the original text. - */ - @JsonProperty("start_index") - public Optional getStartIndex() { - return startIndex; - } - - /** - * @return Index of the last character of the string in the original text. - */ - @JsonProperty("end_index") - public Optional getEndIndex() { - return endIndex; - } - - /** - * @return Index of the first character of the string in the processed text. - */ - @JsonProperty("start_index_processed") - public Optional getStartIndexProcessed() { - return startIndexProcessed; - } - - /** - * @return Index of the last character of the string in the processed text. - */ - @JsonProperty("end_index_processed") - public Optional getEndIndexProcessed() { - return endIndexProcessed; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1Locations && equalTo((V1Locations) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1Locations other) { - return startIndex.equals(other.startIndex) - && endIndex.equals(other.endIndex) - && startIndexProcessed.equals(other.startIndexProcessed) - && endIndexProcessed.equals(other.endIndexProcessed); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.startIndex, this.endIndex, this.startIndexProcessed, this.endIndexProcessed); - } - - @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 startIndex = Optional.empty(); - - private Optional endIndex = Optional.empty(); - - private Optional startIndexProcessed = Optional.empty(); - - private Optional endIndexProcessed = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1Locations other) { - startIndex(other.getStartIndex()); - endIndex(other.getEndIndex()); - startIndexProcessed(other.getStartIndexProcessed()); - endIndexProcessed(other.getEndIndexProcessed()); - return this; - } - - /** - *

Index of the first character of the string in the original text.

- */ - @JsonSetter(value = "start_index", nulls = Nulls.SKIP) - public Builder startIndex(Optional startIndex) { - this.startIndex = startIndex; - return this; - } - - public Builder startIndex(Integer startIndex) { - this.startIndex = Optional.ofNullable(startIndex); - return this; - } - - /** - *

Index of the last character of the string in the original text.

- */ - @JsonSetter(value = "end_index", nulls = Nulls.SKIP) - public Builder endIndex(Optional endIndex) { - this.endIndex = endIndex; - return this; - } - - public Builder endIndex(Integer endIndex) { - this.endIndex = Optional.ofNullable(endIndex); - return this; - } - - /** - *

Index of the first character of the string in the processed text.

- */ - @JsonSetter(value = "start_index_processed", nulls = Nulls.SKIP) - public Builder startIndexProcessed(Optional startIndexProcessed) { - this.startIndexProcessed = startIndexProcessed; - return this; - } - - public Builder startIndexProcessed(Integer startIndexProcessed) { - this.startIndexProcessed = Optional.ofNullable(startIndexProcessed); - return this; - } - - /** - *

Index of the last character of the string in the processed text.

- */ - @JsonSetter(value = "end_index_processed", nulls = Nulls.SKIP) - public Builder endIndexProcessed(Optional endIndexProcessed) { - this.endIndexProcessed = endIndexProcessed; - return this; - } - - public Builder endIndexProcessed(Integer endIndexProcessed) { - this.endIndexProcessed = Optional.ofNullable(endIndexProcessed); - return this; - } - - public V1Locations build() { - return new V1Locations(startIndex, endIndex, startIndexProcessed, endIndexProcessed, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1PdfConfig.java b/src/main/java/com/skyflow/generated/rest/types/V1PdfConfig.java deleted file mode 100644 index 8731c1b9..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1PdfConfig.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1PdfConfig.Builder.class) -public final class V1PdfConfig { - private final Optional options; - - private final Map additionalProperties; - - private V1PdfConfig(Optional options, Map additionalProperties) { - this.options = options; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("options") - public Optional getOptions() { - return options; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1PdfConfig && equalTo((V1PdfConfig) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1PdfConfig other) { - return options.equals(other.options); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.options); - } - - @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 options = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1PdfConfig other) { - options(other.getOptions()); - return this; - } - - @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional options) { - this.options = options; - return this; - } - - public Builder options(V1PdfOptions options) { - this.options = Optional.ofNullable(options); - return this; - } - - public V1PdfConfig build() { - return new V1PdfConfig(options, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1PdfOptions.java b/src/main/java/com/skyflow/generated/rest/types/V1PdfOptions.java deleted file mode 100644 index 63de909b..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1PdfOptions.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1PdfOptions.Builder.class) -public final class V1PdfOptions { - private final Optional density; - - private final Optional maxResolution; - - private final Map additionalProperties; - - private V1PdfOptions( - Optional density, Optional maxResolution, Map additionalProperties) { - this.density = density; - this.maxResolution = maxResolution; - this.additionalProperties = additionalProperties; - } - - /** - * @return Pixel density at which to process the PDF file. - */ - @JsonProperty("density") - public Optional getDensity() { - return density; - } - - /** - * @return Max resolution at which to process the PDF file. - */ - @JsonProperty("max_resolution") - public Optional getMaxResolution() { - return maxResolution; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1PdfOptions && equalTo((V1PdfOptions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1PdfOptions other) { - return density.equals(other.density) && maxResolution.equals(other.maxResolution); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.density, this.maxResolution); - } - - @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 density = Optional.empty(); - - private Optional maxResolution = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1PdfOptions other) { - density(other.getDensity()); - maxResolution(other.getMaxResolution()); - return this; - } - - /** - *

Pixel density at which to process the PDF file.

- */ - @JsonSetter(value = "density", nulls = Nulls.SKIP) - public Builder density(Optional density) { - this.density = density; - return this; - } - - public Builder density(Integer density) { - this.density = Optional.ofNullable(density); - return this; - } - - /** - *

Max resolution at which to process the PDF file.

- */ - @JsonSetter(value = "max_resolution", nulls = Nulls.SKIP) - public Builder maxResolution(Optional maxResolution) { - this.maxResolution = maxResolution; - return this; - } - - public Builder maxResolution(Integer maxResolution) { - this.maxResolution = Optional.ofNullable(maxResolution); - return this; - } - - public V1PdfOptions build() { - return new V1PdfOptions(density, maxResolution, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1ProcessedFileOutput.java b/src/main/java/com/skyflow/generated/rest/types/V1ProcessedFileOutput.java deleted file mode 100644 index e4117109..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1ProcessedFileOutput.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1ProcessedFileOutput.Builder.class) -public final class V1ProcessedFileOutput { - private final Optional outputType; - - private final Optional processedFile; - - private final Optional processedFileType; - - private final Map additionalProperties; - - private V1ProcessedFileOutput( - Optional outputType, - Optional processedFile, - Optional processedFileType, - Map additionalProperties) { - this.outputType = outputType; - this.processedFile = processedFile; - this.processedFileType = processedFileType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("output_type") - public Optional getOutputType() { - return outputType; - } - - /** - * @return URL or base64-encoded data of the output. - */ - @JsonProperty("processed_file") - public Optional getProcessedFile() { - return processedFile; - } - - @JsonProperty("processed_file_type") - public Optional getProcessedFileType() { - return processedFileType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1ProcessedFileOutput && equalTo((V1ProcessedFileOutput) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1ProcessedFileOutput other) { - return outputType.equals(other.outputType) - && processedFile.equals(other.processedFile) - && processedFileType.equals(other.processedFileType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.outputType, this.processedFile, this.processedFileType); - } - - @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 outputType = Optional.empty(); - - private Optional processedFile = Optional.empty(); - - private Optional processedFileType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1ProcessedFileOutput other) { - outputType(other.getOutputType()); - processedFile(other.getProcessedFile()); - processedFileType(other.getProcessedFileType()); - return this; - } - - @JsonSetter(value = "output_type", nulls = Nulls.SKIP) - public Builder outputType(Optional outputType) { - this.outputType = outputType; - return this; - } - - public Builder outputType(DetectFileRequestDataType outputType) { - this.outputType = Optional.ofNullable(outputType); - return this; - } - - /** - *

URL or base64-encoded data of the output.

- */ - @JsonSetter(value = "processed_file", nulls = Nulls.SKIP) - public Builder processedFile(Optional processedFile) { - this.processedFile = processedFile; - return this; - } - - public Builder processedFile(String processedFile) { - this.processedFile = Optional.ofNullable(processedFile); - return this; - } - - @JsonSetter(value = "processed_file_type", nulls = Nulls.SKIP) - public Builder processedFileType(Optional processedFileType) { - this.processedFileType = processedFileType; - return this; - } - - public Builder processedFileType(ProcessedFileOutputProcessedFileType processedFileType) { - this.processedFileType = Optional.ofNullable(processedFileType); - return this; - } - - public V1ProcessedFileOutput build() { - return new V1ProcessedFileOutput(outputType, processedFile, processedFileType, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1ResponseEntities.java b/src/main/java/com/skyflow/generated/rest/types/V1ResponseEntities.java deleted file mode 100644 index c02ab39f..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/V1ResponseEntities.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.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.skyflow.generated.rest.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 = V1ResponseEntities.Builder.class) -public final class V1ResponseEntities { - private final Optional processedText; - - private final Optional originalText; - - private final Optional location; - - private final Optional bestLabel; - - private final Optional> labels; - - private final Map additionalProperties; - - private V1ResponseEntities( - Optional processedText, - Optional originalText, - Optional location, - Optional bestLabel, - Optional> labels, - Map additionalProperties) { - this.processedText = processedText; - this.originalText = originalText; - this.location = location; - this.bestLabel = bestLabel; - this.labels = labels; - this.additionalProperties = additionalProperties; - } - - /** - * @return Processed text of the entity. - */ - @JsonProperty("processed_text") - public Optional getProcessedText() { - return processedText; - } - - /** - * @return Original text of the entity. - */ - @JsonProperty("original_text") - public Optional getOriginalText() { - return originalText; - } - - @JsonProperty("location") - public Optional getLocation() { - return location; - } - - /** - * @return Highest rated label. - */ - @JsonProperty("best_label") - public Optional getBestLabel() { - return bestLabel; - } - - /** - * @return Labels and their scores. - */ - @JsonProperty("labels") - public Optional> getLabels() { - return labels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof V1ResponseEntities && equalTo((V1ResponseEntities) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(V1ResponseEntities other) { - return processedText.equals(other.processedText) - && originalText.equals(other.originalText) - && location.equals(other.location) - && bestLabel.equals(other.bestLabel) - && labels.equals(other.labels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.processedText, this.originalText, this.location, this.bestLabel, this.labels); - } - - @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 processedText = Optional.empty(); - - private Optional originalText = Optional.empty(); - - private Optional location = Optional.empty(); - - private Optional bestLabel = Optional.empty(); - - private Optional> labels = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(V1ResponseEntities other) { - processedText(other.getProcessedText()); - originalText(other.getOriginalText()); - location(other.getLocation()); - bestLabel(other.getBestLabel()); - labels(other.getLabels()); - return this; - } - - /** - *

Processed text of the entity.

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

Original text of the entity.

- */ - @JsonSetter(value = "original_text", nulls = Nulls.SKIP) - public Builder originalText(Optional originalText) { - this.originalText = originalText; - return this; - } - - public Builder originalText(String originalText) { - this.originalText = Optional.ofNullable(originalText); - return this; - } - - @JsonSetter(value = "location", nulls = Nulls.SKIP) - public Builder location(Optional location) { - this.location = location; - return this; - } - - public Builder location(V1Locations location) { - this.location = Optional.ofNullable(location); - return this; - } - - /** - *

Highest rated label.

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

Labels and their scores.

- */ - @JsonSetter(value = "labels", nulls = Nulls.SKIP) - public Builder labels(Optional> labels) { - this.labels = labels; - return this; - } - - public Builder labels(Map labels) { - this.labels = Optional.ofNullable(labels); - return this; - } - - public V1ResponseEntities build() { - return new V1ResponseEntities( - processedText, originalText, location, bestLabel, labels, additionalProperties); - } - } -}