diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index c723914a..13fcf623 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -7,12 +7,12 @@ jobs: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} - server-id: ossrh + server-id: central profile: maven-central tag: 'beta' secrets: - server-username: ${{ secrets.OSSRH_USERNAME }} - server-password: ${{ secrets.OSSRH_PASSWORD }} + server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }} + server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }} gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 855b7b4c..1cc20ca1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,12 +7,12 @@ jobs: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} - server-id: ossrh + server-id: central profile: maven-central tag: 'public' secrets: - server-username: ${{ secrets.OSSRH_USERNAME }} - server-password: ${{ secrets.OSSRH_PASSWORD }} + server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }} + server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }} gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index c9cadd2c..13fd1b5b 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -52,9 +52,9 @@ jobs: fetch-depth: 0 - name: Set up maven or jfrog repository - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: "1.8" + java-version: "11" distribution: "adopt" server-id: ${{ inputs.server-id }} server-username: SERVER_USERNAME diff --git a/pom.xml b/pom.xml index 832fd901..6ed0124d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.skyflow skyflow-java - 2.0.0-beta.2 + 2.0.0-beta.3 jar ${project.groupId}:${project.artifactId} @@ -45,12 +45,6 @@ - - com.squareup.okhttp3 - okhttp - 4.12.0 - compile - com.fasterxml.jackson.core jackson-databind @@ -126,9 +120,10 @@ junit junit - ${junit-version} + 4.13.2 test + org.powermock powermock-module-junit4 @@ -141,12 +136,6 @@ 2.0.9 test - - org.junit.jupiter - junit-jupiter - 5.13.2 - compile - @@ -185,7 +174,14 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.2.5 + + false + + **/*Test.java + **/*Tests.java + + org.jacoco @@ -263,25 +259,25 @@ maven-central - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2 + central + https://central.sonatype.com/api/v1/publisher/upload - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots + central-snapshots + https://central.sonatype.com/api/v1/publisher/upload - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 + org.sonatype.central + central-publishing-maven-plugin + 0.4.0 true - ossrh - https://s01.oss.sonatype.org/ - true + central + true + true diff --git a/src/main/java/com/skyflow/VaultClient.java b/src/main/java/com/skyflow/VaultClient.java index 7536a2c1..176f9349 100644 --- a/src/main/java/com/skyflow/VaultClient.java +++ b/src/main/java/com/skyflow/VaultClient.java @@ -512,7 +512,6 @@ protected DeidentifyPdfRequest getDeidentifyPdfRequest(DeidentifyFileRequest req Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); if (tokenFormat != null) { if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) { @@ -540,13 +539,12 @@ protected DeidentifyPdfRequest getDeidentifyPdfRequest(DeidentifyFileRequest req return DeidentifyPdfRequest.builder() .vaultId(vaultId) .file(file) - .density(request.getPixelDensity() != null ? request.getPixelDensity().intValue() : null) - .maxResolution(request.getMaxResolution() != null ? request.getMaxResolution().intValue() : null) + .density(request.getPixelDensity() != null ? request.getPixelDensity().doubleValue() : null) + .maxResolution(request.getMaxResolution() != null ? request.getMaxResolution().doubleValue() : null) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) .restrictRegex(restrictRegex) - .transformations(transformations) .build(); } @@ -558,7 +556,6 @@ protected DeidentifyImageRequest getDeidentifyImageRequest(DeidentifyFileRequest Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); @@ -580,7 +577,6 @@ protected DeidentifyImageRequest getDeidentifyImageRequest(DeidentifyFileRequest .tokenType(tokenType) .allowRegex(allowRegex) .restrictRegex(restrictRegex) - .transformations(transformations) .outputProcessedImage(request.getOutputProcessedImage()) .outputOcrText(request.getOutputOcrText()) .build(); @@ -594,7 +590,6 @@ protected DeidentifyPresentationRequest getDeidentifyPresentationRequest(Deident Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); @@ -610,7 +605,6 @@ protected DeidentifyPresentationRequest getDeidentifyPresentationRequest(Deident .tokenType(tokenType) .allowRegex(allowRegex) .restrictRegex(restrictRegex) - .transformations(transformations) .build(); } @@ -622,7 +616,6 @@ protected DeidentifySpreadsheetRequest getDeidentifySpreadsheetRequest(Deidentif Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); @@ -638,7 +631,6 @@ protected DeidentifySpreadsheetRequest getDeidentifySpreadsheetRequest(Deidentif .tokenType(tokenType) .allowRegex(allowRegex) .restrictRegex(restrictRegex) - .transformations(transformations) .build(); } @@ -678,7 +670,6 @@ protected DeidentifyDocumentRequest getDeidentifyDocumentRequest(DeidentifyFileR Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); @@ -694,7 +685,6 @@ protected DeidentifyDocumentRequest getDeidentifyDocumentRequest(DeidentifyFileR .tokenType(tokenType) .allowRegex(allowRegex) .restrictRegex(restrictRegex) - .transformations(transformations) .build(); } diff --git a/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java b/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java index e17c6d0c..87ffc109 100644 --- a/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java +++ b/src/main/java/com/skyflow/enums/DeidentifyFileStatus.java @@ -2,7 +2,9 @@ public enum DeidentifyFileStatus { IN_PROGRESS("IN_PROGRESS"), - SUCCESS("SUCCESS"); + FAILED("FAILED"), + SUCCESS("SUCCESS"), + UNKNOWN("UNKNOWN"); 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/errors/ErrorMessage.java b/src/main/java/com/skyflow/errors/ErrorMessage.java index df075bca..6070cb75 100644 --- a/src/main/java/com/skyflow/errors/ErrorMessage.java +++ b/src/main/java/com/skyflow/errors/ErrorMessage.java @@ -144,6 +144,7 @@ public enum ErrorMessage { FailedToEncodeFile("%s0 Validation error. Failed to encode the file. Ensure the file is in a supported format and try again."), FailedToDecodeFileFromResponse("%s0 Failed to decode the file from the response. Ensure the response is valid and try again."), EmptyFileAndFilePathInDeIdentifyFile("%s0 Validation error. Both file and filePath are empty. Specify either file object or filePath, not both."), + VaultTokenFormatIsNotAllowedForFiles("%s0 Validation error. Vault token format is not allowed for deidentify file request."), PollingForResultsFailed("%s0 API error. Polling for results failed. Unable to retrieve the deidentified file"), FailedtoSaveProcessedFile("%s0 Validation error. Failed to save the processed file. Ensure the output directory is valid and writable."), InvalidAudioFileType("%s0 Validation error. The file type is not supported. Specify a valid file type mp3 or wav."), 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..1fb7b844 100644 --- a/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java +++ b/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java @@ -8,8 +8,8 @@ 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; @@ -31,7 +31,7 @@ public class AsyncApiClient { protected final Supplier authenticationClient; - protected final Supplier deprecatedClient; + protected final Supplier guardrailsClient; protected final Supplier stringsClient; @@ -45,7 +45,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 +74,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/ApiClientApiException.java b/src/main/java/com/skyflow/generated/rest/core/ApiClientApiException.java index a4487b1e..4fab1d41 100644 --- a/src/main/java/com/skyflow/generated/rest/core/ApiClientApiException.java +++ b/src/main/java/com/skyflow/generated/rest/core/ApiClientApiException.java @@ -65,7 +65,7 @@ public Map> headers() { return this.headers; } - @java.lang.Override + @Override public String toString() { return "ApiClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; 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..62a6ddd4 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.305"); } }); 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/errors/BadRequestError.java b/src/main/java/com/skyflow/generated/rest/errors/BadRequestError.java index c8d4bb99..80ae5e7c 100644 --- a/src/main/java/com/skyflow/generated/rest/errors/BadRequestError.java +++ b/src/main/java/com/skyflow/generated/rest/errors/BadRequestError.java @@ -25,7 +25,7 @@ public BadRequestError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/skyflow/generated/rest/errors/InternalServerError.java b/src/main/java/com/skyflow/generated/rest/errors/InternalServerError.java index d29f2b82..ffeed9d7 100644 --- a/src/main/java/com/skyflow/generated/rest/errors/InternalServerError.java +++ b/src/main/java/com/skyflow/generated/rest/errors/InternalServerError.java @@ -26,7 +26,7 @@ public InternalServerError(ErrorResponse body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public ErrorResponse body() { return this.body; } diff --git a/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java b/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java index efa94aad..1d0a6ad0 100644 --- a/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java +++ b/src/main/java/com/skyflow/generated/rest/errors/NotFoundError.java @@ -25,7 +25,7 @@ public NotFoundError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java b/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java index 3b6d6ae1..3bc254bc 100644 --- a/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java +++ b/src/main/java/com/skyflow/generated/rest/errors/UnauthorizedError.java @@ -25,7 +25,7 @@ public UnauthorizedError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/requests/AuditServiceListAuditEventsRequest.java b/src/main/java/com/skyflow/generated/rest/resources/audit/requests/AuditServiceListAuditEventsRequest.java index 3da04589..8b6686e4 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/requests/AuditServiceListAuditEventsRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/requests/AuditServiceListAuditEventsRequest.java @@ -430,7 +430,7 @@ public Optional getOffset() { return offset; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AuditServiceListAuditEventsRequest @@ -478,7 +478,7 @@ private boolean equalTo(AuditServiceListAuditEventsRequest other) { && offset.equals(other.offset); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.filterOpsContextChangeId, @@ -516,7 +516,7 @@ public int hashCode() { this.offset); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -848,7 +848,7 @@ public static final class Builder implements FilterOpsAccountIdStage, _FinalStag private Builder() {} - @java.lang.Override + @Override public Builder from(AuditServiceListAuditEventsRequest other) { filterOpsContextChangeId(other.getFilterOpsContextChangeId()); filterOpsContextRequestId(other.getFilterOpsContextRequestId()); @@ -890,7 +890,7 @@ public Builder from(AuditServiceListAuditEventsRequest other) { * Resources with the specified account ID.

Resources with the specified account ID.

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

Record position at which to start returning results.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage offset(Long offset) { this.offset = Optional.ofNullable(offset); return this; @@ -910,7 +910,7 @@ public _FinalStage offset(Long offset) { /** *

Record position at which to start returning results.

*/ - @java.lang.Override + @Override @JsonSetter(value = "offset", nulls = Nulls.SKIP) public _FinalStage offset(Optional offset) { this.offset = offset; @@ -921,7 +921,7 @@ public _FinalStage offset(Optional offset) { *

Number of results to return.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage limit(Long limit) { this.limit = Optional.ofNullable(limit); return this; @@ -930,7 +930,7 @@ public _FinalStage limit(Long limit) { /** *

Number of results to return.

*/ - @java.lang.Override + @Override @JsonSetter(value = "limit", nulls = Nulls.SKIP) public _FinalStage limit(Optional limit) { this.limit = limit; @@ -941,7 +941,7 @@ public _FinalStage limit(Optional limit) { *

Change ID provided in the previous audit response's nextOps attribute. An alternate way to manage response pagination. Can't be used with sortOps or offset. For the first request in a series of audit requests, leave blank.

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

Change ID provided in the previous audit response's nextOps attribute. An alternate way to manage response pagination. Can't be used with sortOps or offset. For the first request in a series of audit requests, leave blank.

*/ - @java.lang.Override + @Override @JsonSetter(value = "afterOps.changeID", nulls = Nulls.SKIP) public _FinalStage afterOpsChangeId(Optional afterOpsChangeId) { this.afterOpsChangeId = afterOpsChangeId; @@ -961,7 +961,7 @@ public _FinalStage afterOpsChangeId(Optional afterOpsChangeId) { *

Timestamp provided in the previous audit response's nextOps attribute. An alternate way to manage response pagination. Can't be used with sortOps or offset. For the first request in a series of audit requests, leave blank.

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

Timestamp provided in the previous audit response's nextOps attribute. An alternate way to manage response pagination. Can't be used with sortOps or offset. For the first request in a series of audit requests, leave blank.

*/ - @java.lang.Override + @Override @JsonSetter(value = "afterOps.timestamp", nulls = Nulls.SKIP) public _FinalStage afterOpsTimestamp(Optional afterOpsTimestamp) { this.afterOpsTimestamp = afterOpsTimestamp; @@ -981,7 +981,7 @@ public _FinalStage afterOpsTimestamp(Optional afterOpsTimestamp) { *

Ascending or descending ordering of results.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage sortOpsOrderBy(AuditServiceListAuditEventsRequestSortOpsOrderBy sortOpsOrderBy) { this.sortOpsOrderBy = Optional.ofNullable(sortOpsOrderBy); return this; @@ -990,7 +990,7 @@ public _FinalStage sortOpsOrderBy(AuditServiceListAuditEventsRequestSortOpsOrder /** *

Ascending or descending ordering of results.

*/ - @java.lang.Override + @Override @JsonSetter(value = "sortOps.orderBy", nulls = Nulls.SKIP) public _FinalStage sortOpsOrderBy(Optional sortOpsOrderBy) { this.sortOpsOrderBy = sortOpsOrderBy; @@ -1001,7 +1001,7 @@ public _FinalStage sortOpsOrderBy(OptionalFully-qualified field by which to sort results. Field names should be in camel case (for example, "capitalization.camelCase").

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

Fully-qualified field by which to sort results. Field names should be in camel case (for example, "capitalization.camelCase").

*/ - @java.lang.Override + @Override @JsonSetter(value = "sortOps.sortBy", nulls = Nulls.SKIP) public _FinalStage sortOpsSortBy(Optional sortOpsSortBy) { this.sortOpsSortBy = sortOpsSortBy; @@ -1021,7 +1021,7 @@ public _FinalStage sortOpsSortBy(Optional sortOpsSortBy) { *

HTTP URI of the request.

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

HTTP URI of the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.httpURI", nulls = Nulls.SKIP) public _FinalStage filterOpsHttpUri(Optional filterOpsHttpUri) { this.filterOpsHttpUri = filterOpsHttpUri; @@ -1041,7 +1041,7 @@ public _FinalStage filterOpsHttpUri(Optional filterOpsHttpUri) { *

HTTP method of the request.

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

HTTP method of the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.httpMethod", nulls = Nulls.SKIP) public _FinalStage filterOpsHttpMethod(Optional filterOpsHttpMethod) { this.filterOpsHttpMethod = filterOpsHttpMethod; @@ -1061,7 +1061,7 @@ public _FinalStage filterOpsHttpMethod(Optional filterOpsHttpMethod) { *

Response message of the request.

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

Response message of the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.responseMessage", nulls = Nulls.SKIP) public _FinalStage filterOpsResponseMessage(Optional filterOpsResponseMessage) { this.filterOpsResponseMessage = filterOpsResponseMessage; @@ -1081,7 +1081,7 @@ public _FinalStage filterOpsResponseMessage(Optional filterOpsResponseMe *

Name of the API called in the request.

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

Name of the API called in the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.apiName", nulls = Nulls.SKIP) public _FinalStage filterOpsApiName(Optional filterOpsApiName) { this.filterOpsApiName = filterOpsApiName; @@ -1101,7 +1101,7 @@ public _FinalStage filterOpsApiName(Optional filterOpsApiName) { *

End timestamp for the query, in SQL format.

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

End timestamp for the query, in SQL format.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.endTime", nulls = Nulls.SKIP) public _FinalStage filterOpsEndTime(Optional filterOpsEndTime) { this.filterOpsEndTime = filterOpsEndTime; @@ -1121,7 +1121,7 @@ public _FinalStage filterOpsEndTime(Optional filterOpsEndTime) { *

Start timestamp for the query, in SQL format.

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

Start timestamp for the query, in SQL format.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.startTime", nulls = Nulls.SKIP) public _FinalStage filterOpsStartTime(Optional filterOpsStartTime) { this.filterOpsStartTime = filterOpsStartTime; @@ -1141,7 +1141,7 @@ public _FinalStage filterOpsStartTime(Optional filterOpsStartTime) { *

HTTP response code of the request.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filterOpsResponseCode(Integer filterOpsResponseCode) { this.filterOpsResponseCode = Optional.ofNullable(filterOpsResponseCode); return this; @@ -1150,7 +1150,7 @@ public _FinalStage filterOpsResponseCode(Integer filterOpsResponseCode) { /** *

HTTP response code of the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.responseCode", nulls = Nulls.SKIP) public _FinalStage filterOpsResponseCode(Optional filterOpsResponseCode) { this.filterOpsResponseCode = filterOpsResponseCode; @@ -1161,7 +1161,7 @@ public _FinalStage filterOpsResponseCode(Optional filterOpsResponseCode *

Events with associated tags. If an event matches at least one tag, the event is returned. Comma-separated list. For example, "login, get".

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

Events with associated tags. If an event matches at least one tag, the event is returned. Comma-separated list. For example, "login, get".

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.tags", nulls = Nulls.SKIP) public _FinalStage filterOpsTags(Optional filterOpsTags) { this.filterOpsTags = filterOpsTags; @@ -1181,7 +1181,7 @@ public _FinalStage filterOpsTags(Optional filterOpsTags) { *

Resources with the specified type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filterOpsResourceType( AuditServiceListAuditEventsRequestFilterOpsResourceType filterOpsResourceType) { this.filterOpsResourceType = Optional.ofNullable(filterOpsResourceType); @@ -1191,7 +1191,7 @@ public _FinalStage filterOpsResourceType( /** *

Resources with the specified type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.resourceType", nulls = Nulls.SKIP) public _FinalStage filterOpsResourceType( Optional filterOpsResourceType) { @@ -1203,7 +1203,7 @@ public _FinalStage filterOpsResourceType( *

Events with the specified action type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filterOpsActionType( AuditServiceListAuditEventsRequestFilterOpsActionType filterOpsActionType) { this.filterOpsActionType = Optional.ofNullable(filterOpsActionType); @@ -1213,7 +1213,7 @@ public _FinalStage filterOpsActionType( /** *

Events with the specified action type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.actionType", nulls = Nulls.SKIP) public _FinalStage filterOpsActionType( Optional filterOpsActionType) { @@ -1225,7 +1225,7 @@ public _FinalStage filterOpsActionType( *

Resources with a specified ID. If a resource matches at least one ID, the associated event is returned. Format is a comma-separated list of "<resourceType>/<resourceID>". For example, "VAULT/12345, USER/67890".

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

Resources with a specified ID. If a resource matches at least one ID, the associated event is returned. Format is a comma-separated list of "<resourceType>/<resourceID>". For example, "VAULT/12345, USER/67890".

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.resourceIDs", nulls = Nulls.SKIP) public _FinalStage filterOpsResourceIDs(Optional filterOpsResourceIDs) { this.filterOpsResourceIDs = filterOpsResourceIDs; @@ -1245,7 +1245,7 @@ public _FinalStage filterOpsResourceIDs(Optional filterOpsResourceIDs) { *

Resources with the specified vault ID.

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

Resources with the specified vault ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.vaultID", nulls = Nulls.SKIP) public _FinalStage filterOpsVaultId(Optional filterOpsVaultId) { this.filterOpsVaultId = filterOpsVaultId; @@ -1265,7 +1265,7 @@ public _FinalStage filterOpsVaultId(Optional filterOpsVaultId) { *

Resources with the specified workspace ID.

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

Resources with the specified workspace ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.workspaceID", nulls = Nulls.SKIP) public _FinalStage filterOpsWorkspaceId(Optional filterOpsWorkspaceId) { this.filterOpsWorkspaceId = filterOpsWorkspaceId; @@ -1285,7 +1285,7 @@ public _FinalStage filterOpsWorkspaceId(Optional filterOpsWorkspaceId) { *

Resources with the specified parent account ID.

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

Resources with the specified parent account ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.parentAccountID", nulls = Nulls.SKIP) public _FinalStage filterOpsParentAccountId(Optional filterOpsParentAccountId) { this.filterOpsParentAccountId = filterOpsParentAccountId; @@ -1305,7 +1305,7 @@ public _FinalStage filterOpsParentAccountId(Optional filterOpsParentAcco *

Embedded User Context.

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

Embedded User Context.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.bearerTokenContextID", nulls = Nulls.SKIP) public _FinalStage filterOpsContextBearerTokenContextId(Optional filterOpsContextBearerTokenContextId) { this.filterOpsContextBearerTokenContextId = filterOpsContextBearerTokenContextId; @@ -1325,7 +1325,7 @@ public _FinalStage filterOpsContextBearerTokenContextId(Optional filterO *

ID of the JWT token.

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

ID of the JWT token.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.jwtID", nulls = Nulls.SKIP) public _FinalStage filterOpsContextJwtId(Optional filterOpsContextJwtId) { this.filterOpsContextJwtId = filterOpsContextJwtId; @@ -1345,7 +1345,7 @@ public _FinalStage filterOpsContextJwtId(Optional filterOpsContextJwtId) *

Authentication mode the actor used.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filterOpsContextAuthMode( AuditServiceListAuditEventsRequestFilterOpsContextAuthMode filterOpsContextAuthMode) { this.filterOpsContextAuthMode = Optional.ofNullable(filterOpsContextAuthMode); @@ -1355,7 +1355,7 @@ public _FinalStage filterOpsContextAuthMode( /** *

Authentication mode the actor used.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.authMode", nulls = Nulls.SKIP) public _FinalStage filterOpsContextAuthMode( Optional filterOpsContextAuthMode) { @@ -1367,7 +1367,7 @@ public _FinalStage filterOpsContextAuthMode( *

HTTP Origin request header (including scheme, hostname, and port) of the request.

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

HTTP Origin request header (including scheme, hostname, and port) of the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.origin", nulls = Nulls.SKIP) public _FinalStage filterOpsContextOrigin(Optional filterOpsContextOrigin) { this.filterOpsContextOrigin = filterOpsContextOrigin; @@ -1387,7 +1387,7 @@ public _FinalStage filterOpsContextOrigin(Optional filterOpsContextOrigi *

IP Address of the client that made the request.

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

IP Address of the client that made the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.ipAddress", nulls = Nulls.SKIP) public _FinalStage filterOpsContextIpAddress(Optional filterOpsContextIpAddress) { this.filterOpsContextIpAddress = filterOpsContextIpAddress; @@ -1407,7 +1407,7 @@ public _FinalStage filterOpsContextIpAddress(Optional filterOpsContextIp *

Type of access for the request.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filterOpsContextAccessType( AuditServiceListAuditEventsRequestFilterOpsContextAccessType filterOpsContextAccessType) { this.filterOpsContextAccessType = Optional.ofNullable(filterOpsContextAccessType); @@ -1417,7 +1417,7 @@ public _FinalStage filterOpsContextAccessType( /** *

Type of access for the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.accessType", nulls = Nulls.SKIP) public _FinalStage filterOpsContextAccessType( Optional filterOpsContextAccessType) { @@ -1429,7 +1429,7 @@ public _FinalStage filterOpsContextAccessType( *

Type of member who sent the request.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filterOpsContextActorType( AuditServiceListAuditEventsRequestFilterOpsContextActorType filterOpsContextActorType) { this.filterOpsContextActorType = Optional.ofNullable(filterOpsContextActorType); @@ -1439,7 +1439,7 @@ public _FinalStage filterOpsContextActorType( /** *

Type of member who sent the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.actorType", nulls = Nulls.SKIP) public _FinalStage filterOpsContextActorType( Optional filterOpsContextActorType) { @@ -1451,7 +1451,7 @@ public _FinalStage filterOpsContextActorType( *

Member who sent the request. Depending on actorType, this may be a user ID or a service account ID.

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

Member who sent the request. Depending on actorType, this may be a user ID or a service account ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.actor", nulls = Nulls.SKIP) public _FinalStage filterOpsContextActor(Optional filterOpsContextActor) { this.filterOpsContextActor = filterOpsContextActor; @@ -1471,7 +1471,7 @@ public _FinalStage filterOpsContextActor(Optional filterOpsContextActor) *

ID for the session in which the request was sent.

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

ID for the session in which the request was sent.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.sessionID", nulls = Nulls.SKIP) public _FinalStage filterOpsContextSessionId(Optional filterOpsContextSessionId) { this.filterOpsContextSessionId = filterOpsContextSessionId; @@ -1491,7 +1491,7 @@ public _FinalStage filterOpsContextSessionId(Optional filterOpsContextSe *

ID for the request set by the service that received the request.

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

ID for the request set by the service that received the request.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.traceID", nulls = Nulls.SKIP) public _FinalStage filterOpsContextTraceId(Optional filterOpsContextTraceId) { this.filterOpsContextTraceId = filterOpsContextTraceId; @@ -1511,7 +1511,7 @@ public _FinalStage filterOpsContextTraceId(Optional filterOpsContextTrac *

ID for the request that caused the event.

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

ID for the request that caused the event.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.requestID", nulls = Nulls.SKIP) public _FinalStage filterOpsContextRequestId(Optional filterOpsContextRequestId) { this.filterOpsContextRequestId = filterOpsContextRequestId; @@ -1531,7 +1531,7 @@ public _FinalStage filterOpsContextRequestId(Optional filterOpsContextRe *

ID for the audit event.

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

ID for the audit event.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filterOps.context.changeID", nulls = Nulls.SKIP) public _FinalStage filterOpsContextChangeId(Optional filterOpsContextChangeId) { this.filterOpsContextChangeId = filterOpsContextChangeId; return this; } - @java.lang.Override + @Override public AuditServiceListAuditEventsRequest build() { return new AuditServiceListAuditEventsRequest( filterOpsContextChangeId, diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsActionType.java b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsActionType.java index a9fb6d44..9611f8ab 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsActionType.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsActionType.java @@ -49,7 +49,7 @@ public enum AuditServiceListAuditEventsRequestFilterOpsActionType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAccessType.java b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAccessType.java index 0b082305..44ac80d9 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAccessType.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAccessType.java @@ -21,7 +21,7 @@ public enum AuditServiceListAuditEventsRequestFilterOpsContextAccessType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextActorType.java b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextActorType.java index 76a357f4..1948ea9c 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextActorType.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextActorType.java @@ -19,7 +19,7 @@ public enum AuditServiceListAuditEventsRequestFilterOpsContextActorType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAuthMode.java b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAuthMode.java index cfca2e35..82c375aa 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAuthMode.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsContextAuthMode.java @@ -21,7 +21,7 @@ public enum AuditServiceListAuditEventsRequestFilterOpsContextAuthMode { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsResourceType.java b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsResourceType.java index f5d2eafe..864213ec 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsResourceType.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestFilterOpsResourceType.java @@ -73,7 +73,7 @@ public enum AuditServiceListAuditEventsRequestFilterOpsResourceType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestSortOpsOrderBy.java b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestSortOpsOrderBy.java index 51fc2715..fe3f928e 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestSortOpsOrderBy.java +++ b/src/main/java/com/skyflow/generated/rest/resources/audit/types/AuditServiceListAuditEventsRequestSortOpsOrderBy.java @@ -17,7 +17,7 @@ public enum AuditServiceListAuditEventsRequestSortOpsOrderBy { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java b/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java index 8c4961b1..182952bc 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/authentication/requests/V1GetAuthTokenRequest.java @@ -100,7 +100,7 @@ public Optional getScope() { return scope; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1GetAuthTokenRequest && equalTo((V1GetAuthTokenRequest) other); @@ -120,7 +120,7 @@ private boolean equalTo(V1GetAuthTokenRequest other) { && scope.equals(other.scope); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.grantType, @@ -131,7 +131,7 @@ public int hashCode() { this.scope); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements GrantTypeStage, AssertionStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(V1GetAuthTokenRequest other) { grantType(other.getGrantType()); assertion(other.getAssertion()); @@ -222,7 +222,7 @@ public Builder from(V1GetAuthTokenRequest other) { * Grant type of the request. Set this to `urn:ietf:params:oauth:grant-type:jwt-bearer`.

Grant type of the request. Set this to urn:ietf:params:oauth:grant-type:jwt-bearer.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("grant_type") public AssertionStage grantType(@NotNull String grantType) { this.grantType = Objects.requireNonNull(grantType, "grantType must not be null"); @@ -233,7 +233,7 @@ public AssertionStage grantType(@NotNull String grantType) { * User-signed JWT token that contains the following fields:
  • iss: Issuer of the JWT.
  • key: Unique identifier for the key.
  • aud: Recipient the JWT is intended for.
  • exp: Time the JWT expires.
  • sub: Subject of the JWT.
  • ctx: (Optional) Value for Context-aware authorization.

User-signed JWT token that contains the following fields: <br/> <ul><li><code>iss</code>: Issuer of the JWT.</li><li><code>key</code>: Unique identifier for the key.</li><li><code>aud</code>: Recipient the JWT is intended for.</li><li><code>exp</code>: Time the JWT expires.</li><li><code>sub</code>: Subject of the JWT.</li><li><code>ctx</code>: (Optional) Value for <a href='/context-aware-overview/'>Context-aware authorization</a>.</li></ul>

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

Subset of available <a href='#Roles'>roles</a> to associate with the requested token. Uses the format "role:<roleID1> role:<roleID2>".

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

Subset of available <a href='#Roles'>roles</a> to associate with the requested token. Uses the format "role:<roleID1> role:<roleID2>".

*/ - @java.lang.Override + @Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) public _FinalStage scope(Optional scope) { this.scope = scope; @@ -264,7 +264,7 @@ public _FinalStage scope(Optional scope) { *

Token use type. Either delegation or impersonation.

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

Token use type. Either delegation or impersonation.

*/ - @java.lang.Override + @Override @JsonSetter(value = "requested_token_use", nulls = Nulls.SKIP) public _FinalStage requestedTokenUse(Optional requestedTokenUse) { this.requestedTokenUse = requestedTokenUse; @@ -284,7 +284,7 @@ public _FinalStage requestedTokenUse(Optional requestedTokenUse) { *

Subject token type.

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

Subject token type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject_token_type", nulls = Nulls.SKIP) public _FinalStage subjectTokenType(Optional subjectTokenType) { this.subjectTokenType = subjectTokenType; @@ -304,7 +304,7 @@ public _FinalStage subjectTokenType(Optional subjectTokenType) { *

Subject token.

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

Subject token.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject_token", nulls = Nulls.SKIP) public _FinalStage subjectToken(Optional subjectToken) { this.subjectToken = subjectToken; return this; } - @java.lang.Override + @Override public V1GetAuthTokenRequest build() { return new V1GetAuthTokenRequest( grantType, diff --git a/src/main/java/com/skyflow/generated/rest/resources/binlookup/requests/V1BinListRequest.java b/src/main/java/com/skyflow/generated/rest/resources/binlookup/requests/V1BinListRequest.java index d4a1c21b..af827e01 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/binlookup/requests/V1BinListRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/binlookup/requests/V1BinListRequest.java @@ -74,7 +74,7 @@ public Optional getSkyflowId() { return skyflowId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1BinListRequest && equalTo((V1BinListRequest) other); @@ -92,12 +92,12 @@ private boolean equalTo(V1BinListRequest other) { && skyflowId.equals(other.skyflowId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.bin, this.vaultSchemaConfig, this.skyflowId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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..fddcb445 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. */ @@ -172,7 +181,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyAudioRequest && equalTo((DeidentifyAudioRequest) other); @@ -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) @@ -199,11 +209,12 @@ private boolean equalTo(DeidentifyAudioRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.outputProcessedAudio, this.outputTranscription, this.bleepGain, @@ -217,7 +228,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +348,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyAudioRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); outputProcessedAudio(other.getOutputProcessedAudio()); outputTranscription(other.getOutputTranscription()); bleepGain(other.getBleepGain()); @@ -356,7 +374,7 @@ public Builder from(DeidentifyAudioRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -367,72 +385,72 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyAudioRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; @@ -443,7 +461,7 @@ public _FinalStage entityTypes(Optional> entityTypes) { *

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage bleepStopPadding(Double bleepStopPadding) { this.bleepStopPadding = Optional.ofNullable(bleepStopPadding); return this; @@ -452,7 +470,7 @@ public _FinalStage bleepStopPadding(Double bleepStopPadding) { /** *

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

*/ - @java.lang.Override + @Override @JsonSetter(value = "bleep_stop_padding", nulls = Nulls.SKIP) public _FinalStage bleepStopPadding(Optional bleepStopPadding) { this.bleepStopPadding = bleepStopPadding; @@ -463,7 +481,7 @@ public _FinalStage bleepStopPadding(Optional bleepStopPadding) { *

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage bleepStartPadding(Double bleepStartPadding) { this.bleepStartPadding = Optional.ofNullable(bleepStartPadding); return this; @@ -472,7 +490,7 @@ public _FinalStage bleepStartPadding(Double bleepStartPadding) { /** *

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

*/ - @java.lang.Override + @Override @JsonSetter(value = "bleep_start_padding", nulls = Nulls.SKIP) public _FinalStage bleepStartPadding(Optional bleepStartPadding) { this.bleepStartPadding = bleepStartPadding; @@ -483,7 +501,7 @@ public _FinalStage bleepStartPadding(Optional bleepStartPadding) { *

The pitch of the bleep sound, in Hz. The higher the number, the higher the pitch.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage bleepFrequency(Double bleepFrequency) { this.bleepFrequency = Optional.ofNullable(bleepFrequency); return this; @@ -492,7 +510,7 @@ public _FinalStage bleepFrequency(Double bleepFrequency) { /** *

The pitch of the bleep sound, in Hz. The higher the number, the higher the pitch.

*/ - @java.lang.Override + @Override @JsonSetter(value = "bleep_frequency", nulls = Nulls.SKIP) public _FinalStage bleepFrequency(Optional bleepFrequency) { this.bleepFrequency = bleepFrequency; @@ -503,7 +521,7 @@ public _FinalStage bleepFrequency(Optional bleepFrequency) { *

Relative loudness of the bleep in dB. Positive values increase its loudness, and negative values decrease it.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage bleepGain(Double bleepGain) { this.bleepGain = Optional.ofNullable(bleepGain); return this; @@ -512,7 +530,7 @@ public _FinalStage bleepGain(Double bleepGain) { /** *

Relative loudness of the bleep in dB. Positive values increase its loudness, and negative values decrease it.

*/ - @java.lang.Override + @Override @JsonSetter(value = "bleep_gain", nulls = Nulls.SKIP) public _FinalStage bleepGain(Optional bleepGain) { this.bleepGain = bleepGain; @@ -523,7 +541,7 @@ public _FinalStage bleepGain(Optional bleepGain) { *

Type of transcription to output.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage outputTranscription(DeidentifyAudioRequestOutputTranscription outputTranscription) { this.outputTranscription = Optional.ofNullable(outputTranscription); return this; @@ -532,7 +550,7 @@ public _FinalStage outputTranscription(DeidentifyAudioRequestOutputTranscription /** *

Type of transcription to output.

*/ - @java.lang.Override + @Override @JsonSetter(value = "output_transcription", nulls = Nulls.SKIP) public _FinalStage outputTranscription( Optional outputTranscription) { @@ -544,7 +562,7 @@ public _FinalStage outputTranscription( *

If true, includes processed audio file in the response.

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

If true, includes processed audio file in the response.

*/ - @java.lang.Override + @Override @JsonSetter(value = "output_processed_audio", nulls = Nulls.SKIP) public _FinalStage outputProcessedAudio(Optional outputProcessedAudio) { this.outputProcessedAudio = outputProcessedAudio; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..cd2cd7f6 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; @@ -99,7 +108,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyDocumentRequest && equalTo((DeidentifyDocumentRequest) other); @@ -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) @@ -120,11 +130,12 @@ private boolean equalTo(DeidentifyDocumentRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -132,7 +143,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +209,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyDocumentRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -211,7 +229,7 @@ public Builder from(DeidentifyDocumentRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -222,83 +240,97 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyDocumentRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..08f642dd 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; @@ -99,7 +108,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyFileRequest && equalTo((DeidentifyFileRequest) other); @@ -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) @@ -120,11 +130,12 @@ private boolean equalTo(DeidentifyFileRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -132,7 +143,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +209,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyFileRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -211,7 +229,7 @@ public Builder from(DeidentifyFileRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -222,83 +240,97 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyFileRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..e113a437 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. */ @@ -136,7 +145,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyImageRequest && equalTo((DeidentifyImageRequest) other); @@ -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) @@ -160,11 +170,12 @@ private boolean equalTo(DeidentifyImageRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.outputProcessedImage, this.outputOcrText, this.maskingMethod, @@ -175,7 +186,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +279,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyImageRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); outputProcessedImage(other.getOutputProcessedImage()); outputOcrText(other.getOutputOcrText()); maskingMethod(other.getMaskingMethod()); @@ -284,7 +302,7 @@ public Builder from(DeidentifyImageRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -295,72 +313,72 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyImageRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; @@ -371,7 +389,7 @@ public _FinalStage entityTypes(Optional> entityTypes) { *

Method to mask the entities in the image.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage maskingMethod(DeidentifyImageRequestMaskingMethod maskingMethod) { this.maskingMethod = Optional.ofNullable(maskingMethod); return this; @@ -380,7 +398,7 @@ public _FinalStage maskingMethod(DeidentifyImageRequestMaskingMethod maskingMeth /** *

Method to mask the entities in the image.

*/ - @java.lang.Override + @Override @JsonSetter(value = "masking_method", nulls = Nulls.SKIP) public _FinalStage maskingMethod(Optional maskingMethod) { this.maskingMethod = maskingMethod; @@ -391,7 +409,7 @@ public _FinalStage maskingMethod(Optional m *

If true, includes OCR text output in the response.

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

If true, includes OCR text output in the response.

*/ - @java.lang.Override + @Override @JsonSetter(value = "output_ocr_text", nulls = Nulls.SKIP) public _FinalStage outputOcrText(Optional outputOcrText) { this.outputOcrText = outputOcrText; @@ -411,7 +429,7 @@ public _FinalStage outputOcrText(Optional outputOcrText) { *

If true, includes processed image in the output.

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

If true, includes processed image in the output.

*/ - @java.lang.Override + @Override @JsonSetter(value = "output_processed_image", nulls = Nulls.SKIP) public _FinalStage outputProcessedImage(Optional outputProcessedImage) { this.outputProcessedImage = outputProcessedImage; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..0ce2a1e4 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,9 +30,11 @@ public final class DeidentifyPdfRequest { private final DeidentifyPdfRequestFile file; - private final Optional density; + private final Optional configurationId; - private final Optional maxResolution; + private final Optional density; + + private final Optional maxResolution; private final Optional> entityTypes; @@ -49,8 +51,9 @@ public final class DeidentifyPdfRequest { private DeidentifyPdfRequest( String vaultId, DeidentifyPdfRequestFile file, - Optional density, - Optional maxResolution, + Optional configurationId, + Optional density, + Optional maxResolution, Optional> entityTypes, Optional tokenType, Optional> allowRegex, @@ -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,11 +86,16 @@ public DeidentifyPdfRequestFile getFile() { return file; } + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + /** * @return Pixel density at which to process the PDF file. */ @JsonProperty("density") - public Optional getDensity() { + public Optional getDensity() { return density; } @@ -94,7 +103,7 @@ public Optional getDensity() { * @return Max resolution at which to process the PDF file. */ @JsonProperty("max_resolution") - public Optional getMaxResolution() { + public Optional getMaxResolution() { return maxResolution; } @@ -123,7 +132,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyPdfRequest && equalTo((DeidentifyPdfRequest) other); @@ -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) @@ -146,11 +156,12 @@ private boolean equalTo(DeidentifyPdfRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.density, this.maxResolution, this.entityTypes, @@ -160,7 +171,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -185,19 +196,23 @@ 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.

*/ - _FinalStage density(Optional density); + _FinalStage density(Optional density); - _FinalStage density(Integer density); + _FinalStage density(Double density); /** *

Max resolution at which to process the PDF file.

*/ - _FinalStage maxResolution(Optional maxResolution); + _FinalStage maxResolution(Optional maxResolution); - _FinalStage maxResolution(Integer maxResolution); + _FinalStage maxResolution(Double maxResolution); _FinalStage entityTypes(Optional> entityTypes); @@ -236,19 +251,22 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> entityTypes = Optional.empty(); - private Optional maxResolution = Optional.empty(); + private Optional maxResolution = Optional.empty(); + + private Optional density = Optional.empty(); - private Optional density = Optional.empty(); + private Optional configurationId = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyPdfRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); density(other.getDensity()); maxResolution(other.getMaxResolution()); entityTypes(other.getEntityTypes()); @@ -259,7 +277,7 @@ public Builder from(DeidentifyPdfRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -270,72 +288,72 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyPdfRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; @@ -346,8 +364,8 @@ public _FinalStage entityTypes(Optional> entityTypes) { *

Max resolution at which to process the PDF file.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage maxResolution(Integer maxResolution) { + @Override + public _FinalStage maxResolution(Double maxResolution) { this.maxResolution = Optional.ofNullable(maxResolution); return this; } @@ -355,9 +373,9 @@ public _FinalStage maxResolution(Integer maxResolution) { /** *

Max resolution at which to process the PDF file.

*/ - @java.lang.Override + @Override @JsonSetter(value = "max_resolution", nulls = Nulls.SKIP) - public _FinalStage maxResolution(Optional maxResolution) { + public _FinalStage maxResolution(Optional maxResolution) { this.maxResolution = maxResolution; return this; } @@ -366,8 +384,8 @@ public _FinalStage maxResolution(Optional maxResolution) { *

Pixel density at which to process the PDF file.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage density(Integer density) { + @Override + public _FinalStage density(Double density) { this.density = Optional.ofNullable(density); return this; } @@ -375,18 +393,32 @@ public _FinalStage density(Integer density) { /** *

Pixel density at which to process the PDF file.

*/ - @java.lang.Override + @Override @JsonSetter(value = "density", nulls = Nulls.SKIP) - public _FinalStage density(Optional density) { + public _FinalStage density(Optional density) { this.density = density; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..c2ebbb6c 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; @@ -99,7 +108,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyPresentationRequest && equalTo((DeidentifyPresentationRequest) other); @@ -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) @@ -120,11 +130,12 @@ private boolean equalTo(DeidentifyPresentationRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -132,7 +143,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +209,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyPresentationRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -211,7 +229,7 @@ public Builder from(DeidentifyPresentationRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -222,83 +240,97 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyPresentationRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..d5ec413c 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; @@ -99,7 +108,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifySpreadsheetRequest && equalTo((DeidentifySpreadsheetRequest) other); @@ -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) @@ -120,11 +130,12 @@ private boolean equalTo(DeidentifySpreadsheetRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -132,7 +143,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +209,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifySpreadsheetRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -211,7 +229,7 @@ public Builder from(DeidentifySpreadsheetRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -222,83 +240,97 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifySpreadsheetRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..0fca98a5 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; @@ -99,7 +108,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyStructuredTextRequest && equalTo((DeidentifyStructuredTextRequest) other); @@ -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) @@ -120,11 +130,12 @@ private boolean equalTo(DeidentifyStructuredTextRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -132,7 +143,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +209,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyStructuredTextRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -211,7 +229,7 @@ public Builder from(DeidentifyStructuredTextRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -222,83 +240,97 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyStructuredTextRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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..ba671082 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; @@ -99,7 +108,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyTextRequest && equalTo((DeidentifyTextRequest) other); @@ -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) @@ -120,11 +130,12 @@ private boolean equalTo(DeidentifyTextRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.file, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -132,7 +143,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +209,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyTextRequest other) { vaultId(other.getVaultId()); file(other.getFile()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -211,7 +229,7 @@ public Builder from(DeidentifyTextRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public FileStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -222,83 +240,97 @@ public FileStage vaultId(@NotNull String vaultId) { * File to de-identify. Files are specified as Base64-encoded data.

File to de-identify. Files are specified as Base64-encoded data.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("file") public _FinalStage file(@NotNull DeidentifyTextRequestFile file) { this.file = Objects.requireNonNull(file, "file must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @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/GetRunRequest.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/GetRunRequest.java index 390d2090..c1a4051c 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/GetRunRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/GetRunRequest.java @@ -36,7 +36,7 @@ public String getVaultId() { return vaultId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRunRequest && equalTo((GetRunRequest) other); @@ -51,12 +51,12 @@ private boolean equalTo(GetRunRequest other) { return vaultId.equals(other.vaultId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.vaultId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements VaultIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(GetRunRequest other) { vaultId(other.getVaultId()); return this; @@ -97,14 +97,14 @@ public Builder from(GetRunRequest other) { * ID of the vault.

ID of the vault.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @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 + @Override public GetRunRequest build() { return new GetRunRequest(vaultId, additionalProperties); } 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..6f5f7e93 --- /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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.vaultId, this.file, this.format); + } + + @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() {} + + @Override + public Builder from(ReidentifyFileRequest other) { + vaultId(other.getVaultId()); + file(other.getFile()); + format(other.getFormat()); + return this; + } + + @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. + */ + @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. + */ + @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.

+ */ + @Override + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public _FinalStage format(Optional format) { + this.format = format; + return this; + } + + @Override + public ReidentifyFileRequest build() { + return new ReidentifyFileRequest(vaultId, file, format, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java index ad124de0..e45ced48 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java @@ -48,7 +48,7 @@ public DeidentifyAudioRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyAudioRequestFile && equalTo((DeidentifyAudioRequestFile) other); @@ -63,12 +63,12 @@ private boolean equalTo(DeidentifyAudioRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyAudioRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -119,7 +119,7 @@ public Builder from(DeidentifyAudioRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -130,14 +130,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifyAudioRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyAudioRequestFile build() { return new DeidentifyAudioRequestFile(base64, dataFormat, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFileDataFormat.java index 05203b05..1a9ac79a 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFileDataFormat.java @@ -17,7 +17,7 @@ public enum DeidentifyAudioRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestOutputTranscription.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestOutputTranscription.java index bd2d8aac..728e3d77 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestOutputTranscription.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestOutputTranscription.java @@ -23,7 +23,7 @@ public enum DeidentifyAudioRequestOutputTranscription { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFile.java index 76c7972c..1bdeb84a 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFile.java @@ -50,7 +50,7 @@ public DeidentifyDocumentRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyDocumentRequestFile && equalTo((DeidentifyDocumentRequestFile) other); @@ -65,12 +65,12 @@ private boolean equalTo(DeidentifyDocumentRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyDocumentRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -121,7 +121,7 @@ public Builder from(DeidentifyDocumentRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -132,14 +132,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifyDocumentRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyDocumentRequestFile build() { return new DeidentifyDocumentRequestFile(base64, dataFormat, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFileDataFormat.java index 6b741b95..ea1e0930 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFileDataFormat.java @@ -19,7 +19,7 @@ public enum DeidentifyDocumentRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java index f21ddeef..08e0bbb1 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java @@ -48,7 +48,7 @@ public DeidentifyFileRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyFileRequestFile && equalTo((DeidentifyFileRequestFile) other); @@ -63,12 +63,12 @@ private boolean equalTo(DeidentifyFileRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyFileRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -119,7 +119,7 @@ public Builder from(DeidentifyFileRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -130,14 +130,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifyFileRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyFileRequestFile build() { return new DeidentifyFileRequestFile(base64, dataFormat, 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..1ad893ef 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"), @@ -51,7 +53,7 @@ public enum DeidentifyFileRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java index 116fd94d..89a54aaf 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java @@ -48,7 +48,7 @@ public DeidentifyImageRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyImageRequestFile && equalTo((DeidentifyImageRequestFile) other); @@ -63,12 +63,12 @@ private boolean equalTo(DeidentifyImageRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyImageRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -119,7 +119,7 @@ public Builder from(DeidentifyImageRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -130,14 +130,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifyImageRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyImageRequestFile build() { return new DeidentifyImageRequestFile(base64, dataFormat, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFileDataFormat.java index cfb324d9..27e241d6 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFileDataFormat.java @@ -25,7 +25,7 @@ public enum DeidentifyImageRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestMaskingMethod.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestMaskingMethod.java index 8cf5bf3c..e4a0fd19 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestMaskingMethod.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestMaskingMethod.java @@ -17,7 +17,7 @@ public enum DeidentifyImageRequestMaskingMethod { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java index 14028aab..1d9bb8d9 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java @@ -44,7 +44,7 @@ public String getDataFormat() { return "pdf"; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyPdfRequestFile && equalTo((DeidentifyPdfRequestFile) other); @@ -59,12 +59,12 @@ private boolean equalTo(DeidentifyPdfRequestFile other) { return base64.equals(other.base64); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,7 +95,7 @@ public static final class Builder implements Base64Stage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyPdfRequestFile other) { base64(other.getBase64()); return this; @@ -105,14 +105,14 @@ public Builder from(DeidentifyPdfRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public _FinalStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyPdfRequestFile build() { return new DeidentifyPdfRequestFile(base64, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFile.java index 1b2e247f..60a013ce 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFile.java @@ -50,7 +50,7 @@ public DeidentifyPresentationRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyPresentationRequestFile && equalTo((DeidentifyPresentationRequestFile) other); @@ -65,12 +65,12 @@ private boolean equalTo(DeidentifyPresentationRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyPresentationRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -121,7 +121,7 @@ public Builder from(DeidentifyPresentationRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -132,14 +132,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifyPresentationRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyPresentationRequestFile build() { return new DeidentifyPresentationRequestFile(base64, dataFormat, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFileDataFormat.java index e6bcd268..7770a61e 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFileDataFormat.java @@ -17,7 +17,7 @@ public enum DeidentifyPresentationRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java index 2e291563..b749ebe0 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java @@ -50,7 +50,7 @@ public DeidentifySpreadsheetRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifySpreadsheetRequestFile && equalTo((DeidentifySpreadsheetRequestFile) other); @@ -65,12 +65,12 @@ private boolean equalTo(DeidentifySpreadsheetRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifySpreadsheetRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -121,7 +121,7 @@ public Builder from(DeidentifySpreadsheetRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -132,14 +132,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifySpreadsheetRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifySpreadsheetRequestFile build() { return new DeidentifySpreadsheetRequestFile(base64, dataFormat, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFileDataFormat.java index 795a2666..c44e4fb2 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFileDataFormat.java @@ -19,7 +19,7 @@ public enum DeidentifySpreadsheetRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFile.java index d8d5193a..14b34a29 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFile.java @@ -50,7 +50,7 @@ public DeidentifyStructuredTextRequestFileDataFormat getDataFormat() { return dataFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyStructuredTextRequestFile @@ -66,12 +66,12 @@ private boolean equalTo(DeidentifyStructuredTextRequestFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64, this.dataFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyStructuredTextRequestFile other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); @@ -122,7 +122,7 @@ public Builder from(DeidentifyStructuredTextRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public DataFormatStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); @@ -133,14 +133,14 @@ public DataFormatStage base64(@NotNull String base64) { * 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 + @Override @JsonSetter("data_format") public _FinalStage dataFormat(@NotNull DeidentifyStructuredTextRequestFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyStructuredTextRequestFile build() { return new DeidentifyStructuredTextRequestFile(base64, dataFormat, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFileDataFormat.java index 11b30288..8182b567 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFileDataFormat.java @@ -17,7 +17,7 @@ public enum DeidentifyStructuredTextRequestFileDataFormat { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyTextRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyTextRequestFile.java index c7cbc5b3..953a9075 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyTextRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyTextRequestFile.java @@ -44,7 +44,7 @@ public String getDataFormat() { return "txt"; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyTextRequestFile && equalTo((DeidentifyTextRequestFile) other); @@ -59,12 +59,12 @@ private boolean equalTo(DeidentifyTextRequestFile other) { return base64.equals(other.base64); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.base64); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,7 +95,7 @@ public static final class Builder implements Base64Stage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyTextRequestFile other) { base64(other.getBase64()); return this; @@ -105,14 +105,14 @@ public Builder from(DeidentifyTextRequestFile other) { * Base64-encoded data of the file to de-identify.

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

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("base64") public _FinalStage base64(@NotNull String base64) { this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyTextRequestFile build() { return new DeidentifyTextRequestFile(base64, additionalProperties); } 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..51ac25a8 --- /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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.base64, this.dataFormat); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + @JsonSetter("data_format") + public _FinalStage dataFormat(@NotNull ReidentifyFileRequestFileDataFormat dataFormat) { + this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); + return this; + } + + @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 50% 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..bd8e6718 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,57 +1,35 @@ /** * 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; } @JsonValue - @java.lang.Override + @Override public String toString() { return this.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..e54b35fc --- /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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.redacted, this.masked, this.plaintext); + } + + @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..d5d1178e --- /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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.vaultId, this.text, this.checkToxicity, this.denyTopics); + } + + @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() {} + + @Override + public Builder from(CheckGuardrailsRequest other) { + vaultId(other.getVaultId()); + text(other.getText()); + checkToxicity(other.getCheckToxicity()); + denyTopics(other.getDenyTopics()); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage denyTopics(List denyTopics) { + this.denyTopics = Optional.ofNullable(denyTopics); + return this; + } + + /** + *

List of topics to deny.

+ */ + @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. + */ + @Override + public _FinalStage checkToxicity(Boolean checkToxicity) { + this.checkToxicity = Optional.ofNullable(checkToxicity); + return this; + } + + /** + *

Check for toxicity in the text.

+ */ + @Override + @JsonSetter(value = "check_toxicity", nulls = Nulls.SKIP) + public _FinalStage checkToxicity(Optional checkToxicity) { + this.checkToxicity = checkToxicity; + return this; + } + + @Override + public CheckGuardrailsRequest build() { + return new CheckGuardrailsRequest(vaultId, text, checkToxicity, denyTopics, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/query/requests/QueryServiceExecuteQueryBody.java b/src/main/java/com/skyflow/generated/rest/resources/query/requests/QueryServiceExecuteQueryBody.java index dfa21d15..60565eb5 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/query/requests/QueryServiceExecuteQueryBody.java +++ b/src/main/java/com/skyflow/generated/rest/resources/query/requests/QueryServiceExecuteQueryBody.java @@ -37,7 +37,7 @@ public Optional getQuery() { return query; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof QueryServiceExecuteQueryBody && equalTo((QueryServiceExecuteQueryBody) other); @@ -52,12 +52,12 @@ private boolean equalTo(QueryServiceExecuteQueryBody other) { return query.equals(other.query); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.query); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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..fe805970 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; } - @java.lang.Override + /** + * @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; + } + + @Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof FileServiceUploadFileRequest; + return other instanceof FileServiceUploadFileRequest && equalTo((FileServiceUploadFileRequest) other); } @JsonAnyGetter @@ -32,7 +48,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @java.lang.Override + private boolean equalTo(FileServiceUploadFileRequest other) { + return columnName.equals(other.columnName); + } + + @Override + public int hashCode() { + return Objects.hash(this.columnName); + } + + @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/records/requests/RecordServiceBatchOperationBody.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBatchOperationBody.java index 33b92483..48586839 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBatchOperationBody.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBatchOperationBody.java @@ -63,7 +63,7 @@ public Optional getByot() { return byot; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RecordServiceBatchOperationBody && equalTo((RecordServiceBatchOperationBody) other); @@ -80,12 +80,12 @@ private boolean equalTo(RecordServiceBatchOperationBody other) { && byot.equals(other.byot); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records, this.continueOnError, this.byot); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkDeleteRecordBody.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkDeleteRecordBody.java index b2c991f9..b417adbb 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkDeleteRecordBody.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkDeleteRecordBody.java @@ -39,7 +39,7 @@ public Optional> getSkyflowIds() { return skyflowIds; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RecordServiceBulkDeleteRecordBody && equalTo((RecordServiceBulkDeleteRecordBody) other); @@ -54,12 +54,12 @@ private boolean equalTo(RecordServiceBulkDeleteRecordBody other) { return skyflowIds.equals(other.skyflowIds); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.skyflowIds); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkGetRecordRequest.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkGetRecordRequest.java index f8cccf09..22c9090c 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkGetRecordRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceBulkGetRecordRequest.java @@ -151,7 +151,7 @@ public Optional getOrderBy() { return orderBy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RecordServiceBulkGetRecordRequest && equalTo((RecordServiceBulkGetRecordRequest) other); @@ -175,7 +175,7 @@ private boolean equalTo(RecordServiceBulkGetRecordRequest other) { && orderBy.equals(other.orderBy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.skyflowIds, @@ -190,7 +190,7 @@ public int hashCode() { this.orderBy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceGetRecordRequest.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceGetRecordRequest.java index 0fa5319d..eef17665 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceGetRecordRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceGetRecordRequest.java @@ -78,7 +78,7 @@ public Optional getDownloadUrl() { return downloadUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RecordServiceGetRecordRequest && equalTo((RecordServiceGetRecordRequest) other); @@ -96,12 +96,12 @@ private boolean equalTo(RecordServiceGetRecordRequest other) { && downloadUrl.equals(other.downloadUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.redaction, this.tokenization, this.downloadUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceInsertRecordBody.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceInsertRecordBody.java index 4ac78692..e1de00f7 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceInsertRecordBody.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceInsertRecordBody.java @@ -87,7 +87,7 @@ public Optional getByot() { return byot; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RecordServiceInsertRecordBody && equalTo((RecordServiceInsertRecordBody) other); @@ -106,12 +106,12 @@ private boolean equalTo(RecordServiceInsertRecordBody other) { && byot.equals(other.byot); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records, this.tokenization, this.upsert, this.homogeneous, this.byot); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceUpdateRecordBody.java b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceUpdateRecordBody.java index 19e0ae23..e52af2e4 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceUpdateRecordBody.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/requests/RecordServiceUpdateRecordBody.java @@ -59,7 +59,7 @@ public Optional getByot() { return byot; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RecordServiceUpdateRecordBody && equalTo((RecordServiceUpdateRecordBody) other); @@ -74,12 +74,12 @@ private boolean equalTo(RecordServiceUpdateRecordBody other) { return record.equals(other.record) && tokenization.equals(other.tokenization) && byot.equals(other.byot); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.record, this.tokenization, this.byot); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestOrderBy.java b/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestOrderBy.java index 2563652f..1f25b38d 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestOrderBy.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestOrderBy.java @@ -19,7 +19,7 @@ public enum RecordServiceBulkGetRecordRequestOrderBy { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestRedaction.java b/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestRedaction.java index b20f2541..12bbc291 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestRedaction.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceBulkGetRecordRequestRedaction.java @@ -21,7 +21,7 @@ public enum RecordServiceBulkGetRecordRequestRedaction { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceGetRecordRequestRedaction.java b/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceGetRecordRequestRedaction.java index 468e3edd..4f546262 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceGetRecordRequestRedaction.java +++ b/src/main/java/com/skyflow/generated/rest/resources/records/types/RecordServiceGetRecordRequestRedaction.java @@ -21,7 +21,7 @@ public enum RecordServiceGetRecordRequestRedaction { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } 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..ec42384d 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; @@ -98,7 +107,7 @@ public Optional getTransformations() { return transformations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyStringRequest && equalTo((DeidentifyStringRequest) other); @@ -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) @@ -119,11 +129,12 @@ private boolean equalTo(DeidentifyStringRequest other) { && transformations.equals(other.transformations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.vaultId, this.text, + this.configurationId, this.entityTypes, this.tokenType, this.allowRegex, @@ -131,7 +142,7 @@ public int hashCode() { this.transformations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -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,15 +208,18 @@ 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<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyStringRequest other) { vaultId(other.getVaultId()); text(other.getText()); + configurationId(other.getConfigurationId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); @@ -210,7 +228,7 @@ public Builder from(DeidentifyStringRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("vault_id") public TextStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); @@ -221,83 +239,97 @@ public TextStage vaultId(@NotNull String vaultId) { * String to de-identify.

String to de-identify.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage transformations(Transformations transformations) { this.transformations = Optional.ofNullable(transformations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "transformations", nulls = Nulls.SKIP) public _FinalStage transformations(Optional transformations) { this.transformations = transformations; return this; } - @java.lang.Override + @Override public _FinalStage restrictRegex(List restrictRegex) { this.restrictRegex = Optional.ofNullable(restrictRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) public _FinalStage restrictRegex(Optional> restrictRegex) { this.restrictRegex = restrictRegex; return this; } - @java.lang.Override + @Override public _FinalStage allowRegex(List allowRegex) { this.allowRegex = Optional.ofNullable(allowRegex); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { this.allowRegex = allowRegex; return this; } - @java.lang.Override + @Override public _FinalStage tokenType(TokenType tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override + @Override public _FinalStage entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override + @Override + public _FinalStage configurationId(String configurationId) { + this.configurationId = Optional.ofNullable(configurationId); + return this; + } + + @Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @Override public DeidentifyStringRequest build() { return new DeidentifyStringRequest( vaultId, text, + configurationId, entityTypes, tokenType, allowRegex, diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/requests/ReidentifyStringRequest.java b/src/main/java/com/skyflow/generated/rest/resources/strings/requests/ReidentifyStringRequest.java index e61cb5a2..e18b2169 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/requests/ReidentifyStringRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/requests/ReidentifyStringRequest.java @@ -65,7 +65,7 @@ public Optional getFormat() { return format; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ReidentifyStringRequest && equalTo((ReidentifyStringRequest) other); @@ -80,12 +80,12 @@ private boolean equalTo(ReidentifyStringRequest other) { return text.equals(other.text) && vaultId.equals(other.vaultId) && format.equals(other.format); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text, this.vaultId, this.format); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements TextStage, VaultIdStage, _FinalStag private Builder() {} - @java.lang.Override + @Override public Builder from(ReidentifyStringRequest other) { text(other.getText()); vaultId(other.getVaultId()); @@ -146,7 +146,7 @@ public Builder from(ReidentifyStringRequest other) { * String to re-identify.

String to re-identify.

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

ID of the vault where the entities are stored.

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

Mapping of perferred 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 + @Override public _FinalStage format(ReidentifyStringRequestFormat format) { this.format = Optional.ofNullable(format); return this; @@ -177,14 +177,14 @@ public _FinalStage format(ReidentifyStringRequestFormat format) { /** *

Mapping of perferred 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 + @Override @JsonSetter(value = "format", nulls = Nulls.SKIP) public _FinalStage format(Optional format) { this.format = format; return this; } - @java.lang.Override + @Override public ReidentifyStringRequest build() { return new ReidentifyStringRequest(text, vaultId, format, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/types/ReidentifyStringRequestFormat.java b/src/main/java/com/skyflow/generated/rest/resources/strings/types/ReidentifyStringRequestFormat.java index 68c5209f..748cc2f6 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/types/ReidentifyStringRequestFormat.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/types/ReidentifyStringRequestFormat.java @@ -65,7 +65,7 @@ public Optional> getPlaintext() { return plaintext; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ReidentifyStringRequestFormat && equalTo((ReidentifyStringRequestFormat) other); @@ -80,12 +80,12 @@ private boolean equalTo(ReidentifyStringRequestFormat other) { return redacted.equals(other.redacted) && masked.equals(other.masked) && plaintext.equals(other.plaintext); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.redacted, this.masked, this.plaintext); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1DetokenizePayload.java b/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1DetokenizePayload.java index 1d3cb407..59318aa8 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1DetokenizePayload.java +++ b/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1DetokenizePayload.java @@ -65,7 +65,7 @@ public Optional getContinueOnError() { return continueOnError; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1DetokenizePayload && equalTo((V1DetokenizePayload) other); @@ -82,12 +82,12 @@ private boolean equalTo(V1DetokenizePayload other) { && continueOnError.equals(other.continueOnError); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.detokenizationParameters, this.downloadUrl, this.continueOnError); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1TokenizePayload.java b/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1TokenizePayload.java index 30bdde6a..9729023e 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1TokenizePayload.java +++ b/src/main/java/com/skyflow/generated/rest/resources/tokens/requests/V1TokenizePayload.java @@ -40,7 +40,7 @@ public Optional> getTokenizationParameters() { return tokenizationParameters; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1TokenizePayload && equalTo((V1TokenizePayload) other); @@ -55,12 +55,12 @@ private boolean equalTo(V1TokenizePayload other) { return tokenizationParameters.equals(other.tokenizationParameters); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.tokenizationParameters); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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/AuditEventAuditResourceType.java b/src/main/java/com/skyflow/generated/rest/types/AuditEventAuditResourceType.java index 4264996a..d16caf10 100644 --- a/src/main/java/com/skyflow/generated/rest/types/AuditEventAuditResourceType.java +++ b/src/main/java/com/skyflow/generated/rest/types/AuditEventAuditResourceType.java @@ -73,7 +73,7 @@ public enum AuditEventAuditResourceType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/AuditEventContext.java b/src/main/java/com/skyflow/generated/rest/types/AuditEventContext.java index 2a5c104a..210f96c0 100644 --- a/src/main/java/com/skyflow/generated/rest/types/AuditEventContext.java +++ b/src/main/java/com/skyflow/generated/rest/types/AuditEventContext.java @@ -162,7 +162,7 @@ public Optional getBearerTokenContextId() { return bearerTokenContextId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AuditEventContext && equalTo((AuditEventContext) other); @@ -188,7 +188,7 @@ private boolean equalTo(AuditEventContext other) { && bearerTokenContextId.equals(other.bearerTokenContextId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.changeId, @@ -205,7 +205,7 @@ public int hashCode() { this.bearerTokenContextId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/AuditEventData.java b/src/main/java/com/skyflow/generated/rest/types/AuditEventData.java index 45d15be1..e2028fba 100644 --- a/src/main/java/com/skyflow/generated/rest/types/AuditEventData.java +++ b/src/main/java/com/skyflow/generated/rest/types/AuditEventData.java @@ -37,7 +37,7 @@ public Optional getContent() { return content; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AuditEventData && equalTo((AuditEventData) other); @@ -52,12 +52,12 @@ private boolean equalTo(AuditEventData other) { return content.equals(other.content); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.content); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/AuditEventHttpInfo.java b/src/main/java/com/skyflow/generated/rest/types/AuditEventHttpInfo.java index 91126cc0..1352c42f 100644 --- a/src/main/java/com/skyflow/generated/rest/types/AuditEventHttpInfo.java +++ b/src/main/java/com/skyflow/generated/rest/types/AuditEventHttpInfo.java @@ -49,7 +49,7 @@ public Optional getMethod() { return method; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AuditEventHttpInfo && equalTo((AuditEventHttpInfo) other); @@ -64,12 +64,12 @@ private boolean equalTo(AuditEventHttpInfo other) { return uri.equals(other.uri) && method.equals(other.method); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.uri, this.method); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/BatchRecordMethod.java b/src/main/java/com/skyflow/generated/rest/types/BatchRecordMethod.java index c50f618d..a6f5e673 100644 --- a/src/main/java/com/skyflow/generated/rest/types/BatchRecordMethod.java +++ b/src/main/java/com/skyflow/generated/rest/types/BatchRecordMethod.java @@ -23,7 +23,7 @@ public enum BatchRecordMethod { } @JsonValue - @java.lang.Override + @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..31aadbe8 --- /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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.text, this.toxicity, this.deniedTopics, this.validation); + } + + @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 66% 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..ad97e07e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DetectFileRequestDataType.java +++ b/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java @@ -5,19 +5,19 @@ 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; } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/ContextAccessType.java b/src/main/java/com/skyflow/generated/rest/types/ContextAccessType.java index b1b6072c..163e862e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ContextAccessType.java +++ b/src/main/java/com/skyflow/generated/rest/types/ContextAccessType.java @@ -19,7 +19,7 @@ public enum ContextAccessType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/ContextAuthMode.java b/src/main/java/com/skyflow/generated/rest/types/ContextAuthMode.java index 349ca23a..204ad039 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ContextAuthMode.java +++ b/src/main/java/com/skyflow/generated/rest/types/ContextAuthMode.java @@ -21,7 +21,7 @@ public enum ContextAuthMode { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java index 59839994..4938361f 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java @@ -63,7 +63,7 @@ public Optional getProcessedFileExtension() { return processedFileExtension; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyFileOutput && equalTo((DeidentifyFileOutput) other); @@ -80,12 +80,12 @@ private boolean equalTo(DeidentifyFileOutput other) { && processedFileExtension.equals(other.processedFileExtension); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.processedFile, this.processedFileType, this.processedFileExtension); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutputProcessedFileType.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutputProcessedFileType.java index c560dc9e..8b602431 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutputProcessedFileType.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutputProcessedFileType.java @@ -33,7 +33,7 @@ public enum DeidentifyFileOutputProcessedFileType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileResponse.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileResponse.java index 460058dc..6b06d486 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileResponse.java @@ -36,7 +36,7 @@ public String getRunId() { return runId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyFileResponse && equalTo((DeidentifyFileResponse) other); @@ -51,12 +51,12 @@ private boolean equalTo(DeidentifyFileResponse other) { return runId.equals(other.runId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.runId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements RunIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyFileResponse other) { runId(other.getRunId()); return this; @@ -97,14 +97,14 @@ public Builder from(DeidentifyFileResponse other) { * Status URL for the detect run.

Status URL for the detect run.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("run_id") public _FinalStage runId(@NotNull String runId) { this.runId = Objects.requireNonNull(runId, "runId must not be null"); return this; } - @java.lang.Override + @Override public DeidentifyFileResponse build() { return new DeidentifyFileResponse(runId, additionalProperties); } 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..c01d6e5d 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java @@ -35,9 +35,9 @@ public final class DeidentifyStatusResponse { private final Optional characterCount; - private final Optional size; + private final Optional size; - private final Optional duration; + private final Optional duration; private final Optional pages; @@ -52,8 +52,8 @@ private DeidentifyStatusResponse( String message, Optional wordCount, Optional characterCount, - Optional size, - Optional duration, + Optional size, + Optional duration, Optional pages, Optional slides, Map additionalProperties) { @@ -122,7 +122,7 @@ public Optional getCharacterCount() { * @return Size of the processed text in kilobytes (KB). */ @JsonProperty("size") - public Optional getSize() { + public Optional getSize() { return size; } @@ -130,7 +130,7 @@ public Optional getSize() { * @return Duration of the processed audio in seconds. */ @JsonProperty("duration") - public Optional getDuration() { + public Optional getDuration() { return duration; } @@ -150,7 +150,7 @@ public Optional getSlides() { return slides; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyStatusResponse && equalTo((DeidentifyStatusResponse) other); @@ -174,7 +174,7 @@ private boolean equalTo(DeidentifyStatusResponse other) { && slides.equals(other.slides); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.status, @@ -189,7 +189,7 @@ public int hashCode() { this.slides); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -250,16 +250,16 @@ public interface _FinalStage { /** *

Size of the processed text in kilobytes (KB).

*/ - _FinalStage size(Optional size); + _FinalStage size(Optional size); - _FinalStage size(Integer size); + _FinalStage size(Double size); /** *

Duration of the processed audio in seconds.

*/ - _FinalStage duration(Optional duration); + _FinalStage duration(Optional duration); - _FinalStage duration(Integer duration); + _FinalStage duration(Double duration); /** *

Number of pages in the processed PDF.

@@ -288,9 +288,9 @@ public static final class Builder implements StatusStage, OutputTypeStage, Messa private Optional pages = Optional.empty(); - private Optional duration = Optional.empty(); + private Optional duration = Optional.empty(); - private Optional size = Optional.empty(); + private Optional size = Optional.empty(); private Optional characterCount = Optional.empty(); @@ -303,7 +303,7 @@ public static final class Builder implements StatusStage, OutputTypeStage, Messa private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyStatusResponse other) { status(other.getStatus()); output(other.getOutput()); @@ -322,7 +322,7 @@ public Builder from(DeidentifyStatusResponse other) { * Status of the detect run.

Status of the detect run.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public OutputTypeStage status(@NotNull DeidentifyStatusResponseStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -333,7 +333,7 @@ public OutputTypeStage status(@NotNull DeidentifyStatusResponseStatus status) { * 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 + @Override @JsonSetter("output_type") public MessageStage outputType(@NotNull DeidentifyStatusResponseOutputType outputType) { this.outputType = Objects.requireNonNull(outputType, "outputType must not be null"); @@ -344,7 +344,7 @@ public MessageStage outputType(@NotNull DeidentifyStatusResponseOutputType outpu * 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. */ - @java.lang.Override + @Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); @@ -355,7 +355,7 @@ public _FinalStage message(@NotNull String message) { *

Number of slides in the processed presentation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage slides(Integer slides) { this.slides = Optional.ofNullable(slides); return this; @@ -364,7 +364,7 @@ public _FinalStage slides(Integer slides) { /** *

Number of slides in the processed presentation.

*/ - @java.lang.Override + @Override @JsonSetter(value = "slides", nulls = Nulls.SKIP) public _FinalStage slides(Optional slides) { this.slides = slides; @@ -375,7 +375,7 @@ public _FinalStage slides(Optional slides) { *

Number of pages in the processed PDF.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage pages(Integer pages) { this.pages = Optional.ofNullable(pages); return this; @@ -384,7 +384,7 @@ public _FinalStage pages(Integer pages) { /** *

Number of pages in the processed PDF.

*/ - @java.lang.Override + @Override @JsonSetter(value = "pages", nulls = Nulls.SKIP) public _FinalStage pages(Optional pages) { this.pages = pages; @@ -395,8 +395,8 @@ public _FinalStage pages(Optional pages) { *

Duration of the processed audio in seconds.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage duration(Integer duration) { + @Override + public _FinalStage duration(Double duration) { this.duration = Optional.ofNullable(duration); return this; } @@ -404,9 +404,9 @@ public _FinalStage duration(Integer duration) { /** *

Duration of the processed audio in seconds.

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

Size of the processed text in kilobytes (KB).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage size(Integer size) { + @Override + public _FinalStage size(Double size) { this.size = Optional.ofNullable(size); return this; } @@ -424,9 +424,9 @@ public _FinalStage size(Integer size) { /** *

Size of the processed text in kilobytes (KB).

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

Number of characters in the processed text.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage characterCount(Integer characterCount) { this.characterCount = Optional.ofNullable(characterCount); return this; @@ -444,7 +444,7 @@ public _FinalStage characterCount(Integer characterCount) { /** *

Number of characters in the processed text.

*/ - @java.lang.Override + @Override @JsonSetter(value = "character_count", nulls = Nulls.SKIP) public _FinalStage characterCount(Optional characterCount) { this.characterCount = characterCount; @@ -455,7 +455,7 @@ public _FinalStage characterCount(Optional characterCount) { *

Number of words in the processed text.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage wordCount(Integer wordCount) { this.wordCount = Optional.ofNullable(wordCount); return this; @@ -464,7 +464,7 @@ public _FinalStage wordCount(Integer wordCount) { /** *

Number of words in the processed text.

*/ - @java.lang.Override + @Override @JsonSetter(value = "word_count", nulls = Nulls.SKIP) public _FinalStage wordCount(Optional wordCount) { this.wordCount = wordCount; @@ -475,7 +475,7 @@ public _FinalStage wordCount(Optional wordCount) { *

How the input file was specified.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllOutput(List output) { this.output.addAll(output); return this; @@ -485,7 +485,7 @@ public _FinalStage addAllOutput(List output) { *

How the input file was specified.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addOutput(DeidentifyFileOutput output) { this.output.add(output); return this; @@ -494,7 +494,7 @@ public _FinalStage addOutput(DeidentifyFileOutput output) { /** *

How the input file was specified.

*/ - @java.lang.Override + @Override @JsonSetter(value = "output", nulls = Nulls.SKIP) public _FinalStage output(List output) { this.output.clear(); @@ -502,7 +502,7 @@ public _FinalStage output(List output) { return this; } - @java.lang.Override + @Override public DeidentifyStatusResponse build() { return new DeidentifyStatusResponse( status, 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..5f20de6e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java @@ -8,8 +8,6 @@ public enum DeidentifyStatusResponseOutputType { BASE_64("BASE64"), - EFS_PATH("EFS_PATH"), - UNKNOWN("UNKNOWN"); private final String value; @@ -19,7 +17,7 @@ public enum DeidentifyStatusResponseOutputType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java index 4e51e5cf..5cf2be23 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java @@ -10,7 +10,9 @@ public enum DeidentifyStatusResponseStatus { IN_PROGRESS("IN_PROGRESS"), - SUCCESS("SUCCESS"); + SUCCESS("SUCCESS"), + + UNKNOWN("UNKNOWN"); private final String value; @@ -19,7 +21,7 @@ public enum DeidentifyStatusResponseStatus { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStringResponse.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStringResponse.java index 5b768610..b78bb43e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStringResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStringResponse.java @@ -77,7 +77,7 @@ public int getCharacterCount() { return characterCount; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeidentifyStringResponse && equalTo((DeidentifyStringResponse) other); @@ -95,12 +95,12 @@ private boolean equalTo(DeidentifyStringResponse other) { && characterCount == other.characterCount; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.processedText, this.entities, this.wordCount, this.characterCount); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -160,7 +160,7 @@ public static final class Builder implements ProcessedTextStage, WordCountStage, private Builder() {} - @java.lang.Override + @Override public Builder from(DeidentifyStringResponse other) { processedText(other.getProcessedText()); entities(other.getEntities()); @@ -173,7 +173,7 @@ public Builder from(DeidentifyStringResponse other) { * De-identified text.

De-identified text.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("processed_text") public WordCountStage processedText(@NotNull String processedText) { this.processedText = Objects.requireNonNull(processedText, "processedText must not be null"); @@ -184,7 +184,7 @@ public WordCountStage processedText(@NotNull String processedText) { * Number of words from the input text.

Number of words from the input text.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("word_count") public CharacterCountStage wordCount(int wordCount) { this.wordCount = wordCount; @@ -195,7 +195,7 @@ public CharacterCountStage wordCount(int wordCount) { * Number of characters from the input text.

Number of characters from the input text.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("character_count") public _FinalStage characterCount(int characterCount) { this.characterCount = characterCount; @@ -206,7 +206,7 @@ public _FinalStage characterCount(int characterCount) { *

Detected entities.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllEntities(List entities) { this.entities.addAll(entities); return this; @@ -216,7 +216,7 @@ public _FinalStage addAllEntities(List entities) { *

Detected entities.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addEntities(DetectedEntity entities) { this.entities.add(entities); return this; @@ -225,7 +225,7 @@ public _FinalStage addEntities(DetectedEntity entities) { /** *

Detected entities.

*/ - @java.lang.Override + @Override @JsonSetter(value = "entities", nulls = Nulls.SKIP) public _FinalStage entities(List entities) { this.entities.clear(); @@ -233,7 +233,7 @@ public _FinalStage entities(List entities) { return this; } - @java.lang.Override + @Override public DeidentifyStringResponse build() { return new DeidentifyStringResponse( processedText, entities, wordCount, characterCount, additionalProperties); 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/DetectedEntity.java b/src/main/java/com/skyflow/generated/rest/types/DetectedEntity.java index 6de2200a..840a62a9 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DetectedEntity.java +++ b/src/main/java/com/skyflow/generated/rest/types/DetectedEntity.java @@ -84,7 +84,7 @@ public Optional> getEntityScores() { return entityScores; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DetectedEntity && equalTo((DetectedEntity) other); @@ -103,12 +103,12 @@ private boolean equalTo(DetectedEntity other) { && entityScores.equals(other.entityScores); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.token, this.value, this.location, this.entityType, this.entityScores); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/DetokenizeRecordResponseValueType.java b/src/main/java/com/skyflow/generated/rest/types/DetokenizeRecordResponseValueType.java index f192c14f..e9f4be2a 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DetokenizeRecordResponseValueType.java +++ b/src/main/java/com/skyflow/generated/rest/types/DetokenizeRecordResponseValueType.java @@ -31,7 +31,7 @@ public enum DetokenizeRecordResponseValueType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/EntityLocation.java b/src/main/java/com/skyflow/generated/rest/types/EntityLocation.java index 6e711422..197afeda 100644 --- a/src/main/java/com/skyflow/generated/rest/types/EntityLocation.java +++ b/src/main/java/com/skyflow/generated/rest/types/EntityLocation.java @@ -75,7 +75,7 @@ public Optional getEndIndexProcessed() { return endIndexProcessed; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EntityLocation && equalTo((EntityLocation) other); @@ -93,12 +93,12 @@ private boolean equalTo(EntityLocation other) { && endIndexProcessed.equals(other.endIndexProcessed); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.startIndex, this.endIndex, this.startIndexProcessed, this.endIndexProcessed); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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..c06b16e2 100644 --- a/src/main/java/com/skyflow/generated/rest/types/EntityType.java +++ b/src/main/java/com/skyflow/generated/rest/types/EntityType.java @@ -30,6 +30,8 @@ public enum EntityType { DATE_INTERVAL("date_interval"), + DAY("day"), + DOB("dob"), DOSE("dose"), @@ -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"), @@ -112,10 +120,14 @@ public enum EntityType { PRODUCT("product"), + PROJECT("project"), + RELIGION("religion"), 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; @@ -139,7 +153,7 @@ public enum EntityType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/ErrorResponse.java b/src/main/java/com/skyflow/generated/rest/types/ErrorResponse.java index 68778cb1..565714eb 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ErrorResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/ErrorResponse.java @@ -33,7 +33,7 @@ public ErrorResponseError getError() { return error; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ErrorResponse && equalTo((ErrorResponse) other); @@ -48,12 +48,12 @@ private boolean equalTo(ErrorResponse other) { return error.equals(other.error); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.error); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ErrorStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ErrorResponse other) { error(other.getError()); return this; } - @java.lang.Override + @Override @JsonSetter("error") public _FinalStage error(@NotNull ErrorResponseError error) { this.error = Objects.requireNonNull(error, "error must not be null"); return this; } - @java.lang.Override + @Override public ErrorResponse build() { return new ErrorResponse(error, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/types/ErrorResponseError.java b/src/main/java/com/skyflow/generated/rest/types/ErrorResponseError.java index 5d0ee57d..21799203 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ErrorResponseError.java +++ b/src/main/java/com/skyflow/generated/rest/types/ErrorResponseError.java @@ -83,7 +83,7 @@ public Optional>> getDetails() { return details; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ErrorResponseError && equalTo((ErrorResponseError) other); @@ -102,12 +102,12 @@ private boolean equalTo(ErrorResponseError other) { && details.equals(other.details); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.grpcCode, this.httpCode, this.httpStatus, this.message, this.details); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -169,7 +169,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(ErrorResponseError other) { grpcCode(other.getGrpcCode()); httpCode(other.getHttpCode()); @@ -183,7 +183,7 @@ public Builder from(ErrorResponseError other) { * gRPC status codes. See https://grpc.io/docs/guides/status-codes.

gRPC status codes. See https://grpc.io/docs/guides/status-codes.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("grpc_code") public HttpCodeStage grpcCode(int grpcCode) { this.grpcCode = grpcCode; @@ -194,7 +194,7 @@ public HttpCodeStage grpcCode(int grpcCode) { * HTTP status codes. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status.

HTTP status codes. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("http_code") public HttpStatusStage httpCode(int httpCode) { this.httpCode = httpCode; @@ -205,34 +205,34 @@ public HttpStatusStage httpCode(int httpCode) { * HTTP status message.

HTTP status message.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("http_status") public MessageStage httpStatus(@NotNull String httpStatus) { this.httpStatus = Objects.requireNonNull(httpStatus, "httpStatus must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage details(List> details) { this.details = Optional.ofNullable(details); return this; } - @java.lang.Override + @Override @JsonSetter(value = "details", nulls = Nulls.SKIP) public _FinalStage details(Optional>> details) { this.details = details; return this; } - @java.lang.Override + @Override public ErrorResponseError build() { return new ErrorResponseError(grpcCode, httpCode, httpStatus, message, details, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java b/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java index d0290573..807aee4e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/GooglerpcStatus.java @@ -55,7 +55,7 @@ public Optional> getDetails() { return details; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GooglerpcStatus && equalTo((GooglerpcStatus) other); @@ -70,12 +70,12 @@ private boolean equalTo(GooglerpcStatus other) { return code.equals(other.code) && message.equals(other.message) && details.equals(other.details); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.code, this.message, this.details); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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/ProtobufAny.java b/src/main/java/com/skyflow/generated/rest/types/ProtobufAny.java index 37555aae..9f019b66 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ProtobufAny.java +++ b/src/main/java/com/skyflow/generated/rest/types/ProtobufAny.java @@ -34,7 +34,7 @@ public Optional getType() { return type; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProtobufAny && equalTo((ProtobufAny) other); @@ -49,12 +49,12 @@ private boolean equalTo(ProtobufAny other) { return type.equals(other.type); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/RedactionEnumRedaction.java b/src/main/java/com/skyflow/generated/rest/types/RedactionEnumRedaction.java index 3e83052b..88022df8 100644 --- a/src/main/java/com/skyflow/generated/rest/types/RedactionEnumRedaction.java +++ b/src/main/java/com/skyflow/generated/rest/types/RedactionEnumRedaction.java @@ -21,7 +21,7 @@ public enum RedactionEnumRedaction { } @JsonValue - @java.lang.Override + @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..c9b35261 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java @@ -0,0 +1,170 @@ +/** + * 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 ReidentifyFileResponseOutputType outputType; + + private final ReidentifyFileResponseOutput output; + + private final Map additionalProperties; + + private ReidentifyFileResponse( + ReidentifyFileResponseStatus status, + ReidentifyFileResponseOutputType outputType, + ReidentifyFileResponseOutput output, + Map additionalProperties) { + this.status = status; + this.outputType = outputType; + 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 ReidentifyFileResponseOutputType getOutputType() { + return outputType; + } + + @JsonProperty("output") + public ReidentifyFileResponseOutput getOutput() { + return output; + } + + @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) && outputType.equals(other.outputType) && output.equals(other.output); + } + + @Override + public int hashCode() { + return Objects.hash(this.status, this.outputType, this.output); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + * Status of the re-identify operation. + */ + OutputTypeStage status(@NotNull ReidentifyFileResponseStatus status); + + Builder from(ReidentifyFileResponse other); + } + + public interface OutputTypeStage { + /** + * Format of the output file. + */ + OutputStage outputType(@NotNull ReidentifyFileResponseOutputType outputType); + } + + public interface OutputStage { + _FinalStage output(@NotNull ReidentifyFileResponseOutput output); + } + + public interface _FinalStage { + ReidentifyFileResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, OutputTypeStage, OutputStage, _FinalStage { + private ReidentifyFileResponseStatus status; + + private ReidentifyFileResponseOutputType outputType; + + private ReidentifyFileResponseOutput output; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ReidentifyFileResponse other) { + status(other.getStatus()); + outputType(other.getOutputType()); + 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. + */ + @Override + @JsonSetter("status") + public OutputTypeStage status(@NotNull ReidentifyFileResponseStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + * Format of the output file.

Format of the output file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("output_type") + public OutputStage outputType(@NotNull ReidentifyFileResponseOutputType outputType) { + this.outputType = Objects.requireNonNull(outputType, "outputType must not be null"); + return this; + } + + @Override + @JsonSetter("output") + public _FinalStage output(@NotNull ReidentifyFileResponseOutput output) { + this.output = Objects.requireNonNull(output, "output must not be null"); + return this; + } + + @Override + public ReidentifyFileResponse build() { + return new ReidentifyFileResponse(status, outputType, 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..90e2fb38 --- /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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.processedFile, this.processedFileExtension); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + @JsonSetter("processed_file_extension") + public _FinalStage processedFileExtension(@NotNull String processedFileExtension) { + this.processedFileExtension = + Objects.requireNonNull(processedFileExtension, "processedFileExtension must not be null"); + return this; + } + + @Override + public ReidentifyFileResponseOutput build() { + return new ReidentifyFileResponseOutput(processedFile, processedFileExtension, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectRequestDeidentifyOption.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java similarity index 59% rename from src/main/java/com/skyflow/generated/rest/types/DetectRequestDeidentifyOption.java rename to src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java index bdc82ccf..6a754641 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DetectRequestDeidentifyOption.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java @@ -5,21 +5,19 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DetectRequestDeidentifyOption { - UNKNOWN("UNKNOWN"), +public enum ReidentifyFileResponseOutputType { + BASE_64("BASE64"), - ENTITY_UNQ_COUNTER("ENTITY_UNQ_COUNTER"), - - ENTITY_ONLY("ENTITY_ONLY"); + UNKNOWN("UNKNOWN"); private final String value; - DetectRequestDeidentifyOption(String value) { + ReidentifyFileResponseOutputType(String value) { this.value = value; } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } 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 68% 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..da44ec81 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetectStatusResponseStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java @@ -5,23 +5,23 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum V1DetectStatusResponseStatus { - UNKNOWN("UNKNOWN"), - +public enum ReidentifyFileResponseStatus { FAILED("FAILED"), + IN_PROGRESS("IN_PROGRESS"), + SUCCESS("SUCCESS"), - IN_PROGRESS("IN_PROGRESS"); + UNKNOWN("UNKNOWN"); private final String value; - V1DetectStatusResponseStatus(String value) { + ReidentifyFileResponseStatus(String value) { this.value = value; } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifyStringResponse.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyStringResponse.java index ba305e63..dad2f08f 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ReidentifyStringResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyStringResponse.java @@ -37,7 +37,7 @@ public Optional getText() { return text; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ReidentifyStringResponse && equalTo((ReidentifyStringResponse) other); @@ -52,12 +52,12 @@ private boolean equalTo(ReidentifyStringResponse other) { return text.equals(other.text); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/RequestActionType.java b/src/main/java/com/skyflow/generated/rest/types/RequestActionType.java index 436a1de8..ad0a32a7 100644 --- a/src/main/java/com/skyflow/generated/rest/types/RequestActionType.java +++ b/src/main/java/com/skyflow/generated/rest/types/RequestActionType.java @@ -49,7 +49,7 @@ public enum RequestActionType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenType.java b/src/main/java/com/skyflow/generated/rest/types/TokenType.java index a50e861b..eb30f761 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenType.java +++ b/src/main/java/com/skyflow/generated/rest/types/TokenType.java @@ -73,7 +73,7 @@ public Optional> getEntityOnly() { return entityOnly; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenType && equalTo((TokenType) other); @@ -91,12 +91,12 @@ private boolean equalTo(TokenType other) { && entityOnly.equals(other.entityOnly); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.default_, this.vaultToken, this.entityUnqCounter, this.entityOnly); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java index 14ab8f0f..5eeed0a7 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java @@ -19,7 +19,7 @@ public enum TokenTypeDefault { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVault.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVault.java index 5f5938a0..4bf8dffb 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVault.java +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVault.java @@ -61,7 +61,7 @@ public Optional> getEntityOnly() { return entityOnly; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenTypeWithoutVault && equalTo((TokenTypeWithoutVault) other); @@ -78,12 +78,12 @@ private boolean equalTo(TokenTypeWithoutVault other) { && entityOnly.equals(other.entityOnly); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.default_, this.entityUnqCounter, this.entityOnly); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java index 45dba579..d7d0d573 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java @@ -17,7 +17,7 @@ public enum TokenTypeWithoutVaultDefault { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/Transformations.java b/src/main/java/com/skyflow/generated/rest/types/Transformations.java index 46022faa..bef63c2a 100644 --- a/src/main/java/com/skyflow/generated/rest/types/Transformations.java +++ b/src/main/java/com/skyflow/generated/rest/types/Transformations.java @@ -37,7 +37,7 @@ public Optional getShiftDates() { return shiftDates; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Transformations && equalTo((Transformations) other); @@ -52,12 +52,12 @@ private boolean equalTo(Transformations other) { return shiftDates.equals(other.shiftDates); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.shiftDates); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java b/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java index 1e11938b..e9206467 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java +++ b/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java @@ -64,7 +64,7 @@ public Optional> getEntityTypes() return entityTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TransformationsShiftDates && equalTo((TransformationsShiftDates) other); @@ -79,12 +79,12 @@ private boolean equalTo(TransformationsShiftDates other) { return maxDays.equals(other.maxDays) && minDays.equals(other.minDays) && entityTypes.equals(other.entityTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.maxDays, this.minDays, this.entityTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java index 148cea23..3da8eb6d 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java +++ b/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java @@ -19,7 +19,7 @@ public enum TransformationsShiftDatesEntityTypesItem { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.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/V1AuditAfterOptions.java b/src/main/java/com/skyflow/generated/rest/types/V1AuditAfterOptions.java index 1453dd99..d942fdcd 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1AuditAfterOptions.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1AuditAfterOptions.java @@ -49,7 +49,7 @@ public Optional getChangeId() { return changeId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1AuditAfterOptions && equalTo((V1AuditAfterOptions) other); @@ -64,12 +64,12 @@ private boolean equalTo(V1AuditAfterOptions other) { return timestamp.equals(other.timestamp) && changeId.equals(other.changeId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.timestamp, this.changeId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AuditEventResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1AuditEventResponse.java index 2dd2ca4e..c582d06d 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1AuditEventResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1AuditEventResponse.java @@ -72,7 +72,7 @@ public Optional getTimestamp() { return timestamp; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1AuditEventResponse && equalTo((V1AuditEventResponse) other); @@ -90,12 +90,12 @@ private boolean equalTo(V1AuditEventResponse other) { && timestamp.equals(other.timestamp); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.code, this.message, this.data, this.timestamp); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AuditResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1AuditResponse.java index 88496f03..dd23d77c 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1AuditResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1AuditResponse.java @@ -49,7 +49,7 @@ public Optional getNextOps() { return nextOps; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1AuditResponse && equalTo((V1AuditResponse) other); @@ -64,12 +64,12 @@ private boolean equalTo(V1AuditResponse other) { return event.equals(other.event) && nextOps.equals(other.nextOps); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.event, this.nextOps); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEvent.java b/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEvent.java index 595b724c..ca2bfdc2 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEvent.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEvent.java @@ -91,7 +91,7 @@ public Optional> getResourceIDs() { return resourceIDs; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1AuditResponseEvent && equalTo((V1AuditResponseEvent) other); @@ -111,13 +111,13 @@ private boolean equalTo(V1AuditResponseEvent other) { && resourceIDs.equals(other.resourceIDs); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.context, this.request, this.response, this.parentAccountId, this.accountId, this.resourceIDs); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEventRequest.java b/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEventRequest.java index c77bc31f..046c8fb4 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEventRequest.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1AuditResponseEventRequest.java @@ -124,7 +124,7 @@ public Optional getHttpInfo() { return httpInfo; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1AuditResponseEventRequest && equalTo((V1AuditResponseEventRequest) other); @@ -147,7 +147,7 @@ private boolean equalTo(V1AuditResponseEventRequest other) { && httpInfo.equals(other.httpInfo); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.data, @@ -161,7 +161,7 @@ public int hashCode() { this.httpInfo); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1BatchOperationResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1BatchOperationResponse.java index 03d752d9..a557da82 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1BatchOperationResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1BatchOperationResponse.java @@ -52,7 +52,7 @@ public Optional>> getResponses() { return responses; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1BatchOperationResponse && equalTo((V1BatchOperationResponse) other); @@ -67,12 +67,12 @@ private boolean equalTo(V1BatchOperationResponse other) { return vaultId.equals(other.vaultId) && responses.equals(other.responses); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.vaultId, this.responses); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1BatchRecord.java b/src/main/java/com/skyflow/generated/rest/types/V1BatchRecord.java index 39eb2e68..afc572cf 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1BatchRecord.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1BatchRecord.java @@ -141,7 +141,7 @@ public Optional> getTokens() { return tokens; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1BatchRecord && equalTo((V1BatchRecord) other); @@ -165,7 +165,7 @@ private boolean equalTo(V1BatchRecord other) { && tokens.equals(other.tokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.fields, @@ -180,7 +180,7 @@ public int hashCode() { this.tokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1BinListResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1BinListResponse.java index cf3a3326..58472a8b 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1BinListResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1BinListResponse.java @@ -38,7 +38,7 @@ public Optional> getCardsData() { return cardsData; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1BinListResponse && equalTo((V1BinListResponse) other); @@ -53,12 +53,12 @@ private boolean equalTo(V1BinListResponse other) { return cardsData.equals(other.cardsData); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.cardsData); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1BulkDeleteRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1BulkDeleteRecordResponse.java index 5f781686..ddb0d213 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1BulkDeleteRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1BulkDeleteRecordResponse.java @@ -39,7 +39,7 @@ public Optional> getRecordIdResponse() { return recordIdResponse; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1BulkDeleteRecordResponse && equalTo((V1BulkDeleteRecordResponse) other); @@ -54,12 +54,12 @@ private boolean equalTo(V1BulkDeleteRecordResponse other) { return recordIdResponse.equals(other.recordIdResponse); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.recordIdResponse); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1BulkGetRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1BulkGetRecordResponse.java index 70d31034..c2d3790a 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1BulkGetRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1BulkGetRecordResponse.java @@ -38,7 +38,7 @@ public Optional> getRecords() { return records; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1BulkGetRecordResponse && equalTo((V1BulkGetRecordResponse) other); @@ -53,12 +53,12 @@ private boolean equalTo(V1BulkGetRecordResponse other) { return records.equals(other.records); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1Byot.java b/src/main/java/com/skyflow/generated/rest/types/V1Byot.java index 819fdb42..bafd7a09 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1Byot.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1Byot.java @@ -19,7 +19,7 @@ public enum V1Byot { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1Card.java b/src/main/java/com/skyflow/generated/rest/types/V1Card.java index d19d3099..f2a9db90 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1Card.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1Card.java @@ -135,7 +135,7 @@ public Optional getCardExpiry() { return cardExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1Card && equalTo((V1Card) other); @@ -158,7 +158,7 @@ private boolean equalTo(V1Card other) { && cardExpiry.equals(other.cardExpiry); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.bin, @@ -172,7 +172,7 @@ public int hashCode() { this.cardExpiry); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DeleteFileResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DeleteFileResponse.java index efdb8e42..4ec85903 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DeleteFileResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1DeleteFileResponse.java @@ -49,7 +49,7 @@ public Optional getDeleted() { return deleted; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1DeleteFileResponse && equalTo((V1DeleteFileResponse) other); @@ -64,12 +64,12 @@ private boolean equalTo(V1DeleteFileResponse other) { return skyflowId.equals(other.skyflowId) && deleted.equals(other.deleted); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.skyflowId, this.deleted); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DeleteRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DeleteRecordResponse.java index 700bfe2f..2f3bde14 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DeleteRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1DeleteRecordResponse.java @@ -49,7 +49,7 @@ public Optional getDeleted() { return deleted; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1DeleteRecordResponse && equalTo((V1DeleteRecordResponse) other); @@ -64,12 +64,12 @@ private boolean equalTo(V1DeleteRecordResponse other) { return skyflowId.equals(other.skyflowId) && deleted.equals(other.deleted); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.skyflowId, this.deleted); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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/V1DetokenizeRecordRequest.java b/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordRequest.java index 5b6927d1..3cf5b59c 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordRequest.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordRequest.java @@ -48,7 +48,7 @@ public Optional getRedaction() { return redaction; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1DetokenizeRecordRequest && equalTo((V1DetokenizeRecordRequest) other); @@ -63,12 +63,12 @@ private boolean equalTo(V1DetokenizeRecordRequest other) { return token.equals(other.token) && redaction.equals(other.redaction); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.token, this.redaction); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordResponse.java index 423abfe8..ba0abbfa 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeRecordResponse.java @@ -72,7 +72,7 @@ public Optional getError() { return error; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1DetokenizeRecordResponse && equalTo((V1DetokenizeRecordResponse) other); @@ -90,12 +90,12 @@ private boolean equalTo(V1DetokenizeRecordResponse other) { && error.equals(other.error); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.token, this.valueType, this.value, this.error); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeResponse.java index 20d7d8e4..74f4f6e6 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1DetokenizeResponse.java @@ -39,7 +39,7 @@ public Optional> getRecords() { return records; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1DetokenizeResponse && equalTo((V1DetokenizeResponse) other); @@ -54,12 +54,12 @@ private boolean equalTo(V1DetokenizeResponse other) { return records.equals(other.records); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1FieldRecords.java b/src/main/java/com/skyflow/generated/rest/types/V1FieldRecords.java index 8d520d3b..dfbccb8b 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1FieldRecords.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1FieldRecords.java @@ -51,7 +51,7 @@ public Optional> getTokens() { return tokens; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1FieldRecords && equalTo((V1FieldRecords) other); @@ -66,12 +66,12 @@ private boolean equalTo(V1FieldRecords other) { return fields.equals(other.fields) && tokens.equals(other.tokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.tokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1FileAvScanStatus.java b/src/main/java/com/skyflow/generated/rest/types/V1FileAvScanStatus.java index afe545fe..02658ef2 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1FileAvScanStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1FileAvScanStatus.java @@ -31,7 +31,7 @@ public enum V1FileAvScanStatus { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java index 9b6be70b..f5669085 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1GetAuthTokenResponse.java @@ -49,7 +49,7 @@ public Optional getTokenType() { return tokenType; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1GetAuthTokenResponse && equalTo((V1GetAuthTokenResponse) other); @@ -64,12 +64,12 @@ private boolean equalTo(V1GetAuthTokenResponse other) { return accessToken.equals(other.accessToken) && tokenType.equals(other.tokenType); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.accessToken, this.tokenType); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1GetFileScanStatusResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1GetFileScanStatusResponse.java index 27100e6d..4bd67013 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1GetFileScanStatusResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1GetFileScanStatusResponse.java @@ -35,7 +35,7 @@ public Optional getAvScanStatus() { return avScanStatus; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1GetFileScanStatusResponse && equalTo((V1GetFileScanStatusResponse) other); @@ -50,12 +50,12 @@ private boolean equalTo(V1GetFileScanStatusResponse other) { return avScanStatus.equals(other.avScanStatus); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.avScanStatus); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1GetQueryResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1GetQueryResponse.java index 6a8689ae..821d1f06 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1GetQueryResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1GetQueryResponse.java @@ -38,7 +38,7 @@ public Optional> getRecords() { return records; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1GetQueryResponse && equalTo((V1GetQueryResponse) other); @@ -53,12 +53,12 @@ private boolean equalTo(V1GetQueryResponse other) { return records.equals(other.records); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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/V1InsertRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1InsertRecordResponse.java index 724bee91..0addf786 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1InsertRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1InsertRecordResponse.java @@ -39,7 +39,7 @@ public Optional> getRecords() { return records; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1InsertRecordResponse && equalTo((V1InsertRecordResponse) other); @@ -54,12 +54,12 @@ private boolean equalTo(V1InsertRecordResponse other) { return records.equals(other.records); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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/V1MemberType.java b/src/main/java/com/skyflow/generated/rest/types/V1MemberType.java index dacca1b9..48e96379 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1MemberType.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1MemberType.java @@ -19,7 +19,7 @@ public enum V1MemberType { } @JsonValue - @java.lang.Override + @Override public String toString() { return this.value; } 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/V1RecordMetaProperties.java b/src/main/java/com/skyflow/generated/rest/types/V1RecordMetaProperties.java index 419b8e16..f69719cf 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1RecordMetaProperties.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1RecordMetaProperties.java @@ -51,7 +51,7 @@ public Optional> getTokens() { return tokens; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1RecordMetaProperties && equalTo((V1RecordMetaProperties) other); @@ -66,12 +66,12 @@ private boolean equalTo(V1RecordMetaProperties other) { return skyflowId.equals(other.skyflowId) && tokens.equals(other.tokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.skyflowId, this.tokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } 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); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordRequest.java b/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordRequest.java index 03c5ef89..2c15ceac 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordRequest.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordRequest.java @@ -49,7 +49,7 @@ public Optional getColumnGroup() { return columnGroup; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1TokenizeRecordRequest && equalTo((V1TokenizeRecordRequest) other); @@ -64,12 +64,12 @@ private boolean equalTo(V1TokenizeRecordRequest other) { return value.equals(other.value) && columnGroup.equals(other.columnGroup); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value, this.columnGroup); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordResponse.java index 4cd41dd0..201a4f60 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1TokenizeRecordResponse.java @@ -37,7 +37,7 @@ public Optional getToken() { return token; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1TokenizeRecordResponse && equalTo((V1TokenizeRecordResponse) other); @@ -52,12 +52,12 @@ private boolean equalTo(V1TokenizeRecordResponse other) { return token.equals(other.token); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.token); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1TokenizeResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1TokenizeResponse.java index 38159283..62d77bed 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1TokenizeResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1TokenizeResponse.java @@ -39,7 +39,7 @@ public Optional> getRecords() { return records; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1TokenizeResponse && equalTo((V1TokenizeResponse) other); @@ -54,12 +54,12 @@ private boolean equalTo(V1TokenizeResponse other) { return records.equals(other.records); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.records); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1UpdateRecordResponse.java b/src/main/java/com/skyflow/generated/rest/types/V1UpdateRecordResponse.java index 658926b9..03ed7b58 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1UpdateRecordResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1UpdateRecordResponse.java @@ -51,7 +51,7 @@ public Optional> getTokens() { return tokens; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1UpdateRecordResponse && equalTo((V1UpdateRecordResponse) other); @@ -66,12 +66,12 @@ private boolean equalTo(V1UpdateRecordResponse other) { return skyflowId.equals(other.skyflowId) && tokens.equals(other.tokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.skyflowId, this.tokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1VaultFieldMapping.java b/src/main/java/com/skyflow/generated/rest/types/V1VaultFieldMapping.java index bad4474a..c19d1cb5 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1VaultFieldMapping.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1VaultFieldMapping.java @@ -63,7 +63,7 @@ public Optional getCardExpiry() { return cardExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1VaultFieldMapping && equalTo((V1VaultFieldMapping) other); @@ -80,12 +80,12 @@ private boolean equalTo(V1VaultFieldMapping other) { && cardExpiry.equals(other.cardExpiry); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.cardNumber, this.cardLastFourDigits, this.cardExpiry); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/generated/rest/types/V1VaultSchemaConfig.java b/src/main/java/com/skyflow/generated/rest/types/V1VaultSchemaConfig.java index 28a609b6..cd838305 100644 --- a/src/main/java/com/skyflow/generated/rest/types/V1VaultSchemaConfig.java +++ b/src/main/java/com/skyflow/generated/rest/types/V1VaultSchemaConfig.java @@ -60,7 +60,7 @@ public Optional getMapping() { return mapping; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof V1VaultSchemaConfig && equalTo((V1VaultSchemaConfig) other); @@ -75,12 +75,12 @@ private boolean equalTo(V1VaultSchemaConfig other) { return id.equals(other.id) && tableName.equals(other.tableName) && mapping.equals(other.mapping); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.tableName, this.mapping); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokenResponse.java b/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokenResponse.java index 7c9f4674..180df4e5 100644 --- a/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokenResponse.java +++ b/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokenResponse.java @@ -3,14 +3,19 @@ import com.google.gson.Gson; import com.skyflow.utils.Constants; +import java.util.ArrayList; +import java.util.HashMap; + public class SignedDataTokenResponse { private static final String prefix = Constants.SIGNED_DATA_TOKEN_PREFIX; private final String token; private final String signedToken; + private final ArrayList> errors; - public SignedDataTokenResponse(String token, String signedToken) { + public SignedDataTokenResponse(String token, String signedToken, ArrayList> errors) { this.token = token; this.signedToken = new StringBuilder(prefix).append(signedToken).toString(); + this.errors = errors; } public String getToken() { @@ -21,9 +26,13 @@ public String getSignedToken() { return signedToken; } + public ArrayList> getErrors() { + return errors; + } + @Override public String toString() { - Gson gson = new Gson(); + Gson gson = new Gson().newBuilder().serializeNulls().create(); return gson.toJson(this); } -} +} \ No newline at end of file diff --git a/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java b/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java index ecdfa89f..d1ddab8c 100644 --- a/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java +++ b/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java @@ -146,7 +146,7 @@ private static List getSignedToken( .setExpiration(expirationDate) .signWith(SignatureAlgorithm.RS256, pvtKey) .compact(); - SignedDataTokenResponse responseObject = new SignedDataTokenResponse(dataToken, eachSignedDataToken); + SignedDataTokenResponse responseObject = new SignedDataTokenResponse(dataToken, eachSignedDataToken, null); list.add(responseObject); } return list; diff --git a/src/main/java/com/skyflow/utils/Constants.java b/src/main/java/com/skyflow/utils/Constants.java index b9264a22..f12e6a48 100644 --- a/src/main/java/com/skyflow/utils/Constants.java +++ b/src/main/java/com/skyflow/utils/Constants.java @@ -26,6 +26,6 @@ public final class Constants { public static final String SDK_METRICS_HEADER_KEY = "sky-metadata"; public static final String REQUEST_ID_HEADER_KEY = "x-request-id"; public static final String PROCESSED_FILE_NAME_PREFIX = "processed-"; - public static final String ERROR_FROM_CLIENT_HEADER_KEY = "eror-from-client"; - public static final String DEIDENTIFIED_FILE_PREFIX = "deidentified";; + public static final String ERROR_FROM_CLIENT_HEADER_KEY = "error-from-client"; + public static final String DEIDENTIFIED_FILE_PREFIX = "deidentified"; } diff --git a/src/main/java/com/skyflow/utils/validations/Validations.java b/src/main/java/com/skyflow/utils/validations/Validations.java index 841c03b6..7070f358 100644 --- a/src/main/java/com/skyflow/utils/validations/Validations.java +++ b/src/main/java/com/skyflow/utils/validations/Validations.java @@ -788,6 +788,11 @@ public static void validateDeidentifyFileRequest(DeidentifyFileRequest request) throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.EmptyRequestBody.getMessage()); } + TokenFormat tokenFormat = request.getTokenFormat(); + if (tokenFormat != null && tokenFormat.getVaultToken() != null && !tokenFormat.getVaultToken().isEmpty()) { + throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.VaultTokenFormatIsNotAllowedForFiles.getMessage()); + } + File file = request.getFileInput().getFile(); String filePath = request.getFileInput().getFilePath(); @@ -842,9 +847,6 @@ public static void validateDeidentifyFileRequest(DeidentifyFileRequest request) )); throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.InvalidRequestBody.getMessage()); } - if (request.getBleep().getGain() == null) { - throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.InvalidRequestBody.getMessage()); - } if (request.getBleep().getStartPadding() == null || request.getBleep().getStartPadding() < 0) { throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.InvalidRequestBody.getMessage()); } diff --git a/src/main/java/com/skyflow/vault/connection/InvokeConnectionResponse.java b/src/main/java/com/skyflow/vault/connection/InvokeConnectionResponse.java index a2d44d99..1a81eca0 100644 --- a/src/main/java/com/skyflow/vault/connection/InvokeConnectionResponse.java +++ b/src/main/java/com/skyflow/vault/connection/InvokeConnectionResponse.java @@ -3,15 +3,18 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import java.util.ArrayList; import java.util.HashMap; public class InvokeConnectionResponse { private final Object data; private final HashMap metadata; + private final ArrayList> errors; - public InvokeConnectionResponse(Object data, HashMap metadata) { + public InvokeConnectionResponse(Object data, HashMap metadata, ArrayList> errors) { this.data = data; this.metadata = metadata; + this.errors = errors; } public Object getData() { @@ -22,9 +25,13 @@ public HashMap getMetadata() { return metadata; } + public ArrayList> getErrors() { + return errors; + } + @Override public String toString() { - Gson gson = new GsonBuilder().serializeNulls().create(); + Gson gson = new Gson().newBuilder().serializeNulls().create(); return gson.toJson(this); } } diff --git a/src/main/java/com/skyflow/vault/controller/ConnectionController.java b/src/main/java/com/skyflow/vault/controller/ConnectionController.java index 68a39751..4a9334d4 100644 --- a/src/main/java/com/skyflow/vault/controller/ConnectionController.java +++ b/src/main/java/com/skyflow/vault/controller/ConnectionController.java @@ -67,7 +67,7 @@ public InvokeConnectionResponse invoke(InvokeConnectionRequest invokeConnectionR JsonObject data = JsonParser.parseString(response).getAsJsonObject(); HashMap metadata = new HashMap<>(); metadata.put("requestId", HttpUtility.getRequestID()); - connectionResponse = new InvokeConnectionResponse(data, metadata); + connectionResponse = new InvokeConnectionResponse(data, metadata, null); LogUtil.printInfoLog(InfoLogs.INVOKE_CONNECTION_REQUEST_RESOLVED.getLog()); } catch (IOException e) { LogUtil.printErrorLog(ErrorLogs.INVOKE_CONNECTION_REQUEST_REJECTED.getLog()); diff --git a/src/main/java/com/skyflow/vault/controller/DetectController.java b/src/main/java/com/skyflow/vault/controller/DetectController.java index 411658ae..4675073b 100644 --- a/src/main/java/com/skyflow/vault/controller/DetectController.java +++ b/src/main/java/com/skyflow/vault/controller/DetectController.java @@ -12,6 +12,7 @@ import com.skyflow.generated.rest.resources.files.requests.*; import com.skyflow.generated.rest.resources.strings.requests.DeidentifyStringRequest; import com.skyflow.generated.rest.resources.strings.requests.ReidentifyStringRequest; +import com.skyflow.generated.rest.types.DeidentifyStatusResponseOutputType; import com.skyflow.generated.rest.types.*; import com.skyflow.logs.ErrorLogs; import com.skyflow.logs.InfoLogs; @@ -28,7 +29,11 @@ import java.util.*; public final class DetectController extends VaultClient { - private static final Gson gson = new GsonBuilder().serializeNulls().create(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Optional.class, (JsonSerializer>) (src, typeOfSrc, context) -> + src.map(context::serialize).orElse(null)) + .serializeNulls() + .create(); public DetectController(VaultConfig vaultConfig, Credentials credentials) { super(vaultConfig, credentials); @@ -55,7 +60,7 @@ public DeidentifyTextResponse deidentifyText(DeidentifyTextRequest deidentifyTex deidentifyTextResponse = getDeIdentifyTextResponse(deidentifyStringResponse); LogUtil.printInfoLog(InfoLogs.DEIDENTIFY_TEXT_REQUEST_RESOLVED.getLog()); } catch (ApiClientApiException ex) { - String bodyString = gson.toJson(ex.body()); + String bodyString = extractBodyAsString(ex); LogUtil.printErrorLog(ErrorLogs.DEIDENTIFY_TEXT_REQUEST_REJECTED.getLog()); throw new SkyflowException(ex.statusCode(), ex, ex.headers(), bodyString); } @@ -82,7 +87,7 @@ public ReidentifyTextResponse reidentifyText(ReidentifyTextRequest reidentifyTex reidentifyTextResponse = new ReidentifyTextResponse(reidentifyStringResponse.getText().orElse(null)); LogUtil.printInfoLog(InfoLogs.REIDENTIFY_TEXT_REQUEST_RESOLVED.getLog()); } catch (ApiClientApiException ex) { - String bodyString = gson.toJson(ex.body()); + String bodyString = extractBodyAsString(ex); LogUtil.printErrorLog(ErrorLogs.REIDENTIFY_TEXT_REQUEST_REJECTED.getLog()); throw new SkyflowException(ex.statusCode(), ex, ex.headers(), bodyString); } @@ -126,10 +131,11 @@ public DeidentifyFileResponse deidentifyFile(DeidentifyFileRequest request) thro if (DeidentifyFileStatus.SUCCESS.value().equalsIgnoreCase(response.getStatus())) { String base64File = response.getFileBase64(); + response.getEntities().get(0).getFile(); if (base64File != null) { byte[] decodedBytes = Base64.getDecoder().decode(base64File); String outputDir = request.getOutputDirectory(); - String outputFileName = Constants.PROCESSED_FILE_NAME_PREFIX + fileName; + String outputFileName = Constants.PROCESSED_FILE_NAME_PREFIX + fileName.substring(0, fileName.lastIndexOf('.')) + "."+response.getExtension(); File outputFile; if (outputDir != null && !outputDir.isEmpty()) { outputFile = new File(outputDir, outputFileName); @@ -143,9 +149,31 @@ public DeidentifyFileResponse deidentifyFile(DeidentifyFileRequest request) thro } } + + List entities = response.getEntities(); + if (entities != null && !entities.isEmpty()) { + FileEntityInfo entityInfo = entities.get(0); + String entityBase64 = entityInfo.getFile(); + String outputDir = request.getOutputDirectory(); + if (entityBase64 != null) { + byte[] entityDecodedBytes = Base64.getDecoder().decode(entityBase64); + String entityFileName = Constants.PROCESSED_FILE_NAME_PREFIX + fileName.substring(0, fileName.lastIndexOf('.')) + ".json"; + File entityFile; + if (outputDir != null && !outputDir.isEmpty()) { + entityFile = new File(outputDir, entityFileName); + } else { + entityFile = new File(entityFileName); + } + try { + java.nio.file.Files.write(entityFile.toPath(), entityDecodedBytes); + } catch (IOException ioe) { + throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.FailedtoSaveProcessedFile.getMessage()); + } + } + } } } catch (ApiClientApiException e) { - String bodyString = gson.toJson(e.body()); + String bodyString = extractBodyAsString(e); LogUtil.printErrorLog(ErrorLogs.DEIDENTIFY_FILE_REQUEST_REJECTED.getLog()); throw new SkyflowException(e.statusCode(), e, e.headers(), bodyString); } @@ -212,6 +240,25 @@ private static synchronized DeidentifyFileResponse parseDeidentifyFileResponse(D String runId, String status) throws SkyflowException { DeidentifyFileOutput firstOutput = getFirstOutput(response); + if (firstOutput == null) { + return new DeidentifyFileResponse( + null, + null, + response.getOutputType().name(), + null, + null, + null, + response.getSize().orElse(null), + response.getDuration().orElse(null), + response.getPages().orElse(null), + response.getSlides().orElse(null), + getEntities(response), + runId, + response.getStatus().name(), + null + ); + } + Object wordCharObj = response.getAdditionalProperties().get("word_character_count"); Integer wordCount = null; Integer charCount = null; @@ -230,9 +277,8 @@ private static synchronized DeidentifyFileResponse parseDeidentifyFileResponse(D File processedFileObject = null; FileInfo fileInfo = null; - Optional processedFileBase64 = firstOutput != null ? firstOutput.getProcessedFile() : Optional.empty(); - Optional processedFileExtension = firstOutput != null ? firstOutput.getProcessedFileExtension() : Optional.empty(); - + Optional processedFileBase64 = Optional.of(firstOutput).flatMap(DeidentifyFileOutput::getProcessedFile); + Optional processedFileExtension = Optional.of(firstOutput).flatMap(DeidentifyFileOutput::getProcessedFileExtension); if (processedFileBase64.isPresent() && processedFileExtension.isPresent()) { try { byte[] decodedBytes = Base64.getDecoder().decode(processedFileBase64.get()); @@ -247,15 +293,22 @@ private static synchronized DeidentifyFileResponse parseDeidentifyFileResponse(D } } + String processedFileType = firstOutput.getProcessedFileType() + .map(Object::toString) + .orElse(DeidentifyStatusResponseOutputType.UNKNOWN.toString()); + + String fileExtension = firstOutput.getProcessedFileExtension() + .orElse(DeidentifyStatusResponseOutputType.UNKNOWN.toString()); + return new DeidentifyFileResponse( fileInfo, firstOutput.getProcessedFile().orElse(null), - firstOutput.getProcessedFileType().get().toString(), - firstOutput.getProcessedFileExtension().get(), + processedFileType, + fileExtension, wordCount, charCount, - response.getSize().map(Double::valueOf).orElse(null), - response.getDuration().map(Double::valueOf).orElse(null), + response.getSize().orElse(null), + response.getDuration().orElse(null), response.getPages().orElse(null), response.getSlides().orElse(null), getEntities(response), @@ -287,6 +340,13 @@ private static synchronized List getEntities(DeidentifyStatusRes return entities; } + private String extractBodyAsString(ApiClientApiException e) { + return e.statusCode() == 500 + ? e.body().toString() + : gson.toJson(e.body()); + } + + private com.skyflow.generated.rest.types.DeidentifyFileResponse processFileByType(String fileExtension, String base64Content, DeidentifyFileRequest request, String vaultId) throws SkyflowException { switch (fileExtension.toLowerCase()) { case "txt": @@ -367,7 +427,7 @@ public DeidentifyFileResponse getDetectRun(GetDetectRunRequest request) throws S return parseDeidentifyFileResponse(apiResponse, runId, apiResponse.getStatus().toString()); } catch (ApiClientApiException e) { - String bodyString = gson.toJson(e.body()); + String bodyString = extractBodyAsString(e); LogUtil.printErrorLog(ErrorLogs.GET_DETECT_RUN_REQUEST_REJECTED.getLog()); throw new SkyflowException(e.statusCode(), e, e.headers(), bodyString); } diff --git a/src/main/java/com/skyflow/vault/controller/VaultController.java b/src/main/java/com/skyflow/vault/controller/VaultController.java index 84e528b0..3c307c29 100644 --- a/src/main/java/com/skyflow/vault/controller/VaultController.java +++ b/src/main/java/com/skyflow/vault/controller/VaultController.java @@ -31,7 +31,7 @@ public VaultController(VaultConfig vaultConfig, Credentials credentials) { super(vaultConfig, credentials); } - private static synchronized HashMap getFormattedBatchInsertRecord(Object record, int requestIndex) { + private static synchronized HashMap getFormattedBatchInsertRecord(Object record, Integer requestIndex) { HashMap insertRecord = new HashMap<>(); String jsonString = gson.toJson(record); JsonObject bodyObject = JsonParser.parseString(jsonString).getAsJsonObject().get("Body").getAsJsonObject(); @@ -95,11 +95,9 @@ private static synchronized HashMap getFormattedUpdateRecord(V1U private static synchronized HashMap getFormattedQueryRecord(V1FieldRecords record) { HashMap queryRecord = new HashMap<>(); - Object fields = record.getFields(); - if (fields != null) { - String fieldsString = gson.toJson(fields); - JsonObject fieldsObject = JsonParser.parseString(fieldsString).getAsJsonObject(); - queryRecord.putAll(fieldsObject.asMap()); + Optional> fieldsOpt = record.getFields(); + if (fieldsOpt.isPresent()) { + queryRecord.putAll(fieldsOpt.get()); } return queryRecord; } @@ -124,7 +122,7 @@ public InsertResponse insert(InsertRequest insertRequest) throws SkyflowExceptio if (records.isPresent()) { List> recordList = records.get(); - for (int index = 0; index < recordList.size(); index++) { + for (Integer index = (Integer) 0; index < recordList.size(); index++) { Map record = recordList.get(index); HashMap insertRecord = getFormattedBatchInsertRecord(record, index); @@ -132,6 +130,7 @@ public InsertResponse insert(InsertRequest insertRequest) throws SkyflowExceptio insertedFields.add(insertRecord); } else { insertRecord.put("requestId", batchInsertResult.headers().get("x-request-id").get(0)); + insertRecord.put("httpCode", 400); errorFields.add(insertRecord); } } @@ -232,6 +231,7 @@ public GetResponse get(GetRequest getRequest) throws SkyflowException { .downloadUrl(getRequest.getDownloadURL()) .columnName(getRequest.getColumnName()) .columnValues(getRequest.getColumnValues()) + .fields(getRequest.getFields()) .orderBy(RecordServiceBulkGetRecordRequestOrderBy.valueOf(getRequest.getOrderBy())) .build(); diff --git a/src/main/java/com/skyflow/vault/data/GetRequest.java b/src/main/java/com/skyflow/vault/data/GetRequest.java index 04626e35..ee015482 100644 --- a/src/main/java/com/skyflow/vault/data/GetRequest.java +++ b/src/main/java/com/skyflow/vault/data/GetRequest.java @@ -63,7 +63,7 @@ public String getOrderBy() { public static final class GetRequestBuilder { private String table; private ArrayList ids; - private RedactionType redactionType; + private RedactionType redactionType = RedactionType.DEFAULT; private Boolean returnTokens; private ArrayList fields; private String offset; diff --git a/src/main/java/com/skyflow/vault/data/GetResponse.java b/src/main/java/com/skyflow/vault/data/GetResponse.java index 41821969..34a01303 100644 --- a/src/main/java/com/skyflow/vault/data/GetResponse.java +++ b/src/main/java/com/skyflow/vault/data/GetResponse.java @@ -24,7 +24,7 @@ public ArrayList> getErrors() { @Override public String toString() { - Gson gson = new Gson(); + Gson gson = new Gson().newBuilder().serializeNulls().create(); return gson.toJson(this); } } diff --git a/src/main/java/com/skyflow/vault/data/InsertResponse.java b/src/main/java/com/skyflow/vault/data/InsertResponse.java index a4f97967..3d311525 100644 --- a/src/main/java/com/skyflow/vault/data/InsertResponse.java +++ b/src/main/java/com/skyflow/vault/data/InsertResponse.java @@ -24,7 +24,7 @@ public ArrayList> getErrors() { @Override public String toString() { - Gson gson = new Gson(); + Gson gson = new Gson().newBuilder().serializeNulls().create(); return gson.toJson(this); } } diff --git a/src/main/java/com/skyflow/vault/tokens/DetokenizeData.java b/src/main/java/com/skyflow/vault/tokens/DetokenizeData.java index 33bba2b9..0e1b6b63 100644 --- a/src/main/java/com/skyflow/vault/tokens/DetokenizeData.java +++ b/src/main/java/com/skyflow/vault/tokens/DetokenizeData.java @@ -8,12 +8,12 @@ public class DetokenizeData { public DetokenizeData(String token) { this.token = token; - this.redactionType = RedactionType.PLAIN_TEXT; + this.redactionType = RedactionType.DEFAULT; } public DetokenizeData(String token, RedactionType redactionType) { this.token = token; - this.redactionType = redactionType == null ? RedactionType.PLAIN_TEXT : redactionType; + this.redactionType = redactionType == null ? RedactionType.DEFAULT : redactionType; } public String getToken() { diff --git a/src/main/java/com/skyflow/vault/tokens/DetokenizeResponse.java b/src/main/java/com/skyflow/vault/tokens/DetokenizeResponse.java index 31ff64b2..bd1d7cde 100644 --- a/src/main/java/com/skyflow/vault/tokens/DetokenizeResponse.java +++ b/src/main/java/com/skyflow/vault/tokens/DetokenizeResponse.java @@ -1,6 +1,9 @@ package com.skyflow.vault.tokens; +import com.google.gson.ExclusionStrategy; +import com.google.gson.FieldAttributes; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import java.util.ArrayList; @@ -23,7 +26,29 @@ public ArrayList getErrors() { @Override public String toString() { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .serializeNulls() + .registerTypeAdapter( + DetokenizeRecordResponse.class, + (com.google.gson.JsonSerializer) (src, typeOfSrc, context) -> { + com.google.gson.JsonObject obj = new com.google.gson.JsonObject(); + obj.addProperty("token", src.getToken()); + if (src.getValue() != null) { + obj.addProperty("value", src.getValue()); + } + if (src.getType() != null) { + obj.addProperty("type", src.getType()); + } + if (src.getError() != null) { + obj.add("error", context.serialize(src.getError())); + } + if (src.getRequestId() != null) { + obj.addProperty("requestId", src.getRequestId()); + } + return obj; + } + ) + .create(); return gson.toJson(this); } } diff --git a/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java b/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java index 89e0643b..e2a1d921 100644 --- a/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java +++ b/src/test/java/com/skyflow/errors/SkyflowExceptionTest.java @@ -3,10 +3,7 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class SkyflowExceptionTest { @@ -38,6 +35,8 @@ public void testConstructorWithCodeAndMessage() { Assert.assertEquals(Integer.valueOf(400), Integer.valueOf(ex.getHttpCode())); Assert.assertEquals("Bad Request", ex.getMessage()); Assert.assertEquals("Bad Request", ex.toString().contains("Bad Request") ? "Bad Request" : null); + Assert.assertNotNull(ex.getDetails()); + Assert.assertEquals(0, ex.getDetails().size()); } @Test @@ -49,7 +48,7 @@ public void testToStringFormat() { } @Test - public void testConstructorWithJsonErrorBody() { + public void testConstructorWithJsonErrorBodyArrayDetailsNonEmpty() { String json = "{\"error\":{\"message\":\"json error\",\"grpc_code\":7,\"http_status\":\"NOT_FOUND\",\"details\":[{\"info\":\"detail1\"}]}}"; Map> headers = new HashMap<>(); headers.put("x-request-id", Collections.singletonList("req-123")); @@ -62,21 +61,29 @@ public void testConstructorWithJsonErrorBody() { Assert.assertTrue(ex.getDetails().size() > 0); } + @Test + public void testConstructorWithJsonErrorBodyArrayDetailsEmpty() { + String json = "{\"error\":{\"message\":\"json error\",\"grpc_code\":7,\"http_status\":\"NOT_FOUND\",\"details\":[]}}"; + Map> headers = new HashMap<>(); + SkyflowException ex = new SkyflowException(404, new RuntimeException("fail"), headers, json); + Assert.assertEquals("json error", ex.getMessage()); + Assert.assertEquals(Integer.valueOf(7), ex.getGrpcCode()); + Assert.assertEquals("NOT_FOUND", ex.getHttpStatus()); + Assert.assertNotNull(ex.getDetails()); + Assert.assertEquals(0, ex.getDetails().size()); + } @Test public void testConstructorWithNullErrorBody() { Map> headers = new HashMap<>(); SkyflowException ex = new SkyflowException(500, new RuntimeException("fail"), headers, null); - Assert.assertNull(ex.getMessage()); + Assert.assertEquals("fail", ex.getMessage()); Assert.assertNull(ex.getGrpcCode()); - Assert.assertNull(ex.getHttpStatus()); } @Test public void testGettersAndSetters() { SkyflowException ex = new SkyflowException("msg"); - // Simulate setting fields via reflection or constructor - // (getters are already tested above) Assert.assertNull(ex.getRequestId()); Assert.assertNull(ex.getDetails()); Assert.assertNull(ex.getGrpcCode()); @@ -95,4 +102,39 @@ public void testSetDetailsWithErrorFromClientHeader() { Assert.assertEquals(1, ex.getDetails().size()); Assert.assertEquals("client error", ex.getDetails().get(0).getAsJsonObject().get("errorFromClient").getAsString()); } + + @Test + public void testSetDetailsWithErrorFromClientHeaderAndNullDetails() { + String json = "{\"error\":{\"message\":\"test error\",\"grpc_code\":13}}"; + Map> headers = new HashMap<>(); + headers.put("error-from-client", Collections.singletonList("client error")); + + SkyflowException ex = new SkyflowException(500, new RuntimeException("fail"), headers, json); + + Assert.assertNotNull(ex.getDetails()); + Assert.assertEquals(1, ex.getDetails().size()); + Assert.assertEquals("client error", ex.getDetails().get(0).getAsJsonObject().get("errorFromClient").getAsString()); + } + + @Test + public void testSetDetailsWithNoErrorFromClientHeaderAndEmptyDetails() { + String json = "{\"error\":{\"message\":\"test error\",\"grpc_code\":13,\"details\":[]}}"; + Map> headers = new HashMap<>(); + + SkyflowException ex = new SkyflowException(500, new RuntimeException("fail"), headers, json); + + Assert.assertNotNull(ex.getDetails()); + Assert.assertEquals(0, ex.getDetails().size()); + } + + @Test + public void testToStringWithNullFields() { + SkyflowException ex = new SkyflowException("msg"); + String str = ex.toString(); + Assert.assertTrue(str.contains("requestId: null")); + Assert.assertTrue(str.contains("grpcCode: null")); + Assert.assertTrue(str.contains("httpCode: null")); + Assert.assertTrue(str.contains("httpStatus: null")); + Assert.assertTrue(str.contains("details: null")); + } } \ No newline at end of file diff --git a/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java b/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java index 42ad9bc7..af501a01 100644 --- a/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java +++ b/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java @@ -213,9 +213,13 @@ public void testInvalidKeySpecInCredentials() { public void testSignedDataTokenResponse() { try { String signedToken = "test_signed_data_token"; - SignedDataTokenResponse response = new SignedDataTokenResponse(dataToken, signedToken); - String responseString = "{\"token\":\"" + dataToken + "\"," + - "\"signedToken\":\"signed_token_" + signedToken + "\"}"; + SignedDataTokenResponse response = new SignedDataTokenResponse(dataToken, signedToken, null); + String responseString = "{" + + "\"token\":\"" + dataToken + "\"," + + "\"signedToken\":\"signed_token_" + signedToken + "\"," + + "\"errors\":null" + + "}"; + Assert.assertEquals(responseString, response.toString()); Assert.assertEquals(dataToken, response.getToken()); Assert.assertEquals("signed_token_" + signedToken, response.getSignedToken()); diff --git a/src/test/java/com/skyflow/vault/connection/InvokeConnectionTests.java b/src/test/java/com/skyflow/vault/connection/InvokeConnectionTests.java index a29a3335..63717b5c 100644 --- a/src/test/java/com/skyflow/vault/connection/InvokeConnectionTests.java +++ b/src/test/java/com/skyflow/vault/connection/InvokeConnectionTests.java @@ -425,9 +425,11 @@ public void testInvokeConnectionResponse() { data.addProperty("test_key_2", "test_value_2"); HashMap metadata = new HashMap<>(); metadata.put("requestId", "12345"); - InvokeConnectionResponse connectionResponse = new InvokeConnectionResponse(data, metadata); + InvokeConnectionResponse connectionResponse = new InvokeConnectionResponse(data, metadata, null); String responseString = "{\"data\":{\"test_key_1\":\"test_value_1\",\"test_key_2\":\"test_value_2\"}," + - "\"metadata\":{\"requestId\":\"12345\"}}"; + "\"metadata\":{\"requestId\":\"12345\"}," + + "\"errors\":null}"; + Assert.assertNotNull(connectionResponse.getData()); Assert.assertEquals(responseString, connectionResponse.toString()); Assert.assertEquals(1, connectionResponse.getMetadata().size()); diff --git a/src/test/java/com/skyflow/vault/tokens/DetokenizeTests.java b/src/test/java/com/skyflow/vault/tokens/DetokenizeTests.java index ed6804b5..d417aeb7 100644 --- a/src/test/java/com/skyflow/vault/tokens/DetokenizeTests.java +++ b/src/test/java/com/skyflow/vault/tokens/DetokenizeTests.java @@ -136,7 +136,7 @@ public void testRedactionAndContinueOnErrorInDetokenizeRequestValidations() { detokenizeData(detokenizeData).continueOnError(null).build(); try { Validations.validateDetokenizeRequest(request); - Assert.assertEquals(RedactionType.PLAIN_TEXT, request.getDetokenizeData().get(0).getRedactionType()); + Assert.assertEquals(RedactionType.DEFAULT, request.getDetokenizeData().get(0).getRedactionType()); Assert.assertFalse(request.getContinueOnError()); Assert.assertFalse(request.getDownloadURL()); } catch (SkyflowException e) {