diff --git a/pom.xml b/pom.xml index 38869a73..d0895606 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.skyflow skyflow-java - 2.0.0 + 3.0.0-beta.6-dev.ad00cc3 jar ${project.groupId}:${project.artifactId} @@ -42,6 +42,7 @@ 4.13.2 2.3.1 1.3.5 + ${project.version} @@ -139,6 +140,12 @@ + + + src/main/resources + true + + org.apache.maven.plugins diff --git a/src/main/java/com/skyflow/VaultClient.java b/src/main/java/com/skyflow/VaultClient.java index edb8ee47..b6974f5d 100644 --- a/src/main/java/com/skyflow/VaultClient.java +++ b/src/main/java/com/skyflow/VaultClient.java @@ -17,16 +17,15 @@ import com.skyflow.generated.rest.resources.records.requests.RecordServiceBatchOperationBody; import com.skyflow.generated.rest.resources.records.requests.RecordServiceInsertRecordBody; import com.skyflow.generated.rest.resources.records.requests.RecordServiceUpdateRecordBody; -import com.skyflow.generated.rest.resources.records.requests.UploadFileV2Request; import com.skyflow.generated.rest.resources.strings.StringsClient; import com.skyflow.generated.rest.resources.strings.requests.DeidentifyStringRequest; import com.skyflow.generated.rest.resources.strings.requests.ReidentifyStringRequest; -import com.skyflow.generated.rest.resources.strings.types.ReidentifyStringRequestFormat; +import com.skyflow.generated.rest.resources.strings.types.DeidentifyStringRequestEntityTypesItem; import com.skyflow.generated.rest.resources.tokens.TokensClient; import com.skyflow.generated.rest.resources.tokens.requests.V1DetokenizePayload; import com.skyflow.generated.rest.resources.tokens.requests.V1TokenizePayload; -import com.skyflow.generated.rest.types.*; import com.skyflow.generated.rest.types.Transformations; +import com.skyflow.generated.rest.types.*; import com.skyflow.logs.InfoLogs; import com.skyflow.serviceaccount.util.Token; import com.skyflow.utils.Constants; @@ -36,9 +35,8 @@ import com.skyflow.vault.data.FileUploadRequest; import com.skyflow.vault.data.InsertRequest; import com.skyflow.vault.data.UpdateRequest; -import com.skyflow.vault.detect.*; import com.skyflow.vault.detect.DeidentifyFileRequest; -import com.skyflow.vault.detect.DeidentifyTextRequest; +import com.skyflow.vault.detect.*; import com.skyflow.vault.tokens.ColumnValue; import com.skyflow.vault.tokens.DetokenizeData; import com.skyflow.vault.tokens.DetokenizeRequest; @@ -49,7 +47,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.nio.file.Paths; import java.util.*; import java.util.stream.Collectors; @@ -84,7 +81,7 @@ protected StringsClient getDetectTextApi() { return this.apiClient.strings(); } - protected FilesClient getDetectFileAPi(){ + protected FilesClient getDetectFileAPi() { return this.apiClient.files(); } @@ -218,14 +215,12 @@ protected V1TokenizePayload getTokenizePayload(TokenizeRequest request) { protected File getFileForFileUpload(FileUploadRequest fileUploadRequest) throws IOException { if (fileUploadRequest.getFilePath() != null) { return new File(fileUploadRequest.getFilePath()); - } - else if (fileUploadRequest.getBase64() != null) { + } else if (fileUploadRequest.getBase64() != null) { byte[] decodedBytes = Base64.getDecoder().decode(fileUploadRequest.getBase64()); File file = new File(fileUploadRequest.getFileName()); Files.write(file.toPath(), decodedBytes); return file; - } - else if (fileUploadRequest.getFileObject() != null) { + } else if (fileUploadRequest.getFileObject() != null) { return fileUploadRequest.getFileObject(); } return null; @@ -236,7 +231,7 @@ protected void setBearerToken() throws SkyflowException { Validations.validateCredentials(this.finalCredentials); if (this.finalCredentials.getApiKey() != null) { LogUtil.printInfoLog(InfoLogs.REUSE_API_KEY.getLog()); - token=this.finalCredentials.getApiKey(); + token = this.finalCredentials.getApiKey(); } else if (Token.isExpired(token)) { LogUtil.printInfoLog(InfoLogs.BEARER_TOKEN_EXPIRED.getLog()); token = Utils.generateBearerToken(this.finalCredentials); @@ -248,60 +243,73 @@ protected void setBearerToken() throws SkyflowException { } protected DeidentifyTextResponse getDeIdentifyTextResponse(DeidentifyStringResponse deidentifyStringResponse) { - List entities = deidentifyStringResponse.getEntities() != null - ? deidentifyStringResponse.getEntities().stream() - .map(this::convertDetectedEntityToEntityInfo) - .collect(Collectors.toList()) - : null; + Optional> detectedEntities = deidentifyStringResponse.getEntities(); + + List entities = new ArrayList<>(); + + if (detectedEntities.isPresent()) { + for (StringResponseEntities e : detectedEntities.get()) { + entities.add(convertDetectedEntityToEntityInfo(e)); + } + } return new DeidentifyTextResponse( - deidentifyStringResponse.getProcessedText(), + deidentifyStringResponse.getProcessedText().get(), entities, - deidentifyStringResponse.getWordCount(), - deidentifyStringResponse.getCharacterCount() + deidentifyStringResponse.getWordCount().get(), + deidentifyStringResponse.getCharacterCount().get() ); } protected DeidentifyStringRequest getDeidentifyStringRequest(DeidentifyTextRequest deIdentifyTextRequest, String vaultId) throws SkyflowException { List entities = deIdentifyTextRequest.getEntities(); - List mappedEntityTypes = null; + List mappedEntityTypes = null; if (entities != null) { mappedEntityTypes = deIdentifyTextRequest.getEntities().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> DeidentifyStringRequestEntityTypesItem.valueOf(detectEntity.name())) .collect(Collectors.toList()); } TokenFormat tokenFormat = deIdentifyTextRequest.getTokenFormat(); - Optional> vaultToken = Optional.empty(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> vaultToken = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(deIdentifyTextRequest.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(deIdentifyTextRequest.getRestrictRegexList()); Optional transformations = Optional.ofNullable(getTransformations(deIdentifyTextRequest.getTransformations())); if (tokenFormat != null) { if (tokenFormat.getVaultToken() != null && !tokenFormat.getVaultToken().isEmpty()) { - vaultToken = Optional.of(tokenFormat.getVaultToken().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + vaultToken = Optional.of( + tokenFormat.getVaultToken().stream() + .map(detectEntity -> TokenTypeMappingVaultTokenItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ); } + if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) { - entityTypes = Optional.of(tokenFormat.getEntityOnly().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + entityTypes = Optional.of( + tokenFormat.getEntityOnly().stream() + .map(detectEntity -> TokenTypeMappingEntityOnlyItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ); } + if (tokenFormat.getEntityUniqueCounter() != null && !tokenFormat.getEntityUniqueCounter().isEmpty()) { - entityUniqueCounter = Optional.of(tokenFormat.getEntityUniqueCounter().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + entityUniqueCounter = Optional.of( + tokenFormat.getEntityUniqueCounter().stream() + .map(detectEntity -> TokenTypeMappingEntityUnqCounterItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ); } + } - TokenType tokenType = TokenType.builder() + TokenTypeMapping tokenType = TokenTypeMapping.builder() .vaultToken(vaultToken) .entityOnly(entityTypes) .entityUnqCounter(entityUniqueCounter) @@ -309,8 +317,8 @@ protected DeidentifyStringRequest getDeidentifyStringRequest(DeidentifyTextReque return DeidentifyStringRequest.builder() - .vaultId(vaultId) .text(deIdentifyTextRequest.getText()) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -320,29 +328,29 @@ protected DeidentifyStringRequest getDeidentifyStringRequest(DeidentifyTextReque } protected ReidentifyStringRequest getReidentifyStringRequest(ReidentifyTextRequest reidentifyTextRequest, String vaultId) throws SkyflowException { - List maskEntities = null; - List redactedEntities = null; - List plaintextEntities = null; + Optional> maskEntities = null; + Optional> redactedEntities = null; + Optional> plaintextEntities = null; if (reidentifyTextRequest.getMaskedEntities() != null) { - maskEntities = reidentifyTextRequest.getMaskedEntities().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList()); + maskEntities = Optional.of(reidentifyTextRequest.getMaskedEntities().stream() + .map(detectEntity -> FormatMaskedItem.valueOf(detectEntity.name())) + .collect(Collectors.toList())); } if (reidentifyTextRequest.getPlainTextEntities() != null) { - plaintextEntities = reidentifyTextRequest.getPlainTextEntities().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList()); + plaintextEntities = Optional.of(reidentifyTextRequest.getPlainTextEntities().stream() + .map(detectEntity -> FormatPlaintextItem.valueOf(detectEntity.name())) + .collect(Collectors.toList())); } if (reidentifyTextRequest.getRedactedEntities() != null) { - redactedEntities = reidentifyTextRequest.getRedactedEntities().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList()); + redactedEntities = Optional.of(reidentifyTextRequest.getRedactedEntities().stream() + .map(detectEntity -> FormatRedactedItem.valueOf(detectEntity.name())) + .collect(Collectors.toList())); } - ReidentifyStringRequestFormat reidentifyStringRequestFormat = ReidentifyStringRequestFormat.builder() + Format reidentifyStringRequestFormat = Format.builder() .masked(maskEntities) .plaintext(plaintextEntities) .redacted(redactedEntities) @@ -357,7 +365,7 @@ protected ReidentifyStringRequest getReidentifyStringRequest(ReidentifyTextReque } - private EntityInfo convertDetectedEntityToEntityInfo(DetectedEntity detectedEntity) { + private EntityInfo convertDetectedEntityToEntityInfo(StringResponseEntities detectedEntity) { TextIndex textIndex = new TextIndex( detectedEntity.getLocation().get().getStartIndex().orElse(0), detectedEntity.getLocation().get().getEndIndex().orElse(0) @@ -391,17 +399,17 @@ private Transformations getTransformations(com.skyflow.vault.detect.Transformati return null; } - List entityTypes = null; + Optional> entityTypes = null; if (!transformations.getShiftDates().getEntities().isEmpty()) { - entityTypes = transformations.getShiftDates().getEntities().stream() - .map(entity -> TransformationsShiftDatesEntityTypesItem.valueOf(entity.name())) - .collect(Collectors.toList()); + entityTypes = Optional.of(transformations.getShiftDates().getEntities().stream() + .map(entity -> ShiftDatesEntityTypesItem.valueOf(entity.name())) + .collect(Collectors.toList())); } else { - entityTypes = Collections.emptyList(); + entityTypes = Optional.of(Collections.emptyList()); } return Transformations.builder() - .shiftDates(TransformationsShiftDates.builder() + .shiftDates(ShiftDates.builder() .maxDays(transformations.getShiftDates().getMax()) .minDays(transformations.getShiftDates().getMin()) .entityTypes(entityTypes) @@ -409,24 +417,22 @@ private Transformations getTransformations(com.skyflow.vault.detect.Transformati .build(); } - private List getEntityTypes(List entities){ - List mappedEntityTypes = null; - if (entities != null) { - mappedEntityTypes = entities.stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList()); - } + private > List getEntityTypes(List entities, Class type) { + if (entities == null) return Collections.emptyList(); - return mappedEntityTypes; + return entities.stream() + .map(e -> Enum.valueOf(type, e.name())) + .collect(Collectors.toList()); } - protected com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest getDeidentifyTextFileRequest(DeidentifyFileRequest request, String vaultId, String base64Content){ - List mappedEntityTypes = getEntityTypes(request.getEntities()); + + protected com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText getDeidentifyTextFileRequest(DeidentifyFileRequest request, String vaultId, String base64Content) { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileRequestDeidentifyTextEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); @@ -435,31 +441,31 @@ protected com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequ if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) { entityTypes = Optional.of(tokenFormat.getEntityOnly().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> TokenTypeMappingEntityOnlyItem.valueOf(detectEntity.name())) .collect(Collectors.toList())); } if (tokenFormat.getEntityUniqueCounter() != null && !tokenFormat.getEntityUniqueCounter().isEmpty()) { entityUniqueCounter = Optional.of(tokenFormat.getEntityUniqueCounter().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> TokenTypeMappingEntityUnqCounterItem.valueOf(detectEntity.name())) .collect(Collectors.toList())); } } - TokenTypeWithoutVault tokenType = TokenTypeWithoutVault.builder() + TokenTypeMapping tokenType = TokenTypeMapping.builder() .entityOnly(entityTypes) .entityUnqCounter(entityUniqueCounter) .build(); - DeidentifyTextRequestFile file = DeidentifyTextRequestFile.builder() + FileDataDeidentifyText file = FileDataDeidentifyText.builder() .base64(base64Content) .build(); // Build the final request - com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest req = - com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest.builder() - .vaultId(vaultId) + com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText req = + com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText.builder() .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -471,54 +477,62 @@ protected com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequ } - protected DeidentifyAudioRequest getDeidentifyAudioRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String dataFormat) throws SkyflowException { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileAudioRequestDeidentifyAudio getDeidentifyAudioRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String dataFormat) throws SkyflowException { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + 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()) { - entityTypes = Optional.of(tokenFormat.getEntityOnly().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + entityTypes = Optional.of( + tokenFormat.getEntityOnly().stream() + .map(detectEntity -> DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ).map(list -> (List) (List) list); } + if (tokenFormat.getEntityUniqueCounter() != null && !tokenFormat.getEntityUniqueCounter().isEmpty()) { - entityUniqueCounter = Optional.of(tokenFormat.getEntityUniqueCounter().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + entityUniqueCounter = Optional.of( + (List) (List) + tokenFormat.getEntityUniqueCounter().stream() + .map(detectEntity -> DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ); } + } - TokenTypeWithoutVault tokenType = TokenTypeWithoutVault.builder() + TokenTypeMapping tokenType = TokenTypeMapping.builder() .entityOnly(entityTypes) .entityUnqCounter(entityUniqueCounter) .build(); - DeidentifyAudioRequestFile deidentifyAudioRequestFile = DeidentifyAudioRequestFile.builder().base64(base64Content).dataFormat(mapAudioDataFormat(dataFormat)).build(); + FileDataDeidentifyAudio deidentifyAudioRequestFile = FileDataDeidentifyAudio.builder().base64(base64Content).dataFormat(mapAudioDataFormat(dataFormat)).build(); DetectOutputTranscriptions transcription = request.getOutputTranscription(); - DeidentifyAudioRequestOutputTranscription outputTranscriptionType = null; + Optional outputTranscriptionType = null; if (transcription != null) { - outputTranscriptionType = DeidentifyAudioRequestOutputTranscription.valueOf(transcription.name()); + outputTranscriptionType = Optional.of(DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription.valueOf(transcription.name())); } - return DeidentifyAudioRequest.builder() - .vaultId(vaultId) + return DeidentifyFileAudioRequestDeidentifyAudio.builder() .file(deidentifyAudioRequestFile) + .vaultId(vaultId) .allowRegex(allowRegex) .restrictRegex(restrictRegex) .entityTypes(mappedEntityTypes) - .bleepFrequency(request.getBleep() != null ? request.getBleep().getFrequency() : null) - .bleepGain(request.getBleep() != null ? request.getBleep().getGain() : null) - .bleepStartPadding(request.getBleep() != null ? request.getBleep().getStartPadding() : null) - .bleepStopPadding(request.getBleep() != null ? request.getBleep().getStopPadding() : null) + .bleepFrequency(request.getBleep() != null + ? (int) Math.round(request.getBleep().getFrequency()) + : null) + .bleepGain(request.getBleep() != null ? (int) Math.round(request.getBleep().getGain()) : null) + .bleepStartPadding(request.getBleep() != null ? (float) Math.round(request.getBleep().getStartPadding()) : null) + .bleepStopPadding(request.getBleep() != null ? (float) Math.round(request.getBleep().getStopPadding()) : null) .outputProcessedAudio(request.getOutputProcessedAudio()) .outputTranscription(outputTranscriptionType) .tokenType(tokenType) @@ -526,43 +540,48 @@ protected DeidentifyAudioRequest getDeidentifyAudioRequest(DeidentifyFileRequest .build(); } - protected DeidentifyPdfRequest getDeidentifyPdfRequest(DeidentifyFileRequest request, String vaultId, String base64Content) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileDocumentPdfRequestDeidentifyPdf getDeidentifyPdfRequest(DeidentifyFileRequest request, String vaultId, String base64Content) { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); if (tokenFormat != null) { if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) { - entityTypes = Optional.of(tokenFormat.getEntityOnly().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + entityTypes = Optional.of( + (List) (List) + tokenFormat.getEntityOnly().stream() + .map(detectEntity -> DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ); } if (tokenFormat.getEntityUniqueCounter() != null && !tokenFormat.getEntityUniqueCounter().isEmpty()) { - entityUniqueCounter = Optional.of(tokenFormat.getEntityUniqueCounter().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) - .collect(Collectors.toList())); + entityUniqueCounter = Optional.of( + (List) (List) + tokenFormat.getEntityUniqueCounter().stream() + .map(detectEntity -> DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem.valueOf(detectEntity.name())) + .collect(Collectors.toList()) + ); } + } - TokenTypeWithoutVault tokenType = TokenTypeWithoutVault.builder() + TokenTypeMapping tokenType = TokenTypeMapping.builder() .entityOnly(entityTypes) .entityUnqCounter(entityUniqueCounter) .build(); - DeidentifyPdfRequestFile file = DeidentifyPdfRequestFile.builder() + FileDataDeidentifyPdf file = FileDataDeidentifyPdf.builder() .base64(base64Content) .build(); - return DeidentifyPdfRequest.builder() - .vaultId(vaultId) + return DeidentifyFileDocumentPdfRequestDeidentifyPdf.builder() .file(file) - .density(request.getPixelDensity() != null ? request.getPixelDensity().doubleValue() : null) - .maxResolution(request.getMaxResolution() != null ? request.getMaxResolution().doubleValue() : null) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -570,30 +589,30 @@ protected DeidentifyPdfRequest getDeidentifyPdfRequest(DeidentifyFileRequest req .build(); } - protected DeidentifyImageRequest getDeidentifyImageRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileImageRequestDeidentifyImage getDeidentifyImageRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileImageRequestDeidentifyImageEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); + TokenTypeMapping tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); - DeidentifyImageRequestFile file = DeidentifyImageRequestFile.builder() + FileDataDeidentifyImage file = FileDataDeidentifyImage.builder() .base64(base64Content) - .dataFormat(DeidentifyImageRequestFileDataFormat.valueOf(format.toUpperCase())) + .dataFormat(FileDataDeidentifyImageDataFormat.valueOf(format.toUpperCase())) .build(); - Optional maskingMethod = Optional.empty(); + Optional maskingMethod = Optional.empty(); if (request.getMaskingMethod() != null) { - maskingMethod = Optional.of(DeidentifyImageRequestMaskingMethod.valueOf(request.getMaskingMethod().name())); + maskingMethod = Optional.of(DeidentifyFileImageRequestDeidentifyImageMaskingMethod.valueOf(request.getMaskingMethod().name())); } - return DeidentifyImageRequest.builder() - .vaultId(vaultId) + return DeidentifyFileImageRequestDeidentifyImage.builder() .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .maskingMethod(maskingMethod) .tokenType(tokenType) @@ -604,25 +623,25 @@ protected DeidentifyImageRequest getDeidentifyImageRequest(DeidentifyFileRequest .build(); } - protected DeidentifyPresentationRequest getDeidentifyPresentationRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileRequestDeidentifyPresentation getDeidentifyPresentationRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileRequestDeidentifyPresentationEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); + TokenTypeMapping tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); - DeidentifyPresentationRequestFile file = DeidentifyPresentationRequestFile.builder() + FileDataDeidentifyPresentation file = FileDataDeidentifyPresentation.builder() .base64(base64Content) - .dataFormat(DeidentifyPresentationRequestFileDataFormat.valueOf(format.toUpperCase())) + .dataFormat(FileDataDeidentifyPresentationDataFormat.valueOf(format.toUpperCase())) .build(); - return DeidentifyPresentationRequest.builder() - .vaultId(vaultId) + return DeidentifyFileRequestDeidentifyPresentation.builder() .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -630,25 +649,25 @@ protected DeidentifyPresentationRequest getDeidentifyPresentationRequest(Deident .build(); } - protected DeidentifySpreadsheetRequest getDeidentifySpreadsheetRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileRequestDeidentifySpreadsheet getDeidentifySpreadsheetRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); + TokenTypeMapping tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); - DeidentifySpreadsheetRequestFile file = DeidentifySpreadsheetRequestFile.builder() + FileDataDeidentifySpreadsheet file = FileDataDeidentifySpreadsheet.builder() .base64(base64Content) - .dataFormat(DeidentifySpreadsheetRequestFileDataFormat.valueOf(format.toUpperCase())) + .dataFormat(FileDataDeidentifySpreadsheetDataFormat.valueOf(format.toUpperCase())) .build(); - return DeidentifySpreadsheetRequest.builder() - .vaultId(vaultId) + return DeidentifyFileRequestDeidentifySpreadsheet.builder() .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -656,26 +675,26 @@ protected DeidentifySpreadsheetRequest getDeidentifySpreadsheetRequest(Deidentif .build(); } - protected DeidentifyStructuredTextRequest getDeidentifyStructuredTextRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileRequestDeidentifyStructuredText getDeidentifyStructuredTextRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { + List mappedEntityTypes = getEntityTypes(request.getEntities(), DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + 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); + TokenTypeMapping tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); - DeidentifyStructuredTextRequestFile file = DeidentifyStructuredTextRequestFile.builder() + FileDataDeidentifyStructuredText file = FileDataDeidentifyStructuredText.builder() .base64(base64Content) - .dataFormat(DeidentifyStructuredTextRequestFileDataFormat.valueOf(format.toUpperCase())) + .dataFormat(FileDataDeidentifyStructuredTextDataFormat.valueOf(format.toUpperCase())) .build(); - return DeidentifyStructuredTextRequest.builder() - .vaultId(vaultId) + return DeidentifyFileRequestDeidentifyStructuredText.builder() .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -684,25 +703,26 @@ protected DeidentifyStructuredTextRequest getDeidentifyStructuredTextRequest(Dei .build(); } - protected DeidentifyDocumentRequest getDeidentifyDocumentRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + protected DeidentifyFileRequestDeidentifyDocument getDeidentifyDocumentRequest(DeidentifyFileRequest request, String vaultId, String base64Content, String format) { + List mappedEntityTypes = + getEntityTypes(request.getEntities(), DeidentifyFileRequestDeidentifyDocumentEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); - TokenTypeWithoutVault tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); + TokenTypeMapping tokenType = buildTokenType(tokenFormat, entityTypes, entityUniqueCounter); - DeidentifyDocumentRequestFile file = DeidentifyDocumentRequestFile.builder() + FileDataDeidentifyDocument file = FileDataDeidentifyDocument.builder() .base64(base64Content) - .dataFormat(DeidentifyDocumentRequestFileDataFormat.valueOf(format.toUpperCase())) + .dataFormat(FileDataDeidentifyDocumentDataFormat.valueOf(format.toUpperCase())) .build(); - return DeidentifyDocumentRequest.builder() - .vaultId(vaultId) + return DeidentifyFileRequestDeidentifyDocument.builder() .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -713,12 +733,13 @@ protected DeidentifyDocumentRequest getDeidentifyDocumentRequest(DeidentifyFileR protected com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequest getDeidentifyGenericFileRequest( DeidentifyFileRequest request, String vaultId, String base64Content, String fileExtension) { - List mappedEntityTypes = getEntityTypes(request.getEntities()); + List mappedEntityTypes = + getEntityTypes(request.getEntities(), DeidentifyFileRequestEntityTypesItem.class); TokenFormat tokenFormat = request.getTokenFormat(); - Optional> entityTypes = Optional.empty(); - Optional> entityUniqueCounter = Optional.empty(); + Optional> entityTypes = Optional.empty(); + Optional> entityUniqueCounter = Optional.empty(); Optional> allowRegex = Optional.ofNullable(request.getAllowRegexList()); Optional> restrictRegex = Optional.ofNullable(request.getRestrictRegexList()); Optional transformations = Optional.ofNullable(getTransformations(request.getTransformations())); @@ -726,31 +747,31 @@ protected com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequ if (tokenFormat != null) { if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) { entityTypes = Optional.of(tokenFormat.getEntityOnly().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> TokenTypeMappingEntityOnlyItem.valueOf(detectEntity.name())) .collect(Collectors.toList())); } if (tokenFormat.getEntityUniqueCounter() != null && !tokenFormat.getEntityUniqueCounter().isEmpty()) { entityUniqueCounter = Optional.of(tokenFormat.getEntityUniqueCounter().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> TokenTypeMappingEntityUnqCounterItem.valueOf(detectEntity.name())) .collect(Collectors.toList())); } } - TokenTypeWithoutVault tokenType = TokenTypeWithoutVault.builder() + TokenTypeMapping tokenType = TokenTypeMapping.builder() .entityOnly(entityTypes) .entityUnqCounter(entityUniqueCounter) .build(); - DeidentifyFileRequestFile file = - DeidentifyFileRequestFile.builder() + FileData file = + FileData.builder() .base64(base64Content) - .dataFormat(fileExtension != null ? DeidentifyFileRequestFileDataFormat.valueOf(fileExtension.toUpperCase()) : null) + .dataFormat(fileExtension != null ? FileDataDataFormat.valueOf(fileExtension.toUpperCase()) : null) .build(); return com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequest.builder() - .vaultId(vaultId) .file(file) + .vaultId(vaultId) .entityTypes(mappedEntityTypes) .tokenType(tokenType) .allowRegex(allowRegex) @@ -759,36 +780,38 @@ protected com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequ .build(); } - private TokenTypeWithoutVault buildTokenType(TokenFormat tokenFormat, - Optional> entityTypes, - Optional> entityUniqueCounter) { + private TokenTypeMapping buildTokenType(TokenFormat tokenFormat, + Optional> entityTypes, + Optional> entityUniqueCounter) { if (tokenFormat != null) { if (tokenFormat.getEntityOnly() != null && !tokenFormat.getEntityOnly().isEmpty()) { entityTypes = Optional.of(tokenFormat.getEntityOnly().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> TokenTypeMappingEntityOnlyItem.valueOf(detectEntity.name())) .collect(Collectors.toList())); } if (tokenFormat.getEntityUniqueCounter() != null && !tokenFormat.getEntityUniqueCounter().isEmpty()) { entityUniqueCounter = Optional.of(tokenFormat.getEntityUniqueCounter().stream() - .map(detectEntity -> EntityType.valueOf(detectEntity.name())) + .map(detectEntity -> TokenTypeMappingEntityUnqCounterItem.valueOf(detectEntity.name())) .collect(Collectors.toList())); } } - return TokenTypeWithoutVault.builder() + return TokenTypeMapping.builder() .entityOnly(entityTypes) .entityUnqCounter(entityUniqueCounter) .build(); + } - private DeidentifyAudioRequestFileDataFormat mapAudioDataFormat(String dataFormat) throws SkyflowException { + + private FileDataDeidentifyAudioDataFormat mapAudioDataFormat(String dataFormat) throws SkyflowException { switch (dataFormat) { case "mp3": - return DeidentifyAudioRequestFileDataFormat.MP_3; + return FileDataDeidentifyAudioDataFormat.MP_3; case "wav": - return DeidentifyAudioRequestFileDataFormat.WAV; + return FileDataDeidentifyAudioDataFormat.WAV; default: throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.InvalidAudioFileType.getMessage()); } diff --git a/src/main/java/com/skyflow/enums/DetectOutputTranscriptions.java b/src/main/java/com/skyflow/enums/DetectOutputTranscriptions.java index 43251c61..8d0c42a4 100644 --- a/src/main/java/com/skyflow/enums/DetectOutputTranscriptions.java +++ b/src/main/java/com/skyflow/enums/DetectOutputTranscriptions.java @@ -4,7 +4,6 @@ public enum DetectOutputTranscriptions { DIARIZED_TRANSCRIPTION("diarized_transcription"), MEDICAL_DIARIZED_TRANSCRIPTION("medical_diarized_transcription"), MEDICAL_TRANSCRIPTION("medical_transcription"), - PLAINTEXT_TRANSCRIPTION("plaintext_transcription"), TRANSCRIPTION("transcription"); private final String detectOutputTranscriptions; diff --git a/src/main/java/com/skyflow/generated/rest/ApiClient.java b/src/main/java/com/skyflow/generated/rest/ApiClient.java index 7c5ae554..1eb1e429 100644 --- a/src/main/java/com/skyflow/generated/rest/ApiClient.java +++ b/src/main/java/com/skyflow/generated/rest/ApiClient.java @@ -31,11 +31,11 @@ public class ApiClient { protected final Supplier authenticationClient; - protected final Supplier guardrailsClient; + protected final Supplier filesClient; protected final Supplier stringsClient; - protected final Supplier filesClient; + protected final Supplier guardrailsClient; public ApiClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; @@ -45,9 +45,9 @@ 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.guardrailsClient = Suppliers.memoize(() -> new GuardrailsClient(clientOptions)); - this.stringsClient = Suppliers.memoize(() -> new StringsClient(clientOptions)); this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions)); + this.stringsClient = Suppliers.memoize(() -> new StringsClient(clientOptions)); + this.guardrailsClient = Suppliers.memoize(() -> new GuardrailsClient(clientOptions)); } public AuditClient audit() { @@ -74,16 +74,16 @@ public AuthenticationClient authentication() { return this.authenticationClient.get(); } - public GuardrailsClient guardrails() { - return this.guardrailsClient.get(); + public FilesClient files() { + return this.filesClient.get(); } public StringsClient strings() { return this.stringsClient.get(); } - public FilesClient files() { - return this.filesClient.get(); + public GuardrailsClient guardrails() { + return this.guardrailsClient.get(); } public static ApiClientBuilder builder() { diff --git a/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java b/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java index b361812a..4f8f5f78 100644 --- a/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java +++ b/src/main/java/com/skyflow/generated/rest/ApiClientBuilder.java @@ -57,9 +57,6 @@ public ApiClientBuilder httpClient(OkHttpClient httpClient) { } public ApiClient build() { - if (token == null) { - throw new RuntimeException("Please provide token"); - } this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.token); clientOptionsBuilder.environment(this.environment); return new ApiClient(clientOptionsBuilder.build()); diff --git a/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java b/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java index 1fb7b844..405d0208 100644 --- a/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java +++ b/src/main/java/com/skyflow/generated/rest/AsyncApiClient.java @@ -31,11 +31,11 @@ public class AsyncApiClient { protected final Supplier authenticationClient; - protected final Supplier guardrailsClient; + protected final Supplier filesClient; protected final Supplier stringsClient; - protected final Supplier filesClient; + protected final Supplier guardrailsClient; public AsyncApiClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; @@ -45,9 +45,9 @@ 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.guardrailsClient = Suppliers.memoize(() -> new AsyncGuardrailsClient(clientOptions)); - this.stringsClient = Suppliers.memoize(() -> new AsyncStringsClient(clientOptions)); this.filesClient = Suppliers.memoize(() -> new AsyncFilesClient(clientOptions)); + this.stringsClient = Suppliers.memoize(() -> new AsyncStringsClient(clientOptions)); + this.guardrailsClient = Suppliers.memoize(() -> new AsyncGuardrailsClient(clientOptions)); } public AsyncAuditClient audit() { @@ -74,16 +74,16 @@ public AsyncAuthenticationClient authentication() { return this.authenticationClient.get(); } - public AsyncGuardrailsClient guardrails() { - return this.guardrailsClient.get(); + public AsyncFilesClient files() { + return this.filesClient.get(); } public AsyncStringsClient strings() { return this.stringsClient.get(); } - public AsyncFilesClient files() { - return this.filesClient.get(); + public AsyncGuardrailsClient guardrails() { + return this.guardrailsClient.get(); } public static AsyncApiClientBuilder builder() { diff --git a/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java b/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java index 8e4b8474..55a1c518 100644 --- a/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java +++ b/src/main/java/com/skyflow/generated/rest/AsyncApiClientBuilder.java @@ -57,9 +57,6 @@ public AsyncApiClientBuilder httpClient(OkHttpClient httpClient) { } public AsyncApiClient build() { - if (token == null) { - throw new RuntimeException("Please provide token"); - } this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.token); clientOptionsBuilder.environment(this.environment); return new AsyncApiClient(clientOptionsBuilder.build()); 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 fe635bf1..59ac5f99 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.322"); + put("X-Fern-SDK-Version", "0.0.378"); } }); this.headerSuppliers = headerSuppliers; 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 782d2d2b..1f157223 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 @@ -5,19 +5,19 @@ import com.skyflow.generated.rest.core.ClientOptions; import com.skyflow.generated.rest.core.RequestOptions; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyAudioRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyDocumentRequest; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileAudioRequestDeidentifyAudio; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileDocumentPdfRequestDeidentifyPdf; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileImageRequestDeidentifyImage; import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyImageRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPdfRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPresentationRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifySpreadsheetRequest; -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.DeidentifyFileRequestDeidentifyDocument; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyPresentation; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifySpreadsheet; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyStructuredText; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; -import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequestReidentifyFile; import com.skyflow.generated.rest.types.DeidentifyFileResponse; -import com.skyflow.generated.rest.types.DeidentifyStatusResponse; +import com.skyflow.generated.rest.types.DetectRunsResponse; import com.skyflow.generated.rest.types.ReidentifyFileResponse; import java.util.concurrent.CompletableFuture; @@ -53,10 +53,27 @@ public CompletableFuture deidentifyFile( return this.rawClient.deidentifyFile(request, requestOptions).thenApply(response -> response.body()); } + /** + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + */ + public CompletableFuture deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request) { + return this.rawClient.deidentifyAudio(request).thenApply(response -> response.body()); + } + + /** + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + */ + public CompletableFuture deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request, RequestOptions requestOptions) { + return this.rawClient.deidentifyAudio(request, requestOptions).thenApply(response -> response.body()); + } + /** * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyDocument(DeidentifyDocumentRequest request) { + public CompletableFuture deidentifyDocument( + DeidentifyFileRequestDeidentifyDocument request) { return this.rawClient.deidentifyDocument(request).thenApply(response -> response.body()); } @@ -64,14 +81,15 @@ public CompletableFuture deidentifyDocument(DeidentifyDo * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public CompletableFuture deidentifyDocument( - DeidentifyDocumentRequest request, RequestOptions requestOptions) { + DeidentifyFileRequestDeidentifyDocument request, RequestOptions requestOptions) { return this.rawClient.deidentifyDocument(request, requestOptions).thenApply(response -> response.body()); } /** * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyPdf(DeidentifyPdfRequest request) { + public CompletableFuture deidentifyPdf( + DeidentifyFileDocumentPdfRequestDeidentifyPdf request) { return this.rawClient.deidentifyPdf(request).thenApply(response -> response.body()); } @@ -79,14 +97,15 @@ public CompletableFuture deidentifyPdf(DeidentifyPdfRequ * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ public CompletableFuture deidentifyPdf( - DeidentifyPdfRequest request, RequestOptions requestOptions) { + DeidentifyFileDocumentPdfRequestDeidentifyPdf request, RequestOptions requestOptions) { return this.rawClient.deidentifyPdf(request, requestOptions).thenApply(response -> response.body()); } /** * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyImage(DeidentifyImageRequest request) { + public CompletableFuture deidentifyImage( + DeidentifyFileImageRequestDeidentifyImage request) { return this.rawClient.deidentifyImage(request).thenApply(response -> response.body()); } @@ -94,44 +113,31 @@ public CompletableFuture deidentifyImage(DeidentifyImage * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public CompletableFuture deidentifyImage( - DeidentifyImageRequest request, RequestOptions requestOptions) { + DeidentifyFileImageRequestDeidentifyImage request, RequestOptions requestOptions) { return this.rawClient.deidentifyImage(request, requestOptions).thenApply(response -> response.body()); } /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. - */ - public CompletableFuture deidentifyText(DeidentifyTextRequest request) { - return this.rawClient.deidentifyText(request).thenApply(response -> response.body()); - } - - /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. - */ - public CompletableFuture deidentifyText( - DeidentifyTextRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyText(request, requestOptions).thenApply(response -> response.body()); - } - - /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyStructuredText(DeidentifyStructuredTextRequest request) { - return this.rawClient.deidentifyStructuredText(request).thenApply(response -> response.body()); + public CompletableFuture deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request) { + return this.rawClient.deidentifyPresentation(request).thenApply(response -> response.body()); } /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyStructuredText( - DeidentifyStructuredTextRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyStructuredText(request, requestOptions).thenApply(response -> response.body()); + public CompletableFuture deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request, RequestOptions requestOptions) { + return this.rawClient.deidentifyPresentation(request, requestOptions).thenApply(response -> response.body()); } /** * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifySpreadsheet(DeidentifySpreadsheetRequest request) { + public CompletableFuture deidentifySpreadsheet( + DeidentifyFileRequestDeidentifySpreadsheet request) { return this.rawClient.deidentifySpreadsheet(request).thenApply(response -> response.body()); } @@ -139,67 +145,75 @@ public CompletableFuture deidentifySpreadsheet(Deidentif * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public CompletableFuture deidentifySpreadsheet( - DeidentifySpreadsheetRequest request, RequestOptions requestOptions) { + DeidentifyFileRequestDeidentifySpreadsheet request, RequestOptions requestOptions) { return this.rawClient.deidentifySpreadsheet(request, requestOptions).thenApply(response -> response.body()); } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyPresentation(DeidentifyPresentationRequest request) { - return this.rawClient.deidentifyPresentation(request).thenApply(response -> response.body()); + public CompletableFuture deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request) { + return this.rawClient.deidentifyStructuredText(request).thenApply(response -> response.body()); } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyPresentation( - DeidentifyPresentationRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyPresentation(request, requestOptions).thenApply(response -> response.body()); + public CompletableFuture deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request, RequestOptions requestOptions) { + return this.rawClient.deidentifyStructuredText(request, requestOptions).thenApply(response -> response.body()); } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyAudio(DeidentifyAudioRequest request) { - return this.rawClient.deidentifyAudio(request).thenApply(response -> response.body()); + public CompletableFuture deidentifyText(DeidentifyFileRequestDeidentifyText request) { + return this.rawClient.deidentifyText(request).thenApply(response -> response.body()); } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture deidentifyAudio( - DeidentifyAudioRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyAudio(request, requestOptions).thenApply(response -> response.body()); + public CompletableFuture deidentifyText( + DeidentifyFileRequestDeidentifyText request, RequestOptions requestOptions) { + return this.rawClient.deidentifyText(request, requestOptions).thenApply(response -> response.body()); } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public CompletableFuture getRun(String runId, GetRunRequest request) { - return this.rawClient.getRun(runId, request).thenApply(response -> response.body()); + public CompletableFuture reidentifyFile(ReidentifyFileRequestReidentifyFile request) { + return this.rawClient.reidentifyFile(request).thenApply(response -> response.body()); } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public CompletableFuture getRun( - String runId, GetRunRequest request, RequestOptions requestOptions) { - return this.rawClient.getRun(runId, request, requestOptions).thenApply(response -> response.body()); + public CompletableFuture reidentifyFile( + ReidentifyFileRequestReidentifyFile request, RequestOptions requestOptions) { + return this.rawClient.reidentifyFile(request, requestOptions).thenApply(response -> response.body()); } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public CompletableFuture reidentifyFile(ReidentifyFileRequest request) { - return this.rawClient.reidentifyFile(request).thenApply(response -> response.body()); + public CompletableFuture getRun(String runId) { + return this.rawClient.getRun(runId).thenApply(response -> response.body()); } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public CompletableFuture reidentifyFile( - ReidentifyFileRequest request, RequestOptions requestOptions) { - return this.rawClient.reidentifyFile(request, requestOptions).thenApply(response -> response.body()); + public CompletableFuture getRun(String runId, GetRunRequest request) { + return this.rawClient.getRun(runId, request).thenApply(response -> response.body()); + } + + /** + * Returns the status of a detect run. + */ + public CompletableFuture getRun( + String runId, GetRunRequest request, RequestOptions requestOptions) { + return this.rawClient.getRun(runId, 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 4672288a..014f3cf8 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 @@ -14,21 +14,20 @@ 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.NotFoundError; import com.skyflow.generated.rest.errors.UnauthorizedError; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyAudioRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyDocumentRequest; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileAudioRequestDeidentifyAudio; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileDocumentPdfRequestDeidentifyPdf; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileImageRequestDeidentifyImage; import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyImageRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPdfRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPresentationRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifySpreadsheetRequest; -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.DeidentifyFileRequestDeidentifyDocument; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyPresentation; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifySpreadsheet; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyStructuredText; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; -import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequestReidentifyFile; import com.skyflow.generated.rest.types.DeidentifyFileResponse; -import com.skyflow.generated.rest.types.DeidentifyStatusResponse; +import com.skyflow.generated.rest.types.DetectRunsResponse; import com.skyflow.generated.rest.types.ErrorResponse; import com.skyflow.generated.rest.types.ReidentifyFileResponse; import java.io.IOException; @@ -140,21 +139,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyDocument( - DeidentifyDocumentRequest request) { - return deidentifyDocument(request, null); + public CompletableFuture> deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request) { + return deidentifyAudio(request, null); } /** - * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyDocument( - DeidentifyDocumentRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/document") + .addPathSegments("v1/detect/deidentify/file/audio") .build(); RequestBody body; try { @@ -228,21 +227,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyPdf( - DeidentifyPdfRequest request) { - return deidentifyPdf(request, null); + public CompletableFuture> deidentifyDocument( + DeidentifyFileRequestDeidentifyDocument request) { + return deidentifyDocument(request, null); } /** - * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyPdf( - DeidentifyPdfRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyDocument( + DeidentifyFileRequestDeidentifyDocument request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/document/pdf") + .addPathSegments("v1/detect/deidentify/file/document") .build(); RequestBody body; try { @@ -316,21 +315,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyImage( - DeidentifyImageRequest request) { - return deidentifyImage(request, null); + public CompletableFuture> deidentifyPdf( + DeidentifyFileDocumentPdfRequestDeidentifyPdf request) { + return deidentifyPdf(request, null); } /** - * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyImage( - DeidentifyImageRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyPdf( + DeidentifyFileDocumentPdfRequestDeidentifyPdf request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/image") + .addPathSegments("v1/detect/deidentify/file/document/pdf") .build(); RequestBody body; try { @@ -404,21 +403,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyText( - DeidentifyTextRequest request) { - return deidentifyText(request, null); + public CompletableFuture> deidentifyImage( + DeidentifyFileImageRequestDeidentifyImage request) { + return deidentifyImage(request, null); } /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyText( - DeidentifyTextRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyImage( + DeidentifyFileImageRequestDeidentifyImage request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/text") + .addPathSegments("v1/detect/deidentify/file/image") .build(); RequestBody body; try { @@ -492,21 +491,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyStructuredText( - DeidentifyStructuredTextRequest request) { - return deidentifyStructuredText(request, null); + public CompletableFuture> deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request) { + return deidentifyPresentation(request, null); } /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyStructuredText( - DeidentifyStructuredTextRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/structured_text") + .addPathSegments("v1/detect/deidentify/file/presentation") .build(); RequestBody body; try { @@ -583,7 +582,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public CompletableFuture> deidentifySpreadsheet( - DeidentifySpreadsheetRequest request) { + DeidentifyFileRequestDeidentifySpreadsheet request) { return deidentifySpreadsheet(request, null); } @@ -591,7 +590,7 @@ public CompletableFuture> deidenti * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public CompletableFuture> deidentifySpreadsheet( - DeidentifySpreadsheetRequest request, RequestOptions requestOptions) { + DeidentifyFileRequestDeidentifySpreadsheet request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/detect/deidentify/file/spreadsheet") @@ -668,21 +667,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyPresentation( - DeidentifyPresentationRequest request) { - return deidentifyPresentation(request, null); + public CompletableFuture> deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request) { + return deidentifyStructuredText(request, null); } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyPresentation( - DeidentifyPresentationRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/presentation") + .addPathSegments("v1/detect/deidentify/file/structured_text") .build(); RequestBody body; try { @@ -756,21 +755,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyAudio( - DeidentifyAudioRequest request) { - return deidentifyAudio(request, null); + public CompletableFuture> deidentifyText( + DeidentifyFileRequestDeidentifyText request) { + return deidentifyText(request, null); } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public CompletableFuture> deidentifyAudio( - DeidentifyAudioRequest request, RequestOptions requestOptions) { + public CompletableFuture> deidentifyText( + DeidentifyFileRequestDeidentifyText request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/audio") + .addPathSegments("v1/detect/deidentify/file/text") .build(); RequestBody body; try { @@ -844,34 +843,41 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public CompletableFuture> getRun( - String runId, GetRunRequest request) { - return getRun(runId, request, null); + public CompletableFuture> reidentifyFile( + ReidentifyFileRequestReidentifyFile request) { + return reidentifyFile(request, null); } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public CompletableFuture> getRun( - String runId, GetRunRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + public CompletableFuture> reidentifyFile( + ReidentifyFileRequestReidentifyFile request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/runs") - .addPathSegment(runId); - QueryStringMapper.addQueryParameter(httpUrl, "vault_id", request.getVaultId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) + .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("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); + .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<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -879,7 +885,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { future.complete(new ApiClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), DeidentifyStatusResponse.class), + responseBody.string(), ReidentifyFileResponse.class), response)); return; } @@ -896,11 +902,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; case 500: future.completeExceptionally(new InternalServerError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), @@ -930,49 +931,50 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public CompletableFuture> reidentifyFile( - ReidentifyFileRequest request) { - return reidentifyFile(request, null); + public CompletableFuture> getRun(String runId) { + return getRun(runId, GetRunRequest.builder().build()); } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public CompletableFuture> reidentifyFile( - ReidentifyFileRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + public CompletableFuture> getRun(String runId, GetRunRequest request) { + return getRun(runId, request, null); + } + + /** + * Returns the status of a detect run. + */ + public CompletableFuture> getRun( + String runId, GetRunRequest request, RequestOptions requestOptions) { + HttpUrl.Builder 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); + .addPathSegments("v1/detect/runs") + .addPathSegment(runId); + if (request.getVaultId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "vault_id", request.getVaultId().get(), false); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .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<>(); + 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), + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DetectRunsResponse.class), response)); return; } 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 5eee1560..8d083d76 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 @@ -5,19 +5,19 @@ import com.skyflow.generated.rest.core.ClientOptions; import com.skyflow.generated.rest.core.RequestOptions; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyAudioRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyDocumentRequest; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileAudioRequestDeidentifyAudio; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileDocumentPdfRequestDeidentifyPdf; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileImageRequestDeidentifyImage; import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyImageRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPdfRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPresentationRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifySpreadsheetRequest; -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.DeidentifyFileRequestDeidentifyDocument; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyPresentation; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifySpreadsheet; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyStructuredText; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; -import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequestReidentifyFile; import com.skyflow.generated.rest.types.DeidentifyFileResponse; -import com.skyflow.generated.rest.types.DeidentifyStatusResponse; +import com.skyflow.generated.rest.types.DetectRunsResponse; import com.skyflow.generated.rest.types.ReidentifyFileResponse; public class FilesClient { @@ -51,81 +51,85 @@ public DeidentifyFileResponse deidentifyFile(DeidentifyFileRequest request, Requ return this.rawClient.deidentifyFile(request, requestOptions).body(); } + /** + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + */ + public DeidentifyFileResponse deidentifyAudio(DeidentifyFileAudioRequestDeidentifyAudio request) { + return this.rawClient.deidentifyAudio(request).body(); + } + + /** + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + */ + public DeidentifyFileResponse deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request, RequestOptions requestOptions) { + return this.rawClient.deidentifyAudio(request, requestOptions).body(); + } + /** * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyDocument(DeidentifyDocumentRequest request) { + public DeidentifyFileResponse deidentifyDocument(DeidentifyFileRequestDeidentifyDocument request) { return this.rawClient.deidentifyDocument(request).body(); } /** * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyDocument(DeidentifyDocumentRequest request, RequestOptions requestOptions) { + public DeidentifyFileResponse deidentifyDocument( + DeidentifyFileRequestDeidentifyDocument request, RequestOptions requestOptions) { return this.rawClient.deidentifyDocument(request, requestOptions).body(); } /** * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyPdf(DeidentifyPdfRequest request) { + public DeidentifyFileResponse deidentifyPdf(DeidentifyFileDocumentPdfRequestDeidentifyPdf request) { return this.rawClient.deidentifyPdf(request).body(); } /** * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyPdf(DeidentifyPdfRequest request, RequestOptions requestOptions) { + public DeidentifyFileResponse deidentifyPdf( + DeidentifyFileDocumentPdfRequestDeidentifyPdf request, RequestOptions requestOptions) { return this.rawClient.deidentifyPdf(request, requestOptions).body(); } /** * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyImage(DeidentifyImageRequest request) { + public DeidentifyFileResponse deidentifyImage(DeidentifyFileImageRequestDeidentifyImage request) { return this.rawClient.deidentifyImage(request).body(); } /** * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyImage(DeidentifyImageRequest request, RequestOptions requestOptions) { + public DeidentifyFileResponse deidentifyImage( + DeidentifyFileImageRequestDeidentifyImage request, RequestOptions requestOptions) { return this.rawClient.deidentifyImage(request, requestOptions).body(); } /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. - */ - public DeidentifyFileResponse deidentifyText(DeidentifyTextRequest request) { - return this.rawClient.deidentifyText(request).body(); - } - - /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. - */ - public DeidentifyFileResponse deidentifyText(DeidentifyTextRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyText(request, requestOptions).body(); - } - - /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyStructuredText(DeidentifyStructuredTextRequest request) { - return this.rawClient.deidentifyStructuredText(request).body(); + public DeidentifyFileResponse deidentifyPresentation(DeidentifyFileRequestDeidentifyPresentation request) { + return this.rawClient.deidentifyPresentation(request).body(); } /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyStructuredText( - DeidentifyStructuredTextRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyStructuredText(request, requestOptions).body(); + public DeidentifyFileResponse deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request, RequestOptions requestOptions) { + return this.rawClient.deidentifyPresentation(request, requestOptions).body(); } /** * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifySpreadsheet(DeidentifySpreadsheetRequest request) { + public DeidentifyFileResponse deidentifySpreadsheet(DeidentifyFileRequestDeidentifySpreadsheet request) { return this.rawClient.deidentifySpreadsheet(request).body(); } @@ -133,64 +137,73 @@ public DeidentifyFileResponse deidentifySpreadsheet(DeidentifySpreadsheetRequest * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public DeidentifyFileResponse deidentifySpreadsheet( - DeidentifySpreadsheetRequest request, RequestOptions requestOptions) { + DeidentifyFileRequestDeidentifySpreadsheet request, RequestOptions requestOptions) { return this.rawClient.deidentifySpreadsheet(request, requestOptions).body(); } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyPresentation(DeidentifyPresentationRequest request) { - return this.rawClient.deidentifyPresentation(request).body(); + public DeidentifyFileResponse deidentifyStructuredText(DeidentifyFileRequestDeidentifyStructuredText request) { + return this.rawClient.deidentifyStructuredText(request).body(); } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyPresentation( - DeidentifyPresentationRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyPresentation(request, requestOptions).body(); + public DeidentifyFileResponse deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request, RequestOptions requestOptions) { + return this.rawClient.deidentifyStructuredText(request, requestOptions).body(); } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyAudio(DeidentifyAudioRequest request) { - return this.rawClient.deidentifyAudio(request).body(); + public DeidentifyFileResponse deidentifyText(DeidentifyFileRequestDeidentifyText request) { + return this.rawClient.deidentifyText(request).body(); } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public DeidentifyFileResponse deidentifyAudio(DeidentifyAudioRequest request, RequestOptions requestOptions) { - return this.rawClient.deidentifyAudio(request, requestOptions).body(); + public DeidentifyFileResponse deidentifyText( + DeidentifyFileRequestDeidentifyText request, RequestOptions requestOptions) { + return this.rawClient.deidentifyText(request, requestOptions).body(); } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public DeidentifyStatusResponse getRun(String runId, GetRunRequest request) { - return this.rawClient.getRun(runId, request).body(); + public ReidentifyFileResponse reidentifyFile(ReidentifyFileRequestReidentifyFile request) { + return this.rawClient.reidentifyFile(request).body(); } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public DeidentifyStatusResponse getRun(String runId, GetRunRequest request, RequestOptions requestOptions) { - return this.rawClient.getRun(runId, request, requestOptions).body(); + public ReidentifyFileResponse reidentifyFile( + ReidentifyFileRequestReidentifyFile request, RequestOptions requestOptions) { + return this.rawClient.reidentifyFile(request, requestOptions).body(); } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public ReidentifyFileResponse reidentifyFile(ReidentifyFileRequest request) { - return this.rawClient.reidentifyFile(request).body(); + public DetectRunsResponse getRun(String runId) { + return this.rawClient.getRun(runId).body(); } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public ReidentifyFileResponse reidentifyFile(ReidentifyFileRequest request, RequestOptions requestOptions) { - return this.rawClient.reidentifyFile(request, requestOptions).body(); + public DetectRunsResponse getRun(String runId, GetRunRequest request) { + return this.rawClient.getRun(runId, request).body(); + } + + /** + * Returns the status of a detect run. + */ + public DetectRunsResponse getRun(String runId, GetRunRequest request, RequestOptions requestOptions) { + return this.rawClient.getRun(runId, 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 d0fb0bfc..164c4d18 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 @@ -14,21 +14,20 @@ 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.NotFoundError; import com.skyflow.generated.rest.errors.UnauthorizedError; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyAudioRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyDocumentRequest; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileAudioRequestDeidentifyAudio; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileDocumentPdfRequestDeidentifyPdf; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileImageRequestDeidentifyImage; import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyImageRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPdfRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifyPresentationRequest; -import com.skyflow.generated.rest.resources.files.requests.DeidentifySpreadsheetRequest; -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.DeidentifyFileRequestDeidentifyDocument; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyPresentation; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifySpreadsheet; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyStructuredText; +import com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText; import com.skyflow.generated.rest.resources.files.requests.GetRunRequest; -import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequest; +import com.skyflow.generated.rest.resources.files.requests.ReidentifyFileRequestReidentifyFile; import com.skyflow.generated.rest.types.DeidentifyFileResponse; -import com.skyflow.generated.rest.types.DeidentifyStatusResponse; +import com.skyflow.generated.rest.types.DetectRunsResponse; import com.skyflow.generated.rest.types.ErrorResponse; import com.skyflow.generated.rest.types.ReidentifyFileResponse; import java.io.IOException; @@ -115,20 +114,21 @@ public ApiClientHttpResponse deidentifyFile( } /** - * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyDocument(DeidentifyDocumentRequest request) { - return deidentifyDocument(request, null); + public ApiClientHttpResponse deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request) { + return deidentifyAudio(request, null); } /** - * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyDocument( - DeidentifyDocumentRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyAudio( + DeidentifyFileAudioRequestDeidentifyAudio request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/document") + .addPathSegments("v1/detect/deidentify/file/audio") .build(); RequestBody body; try { @@ -182,20 +182,21 @@ public ApiClientHttpResponse deidentifyDocument( } /** - * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyPdf(DeidentifyPdfRequest request) { - return deidentifyPdf(request, null); + public ApiClientHttpResponse deidentifyDocument( + DeidentifyFileRequestDeidentifyDocument request) { + return deidentifyDocument(request, null); } /** - * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a document file. This operation includes options applicable to all supported document file types.<br/><br/>For more specific options, see the file type-specific opertions (like <a href='#deidentify_pdf'>De-identify PDF</a>) where they're available. For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyPdf( - DeidentifyPdfRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyDocument( + DeidentifyFileRequestDeidentifyDocument request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/document/pdf") + .addPathSegments("v1/detect/deidentify/file/document") .build(); RequestBody body; try { @@ -249,20 +250,21 @@ public ApiClientHttpResponse deidentifyPdf( } /** - * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyImage(DeidentifyImageRequest request) { - return deidentifyImage(request, null); + public ApiClientHttpResponse deidentifyPdf( + DeidentifyFileDocumentPdfRequestDeidentifyPdf request) { + return deidentifyPdf(request, null); } /** - * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a PDF file. This operation includes options specific to PDF files.<br/><br/>For broader file type support, see <a href='#deidentify_document'>De-identify Document</a> and <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyImage( - DeidentifyImageRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyPdf( + DeidentifyFileDocumentPdfRequestDeidentifyPdf request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/image") + .addPathSegments("v1/detect/deidentify/file/document/pdf") .build(); RequestBody body; try { @@ -316,20 +318,21 @@ public ApiClientHttpResponse deidentifyImage( } /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyText(DeidentifyTextRequest request) { - return deidentifyText(request, null); + public ApiClientHttpResponse deidentifyImage( + DeidentifyFileImageRequestDeidentifyImage request) { + return deidentifyImage(request, null); } /** - * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from an image file. This operation includes options applicable to all supported image file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyText( - DeidentifyTextRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyImage( + DeidentifyFileImageRequestDeidentifyImage request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/text") + .addPathSegments("v1/detect/deidentify/file/image") .build(); RequestBody body; try { @@ -383,21 +386,21 @@ public ApiClientHttpResponse deidentifyText( } /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyStructuredText( - DeidentifyStructuredTextRequest request) { - return deidentifyStructuredText(request, null); + public ApiClientHttpResponse deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request) { + return deidentifyPresentation(request, null); } /** - * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyStructuredText( - DeidentifyStructuredTextRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyPresentation( + DeidentifyFileRequestDeidentifyPresentation request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/structured_text") + .addPathSegments("v1/detect/deidentify/file/presentation") .build(); RequestBody body; try { @@ -453,7 +456,8 @@ public ApiClientHttpResponse deidentifyStructuredText( /** * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifySpreadsheet(DeidentifySpreadsheetRequest request) { + public ApiClientHttpResponse deidentifySpreadsheet( + DeidentifyFileRequestDeidentifySpreadsheet request) { return deidentifySpreadsheet(request, null); } @@ -461,7 +465,7 @@ public ApiClientHttpResponse deidentifySpreadsheet(Deide * De-identifies sensitive data from a spreadsheet file. This operation includes options applicable to all supported spreadsheet file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ public ApiClientHttpResponse deidentifySpreadsheet( - DeidentifySpreadsheetRequest request, RequestOptions requestOptions) { + DeidentifyFileRequestDeidentifySpreadsheet request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/detect/deidentify/file/spreadsheet") @@ -518,20 +522,21 @@ public ApiClientHttpResponse deidentifySpreadsheet( } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyPresentation(DeidentifyPresentationRequest request) { - return deidentifyPresentation(request, null); + public ApiClientHttpResponse deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request) { + return deidentifyStructuredText(request, null); } /** - * De-identifies sensitive data from a presentation file. This operation includes options applicable to all supported presentation file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a structured text file. This operation includes options applicable to all supported structured text file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyPresentation( - DeidentifyPresentationRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyStructuredText( + DeidentifyFileRequestDeidentifyStructuredText request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/presentation") + .addPathSegments("v1/detect/deidentify/file/structured_text") .build(); RequestBody body; try { @@ -585,20 +590,20 @@ public ApiClientHttpResponse deidentifyPresentation( } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyAudio(DeidentifyAudioRequest request) { - return deidentifyAudio(request, null); + public ApiClientHttpResponse deidentifyText(DeidentifyFileRequestDeidentifyText request) { + return deidentifyText(request, null); } /** - * De-identifies sensitive data from an audio file. This operation includes options applicable to all supported audio file types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. + * De-identifies sensitive data from a text file. This operation includes options applicable to all supported image text types.<br/><br/>For broader file type support, see <a href='#deidentify_file'>De-identify File</a>. */ - public ApiClientHttpResponse deidentifyAudio( - DeidentifyAudioRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse deidentifyText( + DeidentifyFileRequestDeidentifyText request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/deidentify/file/audio") + .addPathSegments("v1/detect/deidentify/file/text") .build(); RequestBody body; try { @@ -652,28 +657,35 @@ public ApiClientHttpResponse deidentifyAudio( } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public ApiClientHttpResponse getRun(String runId, GetRunRequest request) { - return getRun(runId, request, null); + public ApiClientHttpResponse reidentifyFile(ReidentifyFileRequestReidentifyFile request) { + return reidentifyFile(request, null); } /** - * Returns the status of the detect run. + * Re-identifies tokens in a file. */ - public ApiClientHttpResponse getRun( - String runId, GetRunRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + public ApiClientHttpResponse reidentifyFile( + ReidentifyFileRequestReidentifyFile request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/detect/runs") - .addPathSegment(runId); - QueryStringMapper.addQueryParameter(httpUrl, "vault_id", request.getVaultId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) + .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("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -682,7 +694,7 @@ public ApiClientHttpResponse getRun( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeidentifyStatusResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReidentifyFileResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -694,9 +706,6 @@ public ApiClientHttpResponse getRun( case 401: throw new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 404: - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); case 500: throw new InternalServerError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); @@ -715,35 +724,38 @@ public ApiClientHttpResponse getRun( } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public ApiClientHttpResponse reidentifyFile(ReidentifyFileRequest request) { - return reidentifyFile(request, null); + public ApiClientHttpResponse getRun(String runId) { + return getRun(runId, GetRunRequest.builder().build()); } /** - * Re-identifies tokens in a file. + * Returns the status of a detect run. */ - public ApiClientHttpResponse reidentifyFile( - ReidentifyFileRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + public ApiClientHttpResponse getRun(String runId, GetRunRequest request) { + return getRun(runId, request, null); + } + + /** + * Returns the status of a detect run. + */ + public ApiClientHttpResponse getRun( + String runId, GetRunRequest request, RequestOptions requestOptions) { + HttpUrl.Builder 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); + .addPathSegments("v1/detect/runs") + .addPathSegment(runId); + if (request.getVaultId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "vault_id", request.getVaultId().get(), false); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -752,8 +764,7 @@ public ApiClientHttpResponse reidentifyFile( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReidentifyFileResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DetectRunsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { 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 deleted file mode 100644 index dd2d1548..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyDocumentRequest.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * 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.DeidentifyDocumentRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; -import com.skyflow.generated.rest.types.Transformations; -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 = DeidentifyDocumentRequest.Builder.class) -public final class DeidentifyDocumentRequest { - private final String vaultId; - - private final DeidentifyDocumentRequestFile file; - - private final Optional configurationId; - - private final Optional> entityTypes; - - private final Optional tokenType; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional transformations; - - private final Map additionalProperties; - - private DeidentifyDocumentRequest( - String vaultId, - DeidentifyDocumentRequestFile file, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, - Optional> allowRegex, - Optional> restrictRegex, - Optional transformations, - Map additionalProperties) { - this.vaultId = vaultId; - this.file = file; - this.configurationId = configurationId; - this.entityTypes = entityTypes; - this.tokenType = tokenType; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.transformations = transformations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ - @JsonProperty("file") - public DeidentifyDocumentRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; - } - - @JsonProperty("entity_types") - public Optional> getEntityTypes() { - return entityTypes; - } - - @JsonProperty("token_type") - public Optional getTokenType() { - return tokenType; - } - - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - @JsonProperty("transformations") - public Optional getTransformations() { - return transformations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyDocumentRequest && equalTo((DeidentifyDocumentRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - 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) - && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.vaultId, - this.file, - this.configurationId, - this.entityTypes, - this.tokenType, - this.allowRegex, - this.restrictRegex, - this.transformations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static VaultIdStage builder() { - return new Builder(); - } - - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); - - Builder from(DeidentifyDocumentRequest other); - } - - public interface FileStage { - /** - * File to de-identify. Files are specified as Base64-encoded data. - */ - _FinalStage file(@NotNull DeidentifyDocumentRequestFile file); - } - - public interface _FinalStage { - DeidentifyDocumentRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); - - _FinalStage entityTypes(List entityTypes); - - _FinalStage tokenType(Optional tokenType); - - _FinalStage tokenType(TokenTypeWithoutVault tokenType); - - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - _FinalStage transformations(Optional transformations); - - _FinalStage transformations(Transformations transformations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { - private String vaultId; - - private DeidentifyDocumentRequestFile file; - - private Optional transformations = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional tokenType = Optional.empty(); - - private Optional> entityTypes = Optional.empty(); - - private Optional configurationId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyDocumentRequest other) { - vaultId(other.getVaultId()); - file(other.getFile()); - configurationId(other.getConfigurationId()); - entityTypes(other.getEntityTypes()); - tokenType(other.getTokenType()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - transformations(other.getTransformations()); - return this; - } - - @java.lang.Override - @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - * File to 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 - @JsonSetter("file") - public _FinalStage file(@NotNull DeidentifyDocumentRequestFile file) { - this.file = Objects.requireNonNull(file, "file must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage transformations(Transformations transformations) { - this.transformations = Optional.ofNullable(transformations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "transformations", nulls = Nulls.SKIP) - public _FinalStage transformations(Optional transformations) { - this.transformations = transformations; - return this; - } - - @java.lang.Override - public _FinalStage restrictRegex(List restrictRegex) { - this.restrictRegex = Optional.ofNullable(restrictRegex); - return this; - } - - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - @java.lang.Override - public _FinalStage allowRegex(List allowRegex) { - this.allowRegex = Optional.ofNullable(allowRegex); - return this; - } - - @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 tokenType(TokenTypeWithoutVault tokenType) { - this.tokenType = Optional.ofNullable(tokenType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { - this.tokenType = tokenType; - return this; - } - - @java.lang.Override - public _FinalStage entityTypes(List entityTypes) { - this.entityTypes = Optional.ofNullable(entityTypes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { - this.entityTypes = entityTypes; - return this; - } - - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifyDocumentRequest build() { - return new DeidentifyDocumentRequest( - vaultId, - file, - configurationId, - entityTypes, - tokenType, - allowRegex, - restrictRegex, - transformations, - additionalProperties); - } - } -} 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/DeidentifyFileAudioRequestDeidentifyAudio.java similarity index 55% rename from src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyAudioRequest.java rename to src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileAudioRequestDeidentifyAudio.java index b9f02d97..c3a025cf 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/DeidentifyFileAudioRequestDeidentifyAudio.java @@ -12,10 +12,10 @@ 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.DeidentifyAudioRequestFile; -import com.skyflow.generated.rest.resources.files.types.DeidentifyAudioRequestOutputTranscription; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; +import com.skyflow.generated.rest.resources.files.types.DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem; +import com.skyflow.generated.rest.resources.files.types.DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription; +import com.skyflow.generated.rest.types.FileDataDeidentifyAudio; +import com.skyflow.generated.rest.types.TokenTypeMapping; import com.skyflow.generated.rest.types.Transformations; import java.util.HashMap; import java.util.List; @@ -25,29 +25,27 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyAudioRequest.Builder.class) -public final class DeidentifyAudioRequest { - private final String vaultId; +@JsonDeserialize(builder = DeidentifyFileAudioRequestDeidentifyAudio.Builder.class) +public final class DeidentifyFileAudioRequestDeidentifyAudio { + private final FileDataDeidentifyAudio file; - private final DeidentifyAudioRequestFile file; + private final String vaultId; - private final Optional configurationId; + private final Optional outputTranscription; private final Optional outputProcessedAudio; - private final Optional outputTranscription; - - private final Optional bleepGain; + private final Optional bleepStartPadding; - private final Optional bleepFrequency; + private final Optional bleepStopPadding; - private final Optional bleepStartPadding; + private final Optional bleepFrequency; - private final Optional bleepStopPadding; + private final Optional bleepGain; - private final Optional> entityTypes; + private final Optional> entityTypes; - private final Optional tokenType; + private final Optional tokenType; private final Optional> allowRegex; @@ -55,61 +53,66 @@ public final class DeidentifyAudioRequest { private final Optional transformations; + private final Optional configurationId; + private final Map additionalProperties; - private DeidentifyAudioRequest( + private DeidentifyFileAudioRequestDeidentifyAudio( + FileDataDeidentifyAudio file, String vaultId, - DeidentifyAudioRequestFile file, - Optional configurationId, + Optional outputTranscription, Optional outputProcessedAudio, - Optional outputTranscription, - Optional bleepGain, - Optional bleepFrequency, - Optional bleepStartPadding, - Optional bleepStopPadding, - Optional> entityTypes, - Optional tokenType, + Optional bleepStartPadding, + Optional bleepStopPadding, + Optional bleepFrequency, + Optional bleepGain, + Optional> entityTypes, + Optional tokenType, Optional> allowRegex, Optional> restrictRegex, Optional transformations, + Optional configurationId, Map additionalProperties) { - this.vaultId = vaultId; this.file = file; - this.configurationId = configurationId; - this.outputProcessedAudio = outputProcessedAudio; + this.vaultId = vaultId; this.outputTranscription = outputTranscription; - this.bleepGain = bleepGain; - this.bleepFrequency = bleepFrequency; + this.outputProcessedAudio = outputProcessedAudio; this.bleepStartPadding = bleepStartPadding; this.bleepStopPadding = bleepStopPadding; + this.bleepFrequency = bleepFrequency; + this.bleepGain = bleepGain; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; this.restrictRegex = restrictRegex; this.transformations = transformations; + this.configurationId = configurationId; this.additionalProperties = additionalProperties; } + @JsonProperty("file") + public FileDataDeidentifyAudio getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ @JsonProperty("vault_id") public String getVaultId() { return vaultId; } /** - * @return File to de-identify. Files are specified as Base64-encoded data. + * @return Type of transcription to output. */ - @JsonProperty("file") - public DeidentifyAudioRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; + @JsonProperty("output_transcription") + public Optional getOutputTranscription() { + return outputTranscription; } /** - * @return If true, includes processed audio file in the response. + * @return Whether to include the processed audio file in the response. */ @JsonProperty("output_processed_audio") public Optional getOutputProcessedAudio() { @@ -117,60 +120,61 @@ public Optional getOutputProcessedAudio() { } /** - * @return Type of transcription to output. + * @return Padding added to the beginning of a bleep, in seconds. */ - @JsonProperty("output_transcription") - public Optional getOutputTranscription() { - return outputTranscription; + @JsonProperty("bleep_start_padding") + public Optional getBleepStartPadding() { + return bleepStartPadding; } /** - * @return Relative loudness of the bleep in dB. Positive values increase its loudness, and negative values decrease it. + * @return Padding added to the end of a bleep, in seconds. */ - @JsonProperty("bleep_gain") - public Optional getBleepGain() { - return bleepGain; + @JsonProperty("bleep_stop_padding") + public Optional getBleepStopPadding() { + return bleepStopPadding; } /** * @return The pitch of the bleep sound, in Hz. The higher the number, the higher the pitch. */ @JsonProperty("bleep_frequency") - public Optional getBleepFrequency() { + public Optional getBleepFrequency() { return bleepFrequency; } /** - * @return Padding added to the beginning of a bleep, in seconds. + * @return Relative loudness of the bleep in dB. Positive values increase its loudness, and negative values decrease it. */ - @JsonProperty("bleep_start_padding") - public Optional getBleepStartPadding() { - return bleepStartPadding; + @JsonProperty("bleep_gain") + public Optional getBleepGain() { + return bleepGain; } /** - * @return Padding added to the end of a bleep, in seconds. + * @return Entities to detect and de-identify. */ - @JsonProperty("bleep_stop_padding") - public Optional getBleepStopPadding() { - return bleepStopPadding; - } - @JsonProperty("entity_types") - public Optional> getEntityTypes() { + public Optional> getEntityTypes() { return entityTypes; } @JsonProperty("token_type") - public Optional getTokenType() { + public Optional getTokenType() { return tokenType; } + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ @JsonProperty("allow_regex") public Optional> getAllowRegex() { return allowRegex; } + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ @JsonProperty("restrict_regex") public Optional> getRestrictRegex() { return restrictRegex; @@ -181,10 +185,19 @@ public Optional getTransformations() { return transformations; } + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyAudioRequest && equalTo((DeidentifyAudioRequest) other); + return other instanceof DeidentifyFileAudioRequestDeidentifyAudio + && equalTo((DeidentifyFileAudioRequestDeidentifyAudio) other); } @JsonAnyGetter @@ -192,40 +205,40 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyAudioRequest other) { - return vaultId.equals(other.vaultId) - && file.equals(other.file) - && configurationId.equals(other.configurationId) - && outputProcessedAudio.equals(other.outputProcessedAudio) + private boolean equalTo(DeidentifyFileAudioRequestDeidentifyAudio other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) && outputTranscription.equals(other.outputTranscription) - && bleepGain.equals(other.bleepGain) - && bleepFrequency.equals(other.bleepFrequency) + && outputProcessedAudio.equals(other.outputProcessedAudio) && bleepStartPadding.equals(other.bleepStartPadding) && bleepStopPadding.equals(other.bleepStopPadding) + && bleepFrequency.equals(other.bleepFrequency) + && bleepGain.equals(other.bleepGain) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); } @java.lang.Override public int hashCode() { return Objects.hash( - this.vaultId, this.file, - this.configurationId, - this.outputProcessedAudio, + this.vaultId, this.outputTranscription, - this.bleepGain, - this.bleepFrequency, + this.outputProcessedAudio, this.bleepStartPadding, this.bleepStopPadding, + this.bleepFrequency, + this.bleepGain, this.entityTypes, this.tokenType, this.allowRegex, this.restrictRegex, - this.transformations); + this.transformations, + this.configurationId); } @java.lang.Override @@ -233,84 +246,91 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static FileStage builder() { return new Builder(); } - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyAudio file); - Builder from(DeidentifyAudioRequest other); + Builder from(DeidentifyFileAudioRequestDeidentifyAudio other); } - public interface FileStage { + public interface VaultIdStage { /** - * File to de-identify. Files are specified as Base64-encoded data. + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. */ - _FinalStage file(@NotNull DeidentifyAudioRequestFile file); + _FinalStage vaultId(@NotNull String vaultId); } public interface _FinalStage { - DeidentifyAudioRequest build(); + DeidentifyFileAudioRequestDeidentifyAudio build(); - _FinalStage configurationId(Optional configurationId); + /** + *

Type of transcription to output.

+ */ + _FinalStage outputTranscription( + Optional outputTranscription); - _FinalStage configurationId(String configurationId); + _FinalStage outputTranscription( + DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription outputTranscription); /** - *

If true, includes processed audio file in the response.

+ *

Whether to include the processed audio file in the response.

*/ _FinalStage outputProcessedAudio(Optional outputProcessedAudio); _FinalStage outputProcessedAudio(Boolean outputProcessedAudio); /** - *

Type of transcription to output.

+ *

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

*/ - _FinalStage outputTranscription(Optional outputTranscription); + _FinalStage bleepStartPadding(Optional bleepStartPadding); - _FinalStage outputTranscription(DeidentifyAudioRequestOutputTranscription outputTranscription); + _FinalStage bleepStartPadding(Float bleepStartPadding); /** - *

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

+ *

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

*/ - _FinalStage bleepGain(Optional bleepGain); + _FinalStage bleepStopPadding(Optional bleepStopPadding); - _FinalStage bleepGain(Double bleepGain); + _FinalStage bleepStopPadding(Float bleepStopPadding); /** *

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

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

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

+ *

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

*/ - _FinalStage bleepStartPadding(Optional bleepStartPadding); + _FinalStage bleepGain(Optional bleepGain); - _FinalStage bleepStartPadding(Double bleepStartPadding); + _FinalStage bleepGain(Integer bleepGain); /** - *

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

+ *

Entities to detect and de-identify.

*/ - _FinalStage bleepStopPadding(Optional bleepStopPadding); - - _FinalStage bleepStopPadding(Double bleepStopPadding); - - _FinalStage entityTypes(Optional> entityTypes); + _FinalStage entityTypes(Optional> entityTypes); - _FinalStage entityTypes(List entityTypes); + _FinalStage entityTypes(List entityTypes); - _FinalStage tokenType(Optional tokenType); + _FinalStage tokenType(Optional tokenType); - _FinalStage tokenType(TokenTypeWithoutVault tokenType); + _FinalStage tokenType(TokenTypeMapping tokenType); + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ _FinalStage restrictRegex(Optional> restrictRegex); _FinalStage restrictRegex(List restrictRegex); @@ -318,13 +338,22 @@ public interface _FinalStage { _FinalStage transformations(Optional transformations); _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyAudio file; + private String vaultId; - private DeidentifyAudioRequestFile file; + private Optional configurationId = Optional.empty(); private Optional transformations = Optional.empty(); @@ -332,23 +361,22 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> allowRegex = Optional.empty(); - private Optional tokenType = Optional.empty(); + private Optional tokenType = Optional.empty(); - private Optional> entityTypes = Optional.empty(); + private Optional> entityTypes = Optional.empty(); - private Optional bleepStopPadding = Optional.empty(); + private Optional bleepGain = Optional.empty(); - private Optional bleepStartPadding = Optional.empty(); + private Optional bleepFrequency = Optional.empty(); - private Optional bleepFrequency = Optional.empty(); + private Optional bleepStopPadding = Optional.empty(); - private Optional bleepGain = Optional.empty(); - - private Optional outputTranscription = Optional.empty(); + private Optional bleepStartPadding = Optional.empty(); private Optional outputProcessedAudio = Optional.empty(); - private Optional configurationId = Optional.empty(); + private Optional outputTranscription = + Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -356,39 +384,59 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Builder() {} @java.lang.Override - public Builder from(DeidentifyAudioRequest other) { - vaultId(other.getVaultId()); + public Builder from(DeidentifyFileAudioRequestDeidentifyAudio other) { file(other.getFile()); - configurationId(other.getConfigurationId()); - outputProcessedAudio(other.getOutputProcessedAudio()); + vaultId(other.getVaultId()); outputTranscription(other.getOutputTranscription()); - bleepGain(other.getBleepGain()); - bleepFrequency(other.getBleepFrequency()); + outputProcessedAudio(other.getOutputProcessedAudio()); bleepStartPadding(other.getBleepStartPadding()); bleepStopPadding(other.getBleepStopPadding()); + bleepFrequency(other.getBleepFrequency()); + bleepGain(other.getBleepGain()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); restrictRegex(other.getRestrictRegex()); transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); return this; } + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyAudio file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { + public _FinalStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); return this; } /** - * File to de-identify. Files are specified as Base64-encoded data.

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

+ *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; return this; } @@ -405,12 +453,19 @@ public _FinalStage transformations(Optional transformations) { return this; } + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ @java.lang.Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { @@ -432,68 +494,56 @@ public _FinalStage allowRegex(Optional> allowRegex) { } @java.lang.Override - public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { + public _FinalStage tokenType(TokenTypeMapping tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } @java.lang.Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { + public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } - @java.lang.Override - public _FinalStage entityTypes(List entityTypes) { - this.entityTypes = Optional.ofNullable(entityTypes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { - this.entityTypes = entityTypes; - return this; - } - /** - *

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

+ *

Entities to detect and de-identify.

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

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

+ *

Entities to detect and de-identify.

*/ @java.lang.Override - @JsonSetter(value = "bleep_stop_padding", nulls = Nulls.SKIP) - public _FinalStage bleepStopPadding(Optional bleepStopPadding) { - this.bleepStopPadding = bleepStopPadding; + @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) + public _FinalStage entityTypes( + Optional> entityTypes) { + this.entityTypes = entityTypes; return this; } /** - *

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

+ *

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 - public _FinalStage bleepStartPadding(Double bleepStartPadding) { - this.bleepStartPadding = Optional.ofNullable(bleepStartPadding); + public _FinalStage bleepGain(Integer bleepGain) { + this.bleepGain = Optional.ofNullable(bleepGain); return this; } /** - *

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

+ *

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

*/ @java.lang.Override - @JsonSetter(value = "bleep_start_padding", nulls = Nulls.SKIP) - public _FinalStage bleepStartPadding(Optional bleepStartPadding) { - this.bleepStartPadding = bleepStartPadding; + @JsonSetter(value = "bleep_gain", nulls = Nulls.SKIP) + public _FinalStage bleepGain(Optional bleepGain) { + this.bleepGain = bleepGain; return this; } @@ -502,7 +552,7 @@ public _FinalStage bleepStartPadding(Optional bleepStartPadding) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage bleepFrequency(Double bleepFrequency) { + public _FinalStage bleepFrequency(Integer bleepFrequency) { this.bleepFrequency = Optional.ofNullable(bleepFrequency); return this; } @@ -512,54 +562,53 @@ public _FinalStage bleepFrequency(Double bleepFrequency) { */ @java.lang.Override @JsonSetter(value = "bleep_frequency", nulls = Nulls.SKIP) - public _FinalStage bleepFrequency(Optional bleepFrequency) { + public _FinalStage bleepFrequency(Optional bleepFrequency) { this.bleepFrequency = bleepFrequency; return this; } /** - *

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

+ *

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 - public _FinalStage bleepGain(Double bleepGain) { - this.bleepGain = Optional.ofNullable(bleepGain); + public _FinalStage bleepStopPadding(Float bleepStopPadding) { + this.bleepStopPadding = Optional.ofNullable(bleepStopPadding); return this; } /** - *

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

+ *

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

*/ @java.lang.Override - @JsonSetter(value = "bleep_gain", nulls = Nulls.SKIP) - public _FinalStage bleepGain(Optional bleepGain) { - this.bleepGain = bleepGain; + @JsonSetter(value = "bleep_stop_padding", nulls = Nulls.SKIP) + public _FinalStage bleepStopPadding(Optional bleepStopPadding) { + this.bleepStopPadding = bleepStopPadding; return this; } /** - *

Type of transcription to output.

+ *

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 - public _FinalStage outputTranscription(DeidentifyAudioRequestOutputTranscription outputTranscription) { - this.outputTranscription = Optional.ofNullable(outputTranscription); + public _FinalStage bleepStartPadding(Float bleepStartPadding) { + this.bleepStartPadding = Optional.ofNullable(bleepStartPadding); return this; } /** - *

Type of transcription to output.

+ *

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

*/ @java.lang.Override - @JsonSetter(value = "output_transcription", nulls = Nulls.SKIP) - public _FinalStage outputTranscription( - Optional outputTranscription) { - this.outputTranscription = outputTranscription; + @JsonSetter(value = "bleep_start_padding", nulls = Nulls.SKIP) + public _FinalStage bleepStartPadding(Optional bleepStartPadding) { + this.bleepStartPadding = bleepStartPadding; return this; } /** - *

If true, includes processed audio file in the response.

+ *

Whether to include the processed audio file in the response.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -569,7 +618,7 @@ public _FinalStage outputProcessedAudio(Boolean outputProcessedAudio) { } /** - *

If true, includes processed audio file in the response.

+ *

Whether to include the processed audio file in the response.

*/ @java.lang.Override @JsonSetter(value = "output_processed_audio", nulls = Nulls.SKIP) @@ -578,36 +627,45 @@ public _FinalStage outputProcessedAudio(Optional outputProcessedAudio) return this; } + /** + *

Type of transcription to output.

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

Type of transcription to output.

+ */ @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; + @JsonSetter(value = "output_transcription", nulls = Nulls.SKIP) + public _FinalStage outputTranscription( + Optional outputTranscription) { + this.outputTranscription = outputTranscription; return this; } @java.lang.Override - public DeidentifyAudioRequest build() { - return new DeidentifyAudioRequest( - vaultId, + public DeidentifyFileAudioRequestDeidentifyAudio build() { + return new DeidentifyFileAudioRequestDeidentifyAudio( file, - configurationId, - outputProcessedAudio, + vaultId, outputTranscription, - bleepGain, - bleepFrequency, + outputProcessedAudio, bleepStartPadding, bleepStopPadding, + bleepFrequency, + bleepGain, entityTypes, tokenType, allowRegex, restrictRegex, transformations, + configurationId, additionalProperties); } } 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/DeidentifyFileDocumentPdfRequestDeidentifyPdf.java similarity index 50% rename from src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPdfRequest.java rename to src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileDocumentPdfRequestDeidentifyPdf.java index 4927eff3..30f803aa 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/DeidentifyFileDocumentPdfRequestDeidentifyPdf.java @@ -12,9 +12,9 @@ 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.DeidentifyPdfRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; +import com.skyflow.generated.rest.resources.files.types.DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem; +import com.skyflow.generated.rest.types.FileDataDeidentifyPdf; +import com.skyflow.generated.rest.types.TokenTypeMapping; import com.skyflow.generated.rest.types.Transformations; import java.util.HashMap; import java.util.List; @@ -24,21 +24,19 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyPdfRequest.Builder.class) -public final class DeidentifyPdfRequest { - private final String vaultId; - - private final DeidentifyPdfRequestFile file; +@JsonDeserialize(builder = DeidentifyFileDocumentPdfRequestDeidentifyPdf.Builder.class) +public final class DeidentifyFileDocumentPdfRequestDeidentifyPdf { + private final FileDataDeidentifyPdf file; - private final Optional configurationId; + private final String vaultId; - private final Optional density; + private final Optional density; - private final Optional maxResolution; + private final Optional maxResolution; - private final Optional> entityTypes; + private final Optional> entityTypes; - private final Optional tokenType; + private final Optional tokenType; private final Optional> allowRegex; @@ -46,23 +44,24 @@ public final class DeidentifyPdfRequest { private final Optional transformations; + private final Optional configurationId; + private final Map additionalProperties; - private DeidentifyPdfRequest( + private DeidentifyFileDocumentPdfRequestDeidentifyPdf( + FileDataDeidentifyPdf file, String vaultId, - DeidentifyPdfRequestFile file, - Optional configurationId, - Optional density, - Optional maxResolution, - Optional> entityTypes, - Optional tokenType, + Optional density, + Optional maxResolution, + Optional> entityTypes, + Optional tokenType, Optional> allowRegex, Optional> restrictRegex, Optional transformations, + Optional configurationId, Map additionalProperties) { - this.vaultId = vaultId; this.file = file; - this.configurationId = configurationId; + this.vaultId = vaultId; this.density = density; this.maxResolution = maxResolution; this.entityTypes = entityTypes; @@ -70,32 +69,28 @@ private DeidentifyPdfRequest( this.allowRegex = allowRegex; this.restrictRegex = restrictRegex; this.transformations = transformations; + this.configurationId = configurationId; this.additionalProperties = additionalProperties; } - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ @JsonProperty("file") - public DeidentifyPdfRequestFile getFile() { + public FileDataDeidentifyPdf getFile() { return file; } - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; } /** * @return Pixel density at which to process the PDF file. */ @JsonProperty("density") - public Optional getDensity() { + public Optional getDensity() { return density; } @@ -103,25 +98,34 @@ public Optional getDensity() { * @return Max resolution at which to process the PDF file. */ @JsonProperty("max_resolution") - public Optional getMaxResolution() { + public Optional getMaxResolution() { return maxResolution; } + /** + * @return Entities to detect and de-identify. + */ @JsonProperty("entity_types") - public Optional> getEntityTypes() { + public Optional> getEntityTypes() { return entityTypes; } @JsonProperty("token_type") - public Optional getTokenType() { + public Optional getTokenType() { return tokenType; } + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ @JsonProperty("allow_regex") public Optional> getAllowRegex() { return allowRegex; } + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ @JsonProperty("restrict_regex") public Optional> getRestrictRegex() { return restrictRegex; @@ -132,10 +136,19 @@ public Optional getTransformations() { return transformations; } + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyPdfRequest && equalTo((DeidentifyPdfRequest) other); + return other instanceof DeidentifyFileDocumentPdfRequestDeidentifyPdf + && equalTo((DeidentifyFileDocumentPdfRequestDeidentifyPdf) other); } @JsonAnyGetter @@ -143,32 +156,32 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyPdfRequest other) { - return vaultId.equals(other.vaultId) - && file.equals(other.file) - && configurationId.equals(other.configurationId) + private boolean equalTo(DeidentifyFileDocumentPdfRequestDeidentifyPdf other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) && density.equals(other.density) && maxResolution.equals(other.maxResolution) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); } @java.lang.Override public int hashCode() { return Objects.hash( - this.vaultId, this.file, - this.configurationId, + this.vaultId, this.density, this.maxResolution, this.entityTypes, this.tokenType, this.allowRegex, this.restrictRegex, - this.transformations); + this.transformations, + this.configurationId); } @java.lang.Override @@ -176,56 +189,62 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static FileStage builder() { return new Builder(); } - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyPdf file); - Builder from(DeidentifyPdfRequest other); + Builder from(DeidentifyFileDocumentPdfRequestDeidentifyPdf other); } - public interface FileStage { + public interface VaultIdStage { /** - * File to de-identify. Files are specified as Base64-encoded data. + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. */ - _FinalStage file(@NotNull DeidentifyPdfRequestFile file); + _FinalStage vaultId(@NotNull String vaultId); } public interface _FinalStage { - DeidentifyPdfRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); + DeidentifyFileDocumentPdfRequestDeidentifyPdf build(); /** *

Pixel density at which to process the PDF file.

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

Max resolution at which to process the PDF file.

*/ - _FinalStage maxResolution(Optional maxResolution); + _FinalStage maxResolution(Optional maxResolution); - _FinalStage maxResolution(Double maxResolution); + _FinalStage maxResolution(Integer maxResolution); - _FinalStage entityTypes(Optional> entityTypes); + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes( + Optional> entityTypes); - _FinalStage entityTypes(List entityTypes); + _FinalStage entityTypes(List entityTypes); - _FinalStage tokenType(Optional tokenType); + _FinalStage tokenType(Optional tokenType); - _FinalStage tokenType(TokenTypeWithoutVault tokenType); + _FinalStage tokenType(TokenTypeMapping tokenType); + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ _FinalStage restrictRegex(Optional> restrictRegex); _FinalStage restrictRegex(List restrictRegex); @@ -233,13 +252,22 @@ public interface _FinalStage { _FinalStage transformations(Optional transformations); _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyPdf file; + private String vaultId; - private DeidentifyPdfRequestFile file; + private Optional configurationId = Optional.empty(); private Optional transformations = Optional.empty(); @@ -247,15 +275,14 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> allowRegex = Optional.empty(); - private Optional tokenType = Optional.empty(); + private Optional tokenType = Optional.empty(); - private Optional> entityTypes = Optional.empty(); + private Optional> entityTypes = + Optional.empty(); - private Optional maxResolution = Optional.empty(); + private Optional maxResolution = Optional.empty(); - private Optional density = Optional.empty(); - - private Optional configurationId = Optional.empty(); + private Optional density = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -263,10 +290,9 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Builder() {} @java.lang.Override - public Builder from(DeidentifyPdfRequest other) { - vaultId(other.getVaultId()); + public Builder from(DeidentifyFileDocumentPdfRequestDeidentifyPdf other) { file(other.getFile()); - configurationId(other.getConfigurationId()); + vaultId(other.getVaultId()); density(other.getDensity()); maxResolution(other.getMaxResolution()); entityTypes(other.getEntityTypes()); @@ -274,24 +300,45 @@ public Builder from(DeidentifyPdfRequest other) { allowRegex(other.getAllowRegex()); restrictRegex(other.getRestrictRegex()); transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); return this; } + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyPdf file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { + public _FinalStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); return this; } /** - * File to de-identify. Files are specified as Base64-encoded data.

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

+ *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; return this; } @@ -308,12 +355,19 @@ public _FinalStage transformations(Optional transformations) { return this; } + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ @java.lang.Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { @@ -335,27 +396,35 @@ public _FinalStage allowRegex(Optional> allowRegex) { } @java.lang.Override - public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { + public _FinalStage tokenType(TokenTypeMapping tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } @java.lang.Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { + public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ @java.lang.Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { + public _FinalStage entityTypes( + Optional> entityTypes) { this.entityTypes = entityTypes; return this; } @@ -365,7 +434,7 @@ public _FinalStage entityTypes(Optional> entityTypes) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage maxResolution(Double maxResolution) { + public _FinalStage maxResolution(Integer maxResolution) { this.maxResolution = Optional.ofNullable(maxResolution); return this; } @@ -375,7 +444,7 @@ public _FinalStage maxResolution(Double maxResolution) { */ @java.lang.Override @JsonSetter(value = "max_resolution", nulls = Nulls.SKIP) - public _FinalStage maxResolution(Optional maxResolution) { + public _FinalStage maxResolution(Optional maxResolution) { this.maxResolution = maxResolution; return this; } @@ -385,7 +454,7 @@ public _FinalStage maxResolution(Optional maxResolution) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage density(Double density) { + public _FinalStage density(Integer density) { this.density = Optional.ofNullable(density); return this; } @@ -395,30 +464,16 @@ public _FinalStage density(Double density) { */ @java.lang.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 - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifyPdfRequest build() { - return new DeidentifyPdfRequest( - vaultId, + public DeidentifyFileDocumentPdfRequestDeidentifyPdf build() { + return new DeidentifyFileDocumentPdfRequestDeidentifyPdf( file, - configurationId, + vaultId, density, maxResolution, entityTypes, @@ -426,6 +481,7 @@ public DeidentifyPdfRequest build() { allowRegex, restrictRegex, transformations, + configurationId, additionalProperties); } } 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/DeidentifyFileImageRequestDeidentifyImage.java similarity index 54% rename from src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyImageRequest.java rename to src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileImageRequestDeidentifyImage.java index 92445d02..44c14777 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/DeidentifyFileImageRequestDeidentifyImage.java @@ -12,10 +12,10 @@ 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.DeidentifyImageRequestFile; -import com.skyflow.generated.rest.resources.files.types.DeidentifyImageRequestMaskingMethod; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; +import com.skyflow.generated.rest.resources.files.types.DeidentifyFileImageRequestDeidentifyImageEntityTypesItem; +import com.skyflow.generated.rest.resources.files.types.DeidentifyFileImageRequestDeidentifyImageMaskingMethod; +import com.skyflow.generated.rest.types.FileDataDeidentifyImage; +import com.skyflow.generated.rest.types.TokenTypeMapping; import com.skyflow.generated.rest.types.Transformations; import java.util.HashMap; import java.util.List; @@ -25,23 +25,21 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyImageRequest.Builder.class) -public final class DeidentifyImageRequest { - private final String vaultId; - - private final DeidentifyImageRequestFile file; +@JsonDeserialize(builder = DeidentifyFileImageRequestDeidentifyImage.Builder.class) +public final class DeidentifyFileImageRequestDeidentifyImage { + private final FileDataDeidentifyImage file; - private final Optional configurationId; + private final String vaultId; private final Optional outputProcessedImage; private final Optional outputOcrText; - private final Optional maskingMethod; + private final Optional maskingMethod; - private final Optional> entityTypes; + private final Optional> entityTypes; - private final Optional tokenType; + private final Optional tokenType; private final Optional> allowRegex; @@ -49,24 +47,25 @@ public final class DeidentifyImageRequest { private final Optional transformations; + private final Optional configurationId; + private final Map additionalProperties; - private DeidentifyImageRequest( + private DeidentifyFileImageRequestDeidentifyImage( + FileDataDeidentifyImage file, String vaultId, - DeidentifyImageRequestFile file, - Optional configurationId, Optional outputProcessedImage, Optional outputOcrText, - Optional maskingMethod, - Optional> entityTypes, - Optional tokenType, + Optional maskingMethod, + Optional> entityTypes, + Optional tokenType, Optional> allowRegex, Optional> restrictRegex, Optional transformations, + Optional configurationId, Map additionalProperties) { - this.vaultId = vaultId; this.file = file; - this.configurationId = configurationId; + this.vaultId = vaultId; this.outputProcessedImage = outputProcessedImage; this.outputOcrText = outputOcrText; this.maskingMethod = maskingMethod; @@ -75,25 +74,21 @@ private DeidentifyImageRequest( this.allowRegex = allowRegex; this.restrictRegex = restrictRegex; this.transformations = transformations; + this.configurationId = configurationId; this.additionalProperties = additionalProperties; } - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ @JsonProperty("file") - public DeidentifyImageRequestFile getFile() { + public FileDataDeidentifyImage getFile() { return file; } - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; } /** @@ -105,7 +100,7 @@ public Optional getOutputProcessedImage() { } /** - * @return If true, includes OCR text output in the response. + * @return If true, includes text detected by OCR in the response. */ @JsonProperty("output_ocr_text") public Optional getOutputOcrText() { @@ -116,25 +111,34 @@ public Optional getOutputOcrText() { * @return Method to mask the entities in the image. */ @JsonProperty("masking_method") - public Optional getMaskingMethod() { + public Optional getMaskingMethod() { return maskingMethod; } + /** + * @return Entities to detect and de-identify. + */ @JsonProperty("entity_types") - public Optional> getEntityTypes() { + public Optional> getEntityTypes() { return entityTypes; } @JsonProperty("token_type") - public Optional getTokenType() { + public Optional getTokenType() { return tokenType; } + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ @JsonProperty("allow_regex") public Optional> getAllowRegex() { return allowRegex; } + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ @JsonProperty("restrict_regex") public Optional> getRestrictRegex() { return restrictRegex; @@ -145,10 +149,19 @@ public Optional getTransformations() { return transformations; } + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyImageRequest && equalTo((DeidentifyImageRequest) other); + return other instanceof DeidentifyFileImageRequestDeidentifyImage + && equalTo((DeidentifyFileImageRequestDeidentifyImage) other); } @JsonAnyGetter @@ -156,10 +169,9 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyImageRequest other) { - return vaultId.equals(other.vaultId) - && file.equals(other.file) - && configurationId.equals(other.configurationId) + private boolean equalTo(DeidentifyFileImageRequestDeidentifyImage other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) && outputProcessedImage.equals(other.outputProcessedImage) && outputOcrText.equals(other.outputOcrText) && maskingMethod.equals(other.maskingMethod) @@ -167,15 +179,15 @@ private boolean equalTo(DeidentifyImageRequest other) { && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); } @java.lang.Override public int hashCode() { return Objects.hash( - this.vaultId, this.file, - this.configurationId, + this.vaultId, this.outputProcessedImage, this.outputOcrText, this.maskingMethod, @@ -183,7 +195,8 @@ public int hashCode() { this.tokenType, this.allowRegex, this.restrictRegex, - this.transformations); + this.transformations, + this.configurationId); } @java.lang.Override @@ -191,29 +204,25 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static FileStage builder() { return new Builder(); } - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyImage file); - Builder from(DeidentifyImageRequest other); + Builder from(DeidentifyFileImageRequestDeidentifyImage other); } - public interface FileStage { + public interface VaultIdStage { /** - * File to de-identify. Files are specified as Base64-encoded data. + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. */ - _FinalStage file(@NotNull DeidentifyImageRequestFile file); + _FinalStage vaultId(@NotNull String vaultId); } public interface _FinalStage { - DeidentifyImageRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); + DeidentifyFileImageRequestDeidentifyImage build(); /** *

If true, includes processed image in the output.

@@ -223,7 +232,7 @@ public interface _FinalStage { _FinalStage outputProcessedImage(Boolean outputProcessedImage); /** - *

If true, includes OCR text output in the response.

+ *

If true, includes text detected by OCR in the response.

*/ _FinalStage outputOcrText(Optional outputOcrText); @@ -232,22 +241,31 @@ public interface _FinalStage { /** *

Method to mask the entities in the image.

*/ - _FinalStage maskingMethod(Optional maskingMethod); + _FinalStage maskingMethod(Optional maskingMethod); - _FinalStage maskingMethod(DeidentifyImageRequestMaskingMethod maskingMethod); + _FinalStage maskingMethod(DeidentifyFileImageRequestDeidentifyImageMaskingMethod maskingMethod); - _FinalStage entityTypes(Optional> entityTypes); + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); - _FinalStage entityTypes(List entityTypes); + _FinalStage entityTypes(List entityTypes); - _FinalStage tokenType(Optional tokenType); + _FinalStage tokenType(Optional tokenType); - _FinalStage tokenType(TokenTypeWithoutVault tokenType); + _FinalStage tokenType(TokenTypeMapping tokenType); + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ _FinalStage restrictRegex(Optional> restrictRegex); _FinalStage restrictRegex(List restrictRegex); @@ -255,13 +273,22 @@ public interface _FinalStage { _FinalStage transformations(Optional transformations); _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyImage file; + private String vaultId; - private DeidentifyImageRequestFile file; + private Optional configurationId = Optional.empty(); private Optional transformations = Optional.empty(); @@ -269,28 +296,25 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> allowRegex = Optional.empty(); - private Optional tokenType = Optional.empty(); + private Optional tokenType = Optional.empty(); - private Optional> entityTypes = Optional.empty(); + private Optional> entityTypes = Optional.empty(); - private Optional maskingMethod = Optional.empty(); + private Optional maskingMethod = Optional.empty(); private Optional outputOcrText = Optional.empty(); private Optional outputProcessedImage = Optional.empty(); - private Optional configurationId = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override - public Builder from(DeidentifyImageRequest other) { - vaultId(other.getVaultId()); + public Builder from(DeidentifyFileImageRequestDeidentifyImage other) { file(other.getFile()); - configurationId(other.getConfigurationId()); + vaultId(other.getVaultId()); outputProcessedImage(other.getOutputProcessedImage()); outputOcrText(other.getOutputOcrText()); maskingMethod(other.getMaskingMethod()); @@ -299,24 +323,45 @@ public Builder from(DeidentifyImageRequest other) { allowRegex(other.getAllowRegex()); restrictRegex(other.getRestrictRegex()); transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); return this; } + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyImage file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { + public _FinalStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); return this; } /** - * File to de-identify. Files are specified as Base64-encoded data.

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

+ *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; return this; } @@ -333,12 +378,19 @@ public _FinalStage transformations(Optional transformations) { return this; } + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ @java.lang.Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { @@ -360,27 +419,35 @@ public _FinalStage allowRegex(Optional> allowRegex) { } @java.lang.Override - public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { + public _FinalStage tokenType(TokenTypeMapping tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } @java.lang.Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { + public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ @java.lang.Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { + public _FinalStage entityTypes( + Optional> entityTypes) { this.entityTypes = entityTypes; return this; } @@ -390,7 +457,7 @@ public _FinalStage entityTypes(Optional> entityTypes) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage maskingMethod(DeidentifyImageRequestMaskingMethod maskingMethod) { + public _FinalStage maskingMethod(DeidentifyFileImageRequestDeidentifyImageMaskingMethod maskingMethod) { this.maskingMethod = Optional.ofNullable(maskingMethod); return this; } @@ -400,13 +467,14 @@ public _FinalStage maskingMethod(DeidentifyImageRequestMaskingMethod maskingMeth */ @java.lang.Override @JsonSetter(value = "masking_method", nulls = Nulls.SKIP) - public _FinalStage maskingMethod(Optional maskingMethod) { + public _FinalStage maskingMethod( + Optional maskingMethod) { this.maskingMethod = maskingMethod; return this; } /** - *

If true, includes OCR text output in the response.

+ *

If true, includes text detected by OCR in the response.

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

If true, includes OCR text output in the response.

+ *

If true, includes text detected by OCR in the response.

*/ @java.lang.Override @JsonSetter(value = "output_ocr_text", nulls = Nulls.SKIP) @@ -446,24 +514,10 @@ public _FinalStage outputProcessedImage(Optional outputProcessedImage) } @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifyImageRequest build() { - return new DeidentifyImageRequest( - vaultId, + public DeidentifyFileImageRequestDeidentifyImage build() { + return new DeidentifyFileImageRequestDeidentifyImage( file, - configurationId, + vaultId, outputProcessedImage, outputOcrText, maskingMethod, @@ -472,6 +526,7 @@ public DeidentifyImageRequest build() { allowRegex, restrictRegex, transformations, + configurationId, additionalProperties); } } 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 ae21845d..32cd5cca 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 @@ -12,9 +12,9 @@ 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.DeidentifyFileRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; +import com.skyflow.generated.rest.resources.files.types.DeidentifyFileRequestEntityTypesItem; +import com.skyflow.generated.rest.types.FileData; +import com.skyflow.generated.rest.types.TokenTypeMapping; import com.skyflow.generated.rest.types.Transformations; import java.util.HashMap; import java.util.List; @@ -26,15 +26,13 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DeidentifyFileRequest.Builder.class) public final class DeidentifyFileRequest { - private final String vaultId; - - private final DeidentifyFileRequestFile file; + private final FileData file; - private final Optional configurationId; + private final String vaultId; - private final Optional> entityTypes; + private final Optional> entityTypes; - private final Optional tokenType; + private final Optional tokenType; private final Optional> allowRegex; @@ -42,62 +40,68 @@ public final class DeidentifyFileRequest { private final Optional transformations; + private final Optional configurationId; + private final Map additionalProperties; private DeidentifyFileRequest( + FileData file, String vaultId, - DeidentifyFileRequestFile file, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, + Optional> entityTypes, + Optional tokenType, Optional> allowRegex, Optional> restrictRegex, Optional transformations, + Optional configurationId, Map additionalProperties) { - this.vaultId = vaultId; this.file = file; - this.configurationId = configurationId; + this.vaultId = vaultId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; this.restrictRegex = restrictRegex; this.transformations = transformations; + this.configurationId = configurationId; this.additionalProperties = additionalProperties; } + @JsonProperty("file") + public FileData getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ @JsonProperty("vault_id") public String getVaultId() { return vaultId; } /** - * @return File to de-identify. Files are specified as Base64-encoded data. + * @return Entities to detect and de-identify. */ - @JsonProperty("file") - public DeidentifyFileRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; - } - @JsonProperty("entity_types") - public Optional> getEntityTypes() { + public Optional> getEntityTypes() { return entityTypes; } @JsonProperty("token_type") - public Optional getTokenType() { + public Optional getTokenType() { return tokenType; } + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ @JsonProperty("allow_regex") public Optional> getAllowRegex() { return allowRegex; } + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ @JsonProperty("restrict_regex") public Optional> getRestrictRegex() { return restrictRegex; @@ -108,6 +112,14 @@ public Optional getTransformations() { return transformations; } + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -120,27 +132,27 @@ public Map getAdditionalProperties() { } private boolean equalTo(DeidentifyFileRequest other) { - return vaultId.equals(other.vaultId) - && file.equals(other.file) - && configurationId.equals(other.configurationId) + return file.equals(other.file) + && vaultId.equals(other.vaultId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); } @java.lang.Override public int hashCode() { return Objects.hash( - this.vaultId, this.file, - this.configurationId, + this.vaultId, this.entityTypes, this.tokenType, this.allowRegex, this.restrictRegex, - this.transformations); + this.transformations, + this.configurationId); } @java.lang.Override @@ -148,42 +160,47 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static FileStage builder() { return new Builder(); } - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); + public interface FileStage { + VaultIdStage file(@NotNull FileData file); Builder from(DeidentifyFileRequest other); } - public interface FileStage { + public interface VaultIdStage { /** - * File to de-identify. Files are specified as Base64-encoded data. + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. */ - _FinalStage file(@NotNull DeidentifyFileRequestFile file); + _FinalStage vaultId(@NotNull String vaultId); } public interface _FinalStage { DeidentifyFileRequest build(); - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); - _FinalStage entityTypes(List entityTypes); + _FinalStage entityTypes(List entityTypes); - _FinalStage tokenType(Optional tokenType); + _FinalStage tokenType(Optional tokenType); - _FinalStage tokenType(TokenTypeWithoutVault tokenType); + _FinalStage tokenType(TokenTypeMapping tokenType); + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ _FinalStage restrictRegex(Optional> restrictRegex); _FinalStage restrictRegex(List restrictRegex); @@ -191,13 +208,22 @@ public interface _FinalStage { _FinalStage transformations(Optional transformations); _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileData file; + private String vaultId; - private DeidentifyFileRequestFile file; + private Optional configurationId = Optional.empty(); private Optional transformations = Optional.empty(); @@ -205,11 +231,9 @@ public static final class Builder implements VaultIdStage, FileStage, _FinalStag private Optional> allowRegex = Optional.empty(); - private Optional tokenType = Optional.empty(); - - private Optional> entityTypes = Optional.empty(); + private Optional tokenType = Optional.empty(); - private Optional configurationId = Optional.empty(); + private Optional> entityTypes = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -218,32 +242,52 @@ private Builder() {} @java.lang.Override public Builder from(DeidentifyFileRequest other) { - vaultId(other.getVaultId()); file(other.getFile()); - configurationId(other.getConfigurationId()); + vaultId(other.getVaultId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); restrictRegex(other.getRestrictRegex()); transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileData file) { + this.file = Objects.requireNonNull(file, "file must not be null"); return this; } + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { + public _FinalStage vaultId(@NotNull String vaultId) { this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); return this; } /** - * File to de-identify. Files are specified as Base64-encoded data.

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

+ *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; return this; } @@ -260,12 +304,19 @@ public _FinalStage transformations(Optional transformations) { return this; } + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ @java.lang.Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { @@ -287,55 +345,49 @@ public _FinalStage allowRegex(Optional> allowRegex) { } @java.lang.Override - public _FinalStage tokenType(TokenTypeWithoutVault tokenType) { + public _FinalStage tokenType(TokenTypeMapping tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } @java.lang.Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { + public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ @java.lang.Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { + public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - @java.lang.Override public DeidentifyFileRequest build() { return new DeidentifyFileRequest( - vaultId, file, - configurationId, + vaultId, entityTypes, tokenType, allowRegex, restrictRegex, transformations, + configurationId, additionalProperties); } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyDocument.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyDocument.java new file mode 100644 index 00000000..9c1a098c --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyDocument.java @@ -0,0 +1,396 @@ +/** + * 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.DeidentifyFileRequestDeidentifyDocumentEntityTypesItem; +import com.skyflow.generated.rest.types.FileDataDeidentifyDocument; +import com.skyflow.generated.rest.types.TokenTypeMapping; +import com.skyflow.generated.rest.types.Transformations; +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 = DeidentifyFileRequestDeidentifyDocument.Builder.class) +public final class DeidentifyFileRequestDeidentifyDocument { + private final FileDataDeidentifyDocument file; + + private final String vaultId; + + private final Optional> entityTypes; + + private final Optional tokenType; + + private final Optional> allowRegex; + + private final Optional> restrictRegex; + + private final Optional transformations; + + private final Optional configurationId; + + private final Map additionalProperties; + + private DeidentifyFileRequestDeidentifyDocument( + FileDataDeidentifyDocument file, + String vaultId, + Optional> entityTypes, + Optional tokenType, + Optional> allowRegex, + Optional> restrictRegex, + Optional transformations, + Optional configurationId, + Map additionalProperties) { + this.file = file; + this.vaultId = vaultId; + this.entityTypes = entityTypes; + this.tokenType = tokenType; + this.allowRegex = allowRegex; + this.restrictRegex = restrictRegex; + this.transformations = transformations; + this.configurationId = configurationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("file") + public FileDataDeidentifyDocument getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return Entities to detect and de-identify. + */ + @JsonProperty("entity_types") + public Optional> getEntityTypes() { + return entityTypes; + } + + @JsonProperty("token_type") + public Optional getTokenType() { + return tokenType; + } + + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ + @JsonProperty("allow_regex") + public Optional> getAllowRegex() { + return allowRegex; + } + + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ + @JsonProperty("restrict_regex") + public Optional> getRestrictRegex() { + return restrictRegex; + } + + @JsonProperty("transformations") + public Optional getTransformations() { + return transformations; + } + + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeidentifyFileRequestDeidentifyDocument + && equalTo((DeidentifyFileRequestDeidentifyDocument) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeidentifyFileRequestDeidentifyDocument other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) + && entityTypes.equals(other.entityTypes) + && tokenType.equals(other.tokenType) + && allowRegex.equals(other.allowRegex) + && restrictRegex.equals(other.restrictRegex) + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.file, + this.vaultId, + this.entityTypes, + this.tokenType, + this.allowRegex, + this.restrictRegex, + this.transformations, + this.configurationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FileStage builder() { + return new Builder(); + } + + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyDocument file); + + Builder from(DeidentifyFileRequestDeidentifyDocument other); + } + + public interface VaultIdStage { + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + _FinalStage vaultId(@NotNull String vaultId); + } + + public interface _FinalStage { + DeidentifyFileRequestDeidentifyDocument build(); + + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); + + _FinalStage entityTypes(List entityTypes); + + _FinalStage tokenType(Optional tokenType); + + _FinalStage tokenType(TokenTypeMapping tokenType); + + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ + _FinalStage restrictRegex(Optional> restrictRegex); + + _FinalStage restrictRegex(List restrictRegex); + + _FinalStage transformations(Optional transformations); + + _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyDocument file; + + private String vaultId; + + private Optional configurationId = Optional.empty(); + + private Optional transformations = Optional.empty(); + + private Optional> restrictRegex = Optional.empty(); + + private Optional> allowRegex = Optional.empty(); + + private Optional tokenType = Optional.empty(); + + private Optional> entityTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeidentifyFileRequestDeidentifyDocument other) { + file(other.getFile()); + vaultId(other.getVaultId()); + entityTypes(other.getEntityTypes()); + tokenType(other.getTokenType()); + allowRegex(other.getAllowRegex()); + restrictRegex(other.getRestrictRegex()); + transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyDocument file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @java.lang.Override + public _FinalStage transformations(Transformations transformations) { + this.transformations = Optional.ofNullable(transformations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "transformations", nulls = Nulls.SKIP) + public _FinalStage transformations(Optional transformations) { + this.transformations = transformations; + return this; + } + + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ + @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 tokenType(TokenTypeMapping tokenType) { + this.tokenType = Optional.ofNullable(tokenType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_type", nulls = Nulls.SKIP) + public _FinalStage tokenType(Optional tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ + @java.lang.Override + @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) + public _FinalStage entityTypes( + Optional> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + @java.lang.Override + public DeidentifyFileRequestDeidentifyDocument build() { + return new DeidentifyFileRequestDeidentifyDocument( + file, + vaultId, + entityTypes, + tokenType, + allowRegex, + restrictRegex, + transformations, + configurationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyPresentation.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyPresentation.java new file mode 100644 index 00000000..54d35363 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyPresentation.java @@ -0,0 +1,397 @@ +/** + * 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.DeidentifyFileRequestDeidentifyPresentationEntityTypesItem; +import com.skyflow.generated.rest.types.FileDataDeidentifyPresentation; +import com.skyflow.generated.rest.types.TokenTypeMapping; +import com.skyflow.generated.rest.types.Transformations; +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 = DeidentifyFileRequestDeidentifyPresentation.Builder.class) +public final class DeidentifyFileRequestDeidentifyPresentation { + private final FileDataDeidentifyPresentation file; + + private final String vaultId; + + private final Optional> entityTypes; + + private final Optional tokenType; + + private final Optional> allowRegex; + + private final Optional> restrictRegex; + + private final Optional transformations; + + private final Optional configurationId; + + private final Map additionalProperties; + + private DeidentifyFileRequestDeidentifyPresentation( + FileDataDeidentifyPresentation file, + String vaultId, + Optional> entityTypes, + Optional tokenType, + Optional> allowRegex, + Optional> restrictRegex, + Optional transformations, + Optional configurationId, + Map additionalProperties) { + this.file = file; + this.vaultId = vaultId; + this.entityTypes = entityTypes; + this.tokenType = tokenType; + this.allowRegex = allowRegex; + this.restrictRegex = restrictRegex; + this.transformations = transformations; + this.configurationId = configurationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("file") + public FileDataDeidentifyPresentation getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return Entities to detect and de-identify. + */ + @JsonProperty("entity_types") + public Optional> getEntityTypes() { + return entityTypes; + } + + @JsonProperty("token_type") + public Optional getTokenType() { + return tokenType; + } + + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ + @JsonProperty("allow_regex") + public Optional> getAllowRegex() { + return allowRegex; + } + + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ + @JsonProperty("restrict_regex") + public Optional> getRestrictRegex() { + return restrictRegex; + } + + @JsonProperty("transformations") + public Optional getTransformations() { + return transformations; + } + + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeidentifyFileRequestDeidentifyPresentation + && equalTo((DeidentifyFileRequestDeidentifyPresentation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeidentifyFileRequestDeidentifyPresentation other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) + && entityTypes.equals(other.entityTypes) + && tokenType.equals(other.tokenType) + && allowRegex.equals(other.allowRegex) + && restrictRegex.equals(other.restrictRegex) + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.file, + this.vaultId, + this.entityTypes, + this.tokenType, + this.allowRegex, + this.restrictRegex, + this.transformations, + this.configurationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FileStage builder() { + return new Builder(); + } + + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyPresentation file); + + Builder from(DeidentifyFileRequestDeidentifyPresentation other); + } + + public interface VaultIdStage { + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + _FinalStage vaultId(@NotNull String vaultId); + } + + public interface _FinalStage { + DeidentifyFileRequestDeidentifyPresentation build(); + + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); + + _FinalStage entityTypes(List entityTypes); + + _FinalStage tokenType(Optional tokenType); + + _FinalStage tokenType(TokenTypeMapping tokenType); + + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ + _FinalStage restrictRegex(Optional> restrictRegex); + + _FinalStage restrictRegex(List restrictRegex); + + _FinalStage transformations(Optional transformations); + + _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyPresentation file; + + private String vaultId; + + private Optional configurationId = Optional.empty(); + + private Optional transformations = Optional.empty(); + + private Optional> restrictRegex = Optional.empty(); + + private Optional> allowRegex = Optional.empty(); + + private Optional tokenType = Optional.empty(); + + private Optional> entityTypes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeidentifyFileRequestDeidentifyPresentation other) { + file(other.getFile()); + vaultId(other.getVaultId()); + entityTypes(other.getEntityTypes()); + tokenType(other.getTokenType()); + allowRegex(other.getAllowRegex()); + restrictRegex(other.getRestrictRegex()); + transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyPresentation file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @java.lang.Override + public _FinalStage transformations(Transformations transformations) { + this.transformations = Optional.ofNullable(transformations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "transformations", nulls = Nulls.SKIP) + public _FinalStage transformations(Optional transformations) { + this.transformations = transformations; + return this; + } + + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ + @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 tokenType(TokenTypeMapping tokenType) { + this.tokenType = Optional.ofNullable(tokenType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_type", nulls = Nulls.SKIP) + public _FinalStage tokenType(Optional tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ + @java.lang.Override + @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) + public _FinalStage entityTypes( + Optional> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + @java.lang.Override + public DeidentifyFileRequestDeidentifyPresentation build() { + return new DeidentifyFileRequestDeidentifyPresentation( + file, + vaultId, + entityTypes, + tokenType, + allowRegex, + restrictRegex, + transformations, + configurationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifySpreadsheet.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifySpreadsheet.java new file mode 100644 index 00000000..e00f4f13 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifySpreadsheet.java @@ -0,0 +1,397 @@ +/** + * 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.DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem; +import com.skyflow.generated.rest.types.FileDataDeidentifySpreadsheet; +import com.skyflow.generated.rest.types.TokenTypeMapping; +import com.skyflow.generated.rest.types.Transformations; +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 = DeidentifyFileRequestDeidentifySpreadsheet.Builder.class) +public final class DeidentifyFileRequestDeidentifySpreadsheet { + private final FileDataDeidentifySpreadsheet file; + + private final String vaultId; + + private final Optional> entityTypes; + + private final Optional tokenType; + + private final Optional> allowRegex; + + private final Optional> restrictRegex; + + private final Optional transformations; + + private final Optional configurationId; + + private final Map additionalProperties; + + private DeidentifyFileRequestDeidentifySpreadsheet( + FileDataDeidentifySpreadsheet file, + String vaultId, + Optional> entityTypes, + Optional tokenType, + Optional> allowRegex, + Optional> restrictRegex, + Optional transformations, + Optional configurationId, + Map additionalProperties) { + this.file = file; + this.vaultId = vaultId; + this.entityTypes = entityTypes; + this.tokenType = tokenType; + this.allowRegex = allowRegex; + this.restrictRegex = restrictRegex; + this.transformations = transformations; + this.configurationId = configurationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("file") + public FileDataDeidentifySpreadsheet getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return Entities to detect and de-identify. + */ + @JsonProperty("entity_types") + public Optional> getEntityTypes() { + return entityTypes; + } + + @JsonProperty("token_type") + public Optional getTokenType() { + return tokenType; + } + + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ + @JsonProperty("allow_regex") + public Optional> getAllowRegex() { + return allowRegex; + } + + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ + @JsonProperty("restrict_regex") + public Optional> getRestrictRegex() { + return restrictRegex; + } + + @JsonProperty("transformations") + public Optional getTransformations() { + return transformations; + } + + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeidentifyFileRequestDeidentifySpreadsheet + && equalTo((DeidentifyFileRequestDeidentifySpreadsheet) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeidentifyFileRequestDeidentifySpreadsheet other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) + && entityTypes.equals(other.entityTypes) + && tokenType.equals(other.tokenType) + && allowRegex.equals(other.allowRegex) + && restrictRegex.equals(other.restrictRegex) + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.file, + this.vaultId, + this.entityTypes, + this.tokenType, + this.allowRegex, + this.restrictRegex, + this.transformations, + this.configurationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FileStage builder() { + return new Builder(); + } + + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifySpreadsheet file); + + Builder from(DeidentifyFileRequestDeidentifySpreadsheet other); + } + + public interface VaultIdStage { + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + _FinalStage vaultId(@NotNull String vaultId); + } + + public interface _FinalStage { + DeidentifyFileRequestDeidentifySpreadsheet build(); + + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); + + _FinalStage entityTypes(List entityTypes); + + _FinalStage tokenType(Optional tokenType); + + _FinalStage tokenType(TokenTypeMapping tokenType); + + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ + _FinalStage restrictRegex(Optional> restrictRegex); + + _FinalStage restrictRegex(List restrictRegex); + + _FinalStage transformations(Optional transformations); + + _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifySpreadsheet file; + + private String vaultId; + + private Optional configurationId = Optional.empty(); + + private Optional transformations = Optional.empty(); + + private Optional> restrictRegex = Optional.empty(); + + private Optional> allowRegex = Optional.empty(); + + private Optional tokenType = Optional.empty(); + + private Optional> entityTypes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeidentifyFileRequestDeidentifySpreadsheet other) { + file(other.getFile()); + vaultId(other.getVaultId()); + entityTypes(other.getEntityTypes()); + tokenType(other.getTokenType()); + allowRegex(other.getAllowRegex()); + restrictRegex(other.getRestrictRegex()); + transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifySpreadsheet file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @java.lang.Override + public _FinalStage transformations(Transformations transformations) { + this.transformations = Optional.ofNullable(transformations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "transformations", nulls = Nulls.SKIP) + public _FinalStage transformations(Optional transformations) { + this.transformations = transformations; + return this; + } + + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ + @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 tokenType(TokenTypeMapping tokenType) { + this.tokenType = Optional.ofNullable(tokenType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_type", nulls = Nulls.SKIP) + public _FinalStage tokenType(Optional tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ + @java.lang.Override + @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) + public _FinalStage entityTypes( + Optional> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + @java.lang.Override + public DeidentifyFileRequestDeidentifySpreadsheet build() { + return new DeidentifyFileRequestDeidentifySpreadsheet( + file, + vaultId, + entityTypes, + tokenType, + allowRegex, + restrictRegex, + transformations, + configurationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyStructuredText.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyStructuredText.java new file mode 100644 index 00000000..e94a0f65 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyStructuredText.java @@ -0,0 +1,398 @@ +/** + * 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.DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem; +import com.skyflow.generated.rest.types.FileDataDeidentifyStructuredText; +import com.skyflow.generated.rest.types.TokenTypeMapping; +import com.skyflow.generated.rest.types.Transformations; +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 = DeidentifyFileRequestDeidentifyStructuredText.Builder.class) +public final class DeidentifyFileRequestDeidentifyStructuredText { + private final FileDataDeidentifyStructuredText file; + + private final String vaultId; + + private final Optional> entityTypes; + + private final Optional tokenType; + + private final Optional> allowRegex; + + private final Optional> restrictRegex; + + private final Optional transformations; + + private final Optional configurationId; + + private final Map additionalProperties; + + private DeidentifyFileRequestDeidentifyStructuredText( + FileDataDeidentifyStructuredText file, + String vaultId, + Optional> entityTypes, + Optional tokenType, + Optional> allowRegex, + Optional> restrictRegex, + Optional transformations, + Optional configurationId, + Map additionalProperties) { + this.file = file; + this.vaultId = vaultId; + this.entityTypes = entityTypes; + this.tokenType = tokenType; + this.allowRegex = allowRegex; + this.restrictRegex = restrictRegex; + this.transformations = transformations; + this.configurationId = configurationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("file") + public FileDataDeidentifyStructuredText getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return Entities to detect and de-identify. + */ + @JsonProperty("entity_types") + public Optional> getEntityTypes() { + return entityTypes; + } + + @JsonProperty("token_type") + public Optional getTokenType() { + return tokenType; + } + + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ + @JsonProperty("allow_regex") + public Optional> getAllowRegex() { + return allowRegex; + } + + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ + @JsonProperty("restrict_regex") + public Optional> getRestrictRegex() { + return restrictRegex; + } + + @JsonProperty("transformations") + public Optional getTransformations() { + return transformations; + } + + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeidentifyFileRequestDeidentifyStructuredText + && equalTo((DeidentifyFileRequestDeidentifyStructuredText) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeidentifyFileRequestDeidentifyStructuredText other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) + && entityTypes.equals(other.entityTypes) + && tokenType.equals(other.tokenType) + && allowRegex.equals(other.allowRegex) + && restrictRegex.equals(other.restrictRegex) + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.file, + this.vaultId, + this.entityTypes, + this.tokenType, + this.allowRegex, + this.restrictRegex, + this.transformations, + this.configurationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FileStage builder() { + return new Builder(); + } + + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyStructuredText file); + + Builder from(DeidentifyFileRequestDeidentifyStructuredText other); + } + + public interface VaultIdStage { + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + _FinalStage vaultId(@NotNull String vaultId); + } + + public interface _FinalStage { + DeidentifyFileRequestDeidentifyStructuredText build(); + + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes( + Optional> entityTypes); + + _FinalStage entityTypes(List entityTypes); + + _FinalStage tokenType(Optional tokenType); + + _FinalStage tokenType(TokenTypeMapping tokenType); + + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ + _FinalStage restrictRegex(Optional> restrictRegex); + + _FinalStage restrictRegex(List restrictRegex); + + _FinalStage transformations(Optional transformations); + + _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyStructuredText file; + + private String vaultId; + + private Optional configurationId = Optional.empty(); + + private Optional transformations = Optional.empty(); + + private Optional> restrictRegex = Optional.empty(); + + private Optional> allowRegex = Optional.empty(); + + private Optional tokenType = Optional.empty(); + + private Optional> entityTypes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeidentifyFileRequestDeidentifyStructuredText other) { + file(other.getFile()); + vaultId(other.getVaultId()); + entityTypes(other.getEntityTypes()); + tokenType(other.getTokenType()); + allowRegex(other.getAllowRegex()); + restrictRegex(other.getRestrictRegex()); + transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyStructuredText file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @java.lang.Override + public _FinalStage transformations(Transformations transformations) { + this.transformations = Optional.ofNullable(transformations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "transformations", nulls = Nulls.SKIP) + public _FinalStage transformations(Optional transformations) { + this.transformations = transformations; + return this; + } + + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ + @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 tokenType(TokenTypeMapping tokenType) { + this.tokenType = Optional.ofNullable(tokenType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_type", nulls = Nulls.SKIP) + public _FinalStage tokenType(Optional tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ + @java.lang.Override + @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) + public _FinalStage entityTypes( + Optional> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + @java.lang.Override + public DeidentifyFileRequestDeidentifyStructuredText build() { + return new DeidentifyFileRequestDeidentifyStructuredText( + file, + vaultId, + entityTypes, + tokenType, + allowRegex, + restrictRegex, + transformations, + configurationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyText.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyText.java new file mode 100644 index 00000000..a5757029 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyFileRequestDeidentifyText.java @@ -0,0 +1,395 @@ +/** + * 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.DeidentifyFileRequestDeidentifyTextEntityTypesItem; +import com.skyflow.generated.rest.types.FileDataDeidentifyText; +import com.skyflow.generated.rest.types.TokenTypeMapping; +import com.skyflow.generated.rest.types.Transformations; +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 = DeidentifyFileRequestDeidentifyText.Builder.class) +public final class DeidentifyFileRequestDeidentifyText { + private final FileDataDeidentifyText file; + + private final String vaultId; + + private final Optional> entityTypes; + + private final Optional tokenType; + + private final Optional> allowRegex; + + private final Optional> restrictRegex; + + private final Optional transformations; + + private final Optional configurationId; + + private final Map additionalProperties; + + private DeidentifyFileRequestDeidentifyText( + FileDataDeidentifyText file, + String vaultId, + Optional> entityTypes, + Optional tokenType, + Optional> allowRegex, + Optional> restrictRegex, + Optional transformations, + Optional configurationId, + Map additionalProperties) { + this.file = file; + this.vaultId = vaultId; + this.entityTypes = entityTypes; + this.tokenType = tokenType; + this.allowRegex = allowRegex; + this.restrictRegex = restrictRegex; + this.transformations = transformations; + this.configurationId = configurationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("file") + public FileDataDeidentifyText getFile() { + return file; + } + + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + /** + * @return Entities to detect and de-identify. + */ + @JsonProperty("entity_types") + public Optional> getEntityTypes() { + return entityTypes; + } + + @JsonProperty("token_type") + public Optional getTokenType() { + return tokenType; + } + + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ + @JsonProperty("allow_regex") + public Optional> getAllowRegex() { + return allowRegex; + } + + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ + @JsonProperty("restrict_regex") + public Optional> getRestrictRegex() { + return restrictRegex; + } + + @JsonProperty("transformations") + public Optional getTransformations() { + return transformations; + } + + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeidentifyFileRequestDeidentifyText + && equalTo((DeidentifyFileRequestDeidentifyText) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeidentifyFileRequestDeidentifyText other) { + return file.equals(other.file) + && vaultId.equals(other.vaultId) + && entityTypes.equals(other.entityTypes) + && tokenType.equals(other.tokenType) + && allowRegex.equals(other.allowRegex) + && restrictRegex.equals(other.restrictRegex) + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.file, + this.vaultId, + this.entityTypes, + this.tokenType, + this.allowRegex, + this.restrictRegex, + this.transformations, + this.configurationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FileStage builder() { + return new Builder(); + } + + public interface FileStage { + VaultIdStage file(@NotNull FileDataDeidentifyText file); + + Builder from(DeidentifyFileRequestDeidentifyText other); + } + + public interface VaultIdStage { + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + _FinalStage vaultId(@NotNull String vaultId); + } + + public interface _FinalStage { + DeidentifyFileRequestDeidentifyText build(); + + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); + + _FinalStage entityTypes(List entityTypes); + + _FinalStage tokenType(Optional tokenType); + + _FinalStage tokenType(TokenTypeMapping tokenType); + + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ + _FinalStage restrictRegex(Optional> restrictRegex); + + _FinalStage restrictRegex(List restrictRegex); + + _FinalStage transformations(Optional transformations); + + _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataDeidentifyText file; + + private String vaultId; + + private Optional configurationId = Optional.empty(); + + private Optional transformations = Optional.empty(); + + private Optional> restrictRegex = Optional.empty(); + + private Optional> allowRegex = Optional.empty(); + + private Optional tokenType = Optional.empty(); + + private Optional> entityTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeidentifyFileRequestDeidentifyText other) { + file(other.getFile()); + vaultId(other.getVaultId()); + entityTypes(other.getEntityTypes()); + tokenType(other.getTokenType()); + allowRegex(other.getAllowRegex()); + restrictRegex(other.getRestrictRegex()); + transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataDeidentifyText file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * ID of a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; + return this; + } + + @java.lang.Override + public _FinalStage transformations(Transformations transformations) { + this.transformations = Optional.ofNullable(transformations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "transformations", nulls = Nulls.SKIP) + public _FinalStage transformations(Optional transformations) { + this.transformations = transformations; + return this; + } + + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ + @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 tokenType(TokenTypeMapping tokenType) { + this.tokenType = Optional.ofNullable(tokenType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_type", nulls = Nulls.SKIP) + public _FinalStage tokenType(Optional tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ + @java.lang.Override + @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) + public _FinalStage entityTypes(Optional> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + @java.lang.Override + public DeidentifyFileRequestDeidentifyText build() { + return new DeidentifyFileRequestDeidentifyText( + file, + vaultId, + entityTypes, + tokenType, + allowRegex, + restrictRegex, + transformations, + configurationId, + additionalProperties); + } + } +} 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 deleted file mode 100644 index 95ced625..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyPresentationRequest.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * 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.DeidentifyPresentationRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; -import com.skyflow.generated.rest.types.Transformations; -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 = DeidentifyPresentationRequest.Builder.class) -public final class DeidentifyPresentationRequest { - private final String vaultId; - - private final DeidentifyPresentationRequestFile file; - - private final Optional configurationId; - - private final Optional> entityTypes; - - private final Optional tokenType; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional transformations; - - private final Map additionalProperties; - - private DeidentifyPresentationRequest( - String vaultId, - DeidentifyPresentationRequestFile file, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, - Optional> allowRegex, - Optional> restrictRegex, - Optional transformations, - Map additionalProperties) { - this.vaultId = vaultId; - this.file = file; - this.configurationId = configurationId; - this.entityTypes = entityTypes; - this.tokenType = tokenType; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.transformations = transformations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ - @JsonProperty("file") - public DeidentifyPresentationRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; - } - - @JsonProperty("entity_types") - public Optional> getEntityTypes() { - return entityTypes; - } - - @JsonProperty("token_type") - public Optional getTokenType() { - return tokenType; - } - - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - @JsonProperty("transformations") - public Optional getTransformations() { - return transformations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyPresentationRequest && equalTo((DeidentifyPresentationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - 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) - && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.vaultId, - this.file, - this.configurationId, - this.entityTypes, - this.tokenType, - this.allowRegex, - this.restrictRegex, - this.transformations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static VaultIdStage builder() { - return new Builder(); - } - - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); - - Builder from(DeidentifyPresentationRequest other); - } - - public interface FileStage { - /** - * File to de-identify. Files are specified as Base64-encoded data. - */ - _FinalStage file(@NotNull DeidentifyPresentationRequestFile file); - } - - public interface _FinalStage { - DeidentifyPresentationRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); - - _FinalStage entityTypes(List entityTypes); - - _FinalStage tokenType(Optional tokenType); - - _FinalStage tokenType(TokenTypeWithoutVault tokenType); - - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - _FinalStage transformations(Optional transformations); - - _FinalStage transformations(Transformations transformations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { - private String vaultId; - - private DeidentifyPresentationRequestFile file; - - private Optional transformations = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional tokenType = Optional.empty(); - - private Optional> entityTypes = Optional.empty(); - - private Optional configurationId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyPresentationRequest other) { - vaultId(other.getVaultId()); - file(other.getFile()); - configurationId(other.getConfigurationId()); - entityTypes(other.getEntityTypes()); - tokenType(other.getTokenType()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - transformations(other.getTransformations()); - return this; - } - - @java.lang.Override - @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - * File to 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 - @JsonSetter("file") - public _FinalStage file(@NotNull DeidentifyPresentationRequestFile file) { - this.file = Objects.requireNonNull(file, "file must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage transformations(Transformations transformations) { - this.transformations = Optional.ofNullable(transformations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "transformations", nulls = Nulls.SKIP) - public _FinalStage transformations(Optional transformations) { - this.transformations = transformations; - return this; - } - - @java.lang.Override - public _FinalStage restrictRegex(List restrictRegex) { - this.restrictRegex = Optional.ofNullable(restrictRegex); - return this; - } - - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - @java.lang.Override - public _FinalStage allowRegex(List allowRegex) { - this.allowRegex = Optional.ofNullable(allowRegex); - return this; - } - - @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 tokenType(TokenTypeWithoutVault tokenType) { - this.tokenType = Optional.ofNullable(tokenType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { - this.tokenType = tokenType; - return this; - } - - @java.lang.Override - public _FinalStage entityTypes(List entityTypes) { - this.entityTypes = Optional.ofNullable(entityTypes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { - this.entityTypes = entityTypes; - return this; - } - - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifyPresentationRequest build() { - return new DeidentifyPresentationRequest( - vaultId, - file, - configurationId, - entityTypes, - tokenType, - allowRegex, - restrictRegex, - transformations, - additionalProperties); - } - } -} 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 deleted file mode 100644 index 283457f8..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifySpreadsheetRequest.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * 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.DeidentifySpreadsheetRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; -import com.skyflow.generated.rest.types.Transformations; -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 = DeidentifySpreadsheetRequest.Builder.class) -public final class DeidentifySpreadsheetRequest { - private final String vaultId; - - private final DeidentifySpreadsheetRequestFile file; - - private final Optional configurationId; - - private final Optional> entityTypes; - - private final Optional tokenType; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional transformations; - - private final Map additionalProperties; - - private DeidentifySpreadsheetRequest( - String vaultId, - DeidentifySpreadsheetRequestFile file, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, - Optional> allowRegex, - Optional> restrictRegex, - Optional transformations, - Map additionalProperties) { - this.vaultId = vaultId; - this.file = file; - this.configurationId = configurationId; - this.entityTypes = entityTypes; - this.tokenType = tokenType; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.transformations = transformations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ - @JsonProperty("file") - public DeidentifySpreadsheetRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; - } - - @JsonProperty("entity_types") - public Optional> getEntityTypes() { - return entityTypes; - } - - @JsonProperty("token_type") - public Optional getTokenType() { - return tokenType; - } - - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - @JsonProperty("transformations") - public Optional getTransformations() { - return transformations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifySpreadsheetRequest && equalTo((DeidentifySpreadsheetRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - 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) - && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.vaultId, - this.file, - this.configurationId, - this.entityTypes, - this.tokenType, - this.allowRegex, - this.restrictRegex, - this.transformations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static VaultIdStage builder() { - return new Builder(); - } - - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); - - Builder from(DeidentifySpreadsheetRequest other); - } - - public interface FileStage { - /** - * File to de-identify. Files are specified as Base64-encoded data. - */ - _FinalStage file(@NotNull DeidentifySpreadsheetRequestFile file); - } - - public interface _FinalStage { - DeidentifySpreadsheetRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); - - _FinalStage entityTypes(List entityTypes); - - _FinalStage tokenType(Optional tokenType); - - _FinalStage tokenType(TokenTypeWithoutVault tokenType); - - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - _FinalStage transformations(Optional transformations); - - _FinalStage transformations(Transformations transformations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { - private String vaultId; - - private DeidentifySpreadsheetRequestFile file; - - private Optional transformations = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional tokenType = Optional.empty(); - - private Optional> entityTypes = Optional.empty(); - - private Optional configurationId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifySpreadsheetRequest other) { - vaultId(other.getVaultId()); - file(other.getFile()); - configurationId(other.getConfigurationId()); - entityTypes(other.getEntityTypes()); - tokenType(other.getTokenType()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - transformations(other.getTransformations()); - return this; - } - - @java.lang.Override - @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - * File to 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 - @JsonSetter("file") - public _FinalStage file(@NotNull DeidentifySpreadsheetRequestFile file) { - this.file = Objects.requireNonNull(file, "file must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage transformations(Transformations transformations) { - this.transformations = Optional.ofNullable(transformations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "transformations", nulls = Nulls.SKIP) - public _FinalStage transformations(Optional transformations) { - this.transformations = transformations; - return this; - } - - @java.lang.Override - public _FinalStage restrictRegex(List restrictRegex) { - this.restrictRegex = Optional.ofNullable(restrictRegex); - return this; - } - - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - @java.lang.Override - public _FinalStage allowRegex(List allowRegex) { - this.allowRegex = Optional.ofNullable(allowRegex); - return this; - } - - @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 tokenType(TokenTypeWithoutVault tokenType) { - this.tokenType = Optional.ofNullable(tokenType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { - this.tokenType = tokenType; - return this; - } - - @java.lang.Override - public _FinalStage entityTypes(List entityTypes) { - this.entityTypes = Optional.ofNullable(entityTypes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { - this.entityTypes = entityTypes; - return this; - } - - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifySpreadsheetRequest build() { - return new DeidentifySpreadsheetRequest( - vaultId, - file, - configurationId, - entityTypes, - tokenType, - allowRegex, - restrictRegex, - transformations, - additionalProperties); - } - } -} 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 deleted file mode 100644 index 8ff7e195..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyStructuredTextRequest.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * 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.DeidentifyStructuredTextRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; -import com.skyflow.generated.rest.types.Transformations; -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 = DeidentifyStructuredTextRequest.Builder.class) -public final class DeidentifyStructuredTextRequest { - private final String vaultId; - - private final DeidentifyStructuredTextRequestFile file; - - private final Optional configurationId; - - private final Optional> entityTypes; - - private final Optional tokenType; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional transformations; - - private final Map additionalProperties; - - private DeidentifyStructuredTextRequest( - String vaultId, - DeidentifyStructuredTextRequestFile file, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, - Optional> allowRegex, - Optional> restrictRegex, - Optional transformations, - Map additionalProperties) { - this.vaultId = vaultId; - this.file = file; - this.configurationId = configurationId; - this.entityTypes = entityTypes; - this.tokenType = tokenType; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.transformations = transformations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ - @JsonProperty("file") - public DeidentifyStructuredTextRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; - } - - @JsonProperty("entity_types") - public Optional> getEntityTypes() { - return entityTypes; - } - - @JsonProperty("token_type") - public Optional getTokenType() { - return tokenType; - } - - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - @JsonProperty("transformations") - public Optional getTransformations() { - return transformations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyStructuredTextRequest && equalTo((DeidentifyStructuredTextRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - 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) - && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.vaultId, - this.file, - this.configurationId, - this.entityTypes, - this.tokenType, - this.allowRegex, - this.restrictRegex, - this.transformations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static VaultIdStage builder() { - return new Builder(); - } - - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); - - Builder from(DeidentifyStructuredTextRequest other); - } - - public interface FileStage { - /** - * File to de-identify. Files are specified as Base64-encoded data. - */ - _FinalStage file(@NotNull DeidentifyStructuredTextRequestFile file); - } - - public interface _FinalStage { - DeidentifyStructuredTextRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); - - _FinalStage entityTypes(List entityTypes); - - _FinalStage tokenType(Optional tokenType); - - _FinalStage tokenType(TokenTypeWithoutVault tokenType); - - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - _FinalStage transformations(Optional transformations); - - _FinalStage transformations(Transformations transformations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { - private String vaultId; - - private DeidentifyStructuredTextRequestFile file; - - private Optional transformations = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional tokenType = Optional.empty(); - - private Optional> entityTypes = Optional.empty(); - - private Optional configurationId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyStructuredTextRequest other) { - vaultId(other.getVaultId()); - file(other.getFile()); - configurationId(other.getConfigurationId()); - entityTypes(other.getEntityTypes()); - tokenType(other.getTokenType()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - transformations(other.getTransformations()); - return this; - } - - @java.lang.Override - @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - * File to 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 - @JsonSetter("file") - public _FinalStage file(@NotNull DeidentifyStructuredTextRequestFile file) { - this.file = Objects.requireNonNull(file, "file must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage transformations(Transformations transformations) { - this.transformations = Optional.ofNullable(transformations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "transformations", nulls = Nulls.SKIP) - public _FinalStage transformations(Optional transformations) { - this.transformations = transformations; - return this; - } - - @java.lang.Override - public _FinalStage restrictRegex(List restrictRegex) { - this.restrictRegex = Optional.ofNullable(restrictRegex); - return this; - } - - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - @java.lang.Override - public _FinalStage allowRegex(List allowRegex) { - this.allowRegex = Optional.ofNullable(allowRegex); - return this; - } - - @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 tokenType(TokenTypeWithoutVault tokenType) { - this.tokenType = Optional.ofNullable(tokenType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { - this.tokenType = tokenType; - return this; - } - - @java.lang.Override - public _FinalStage entityTypes(List entityTypes) { - this.entityTypes = Optional.ofNullable(entityTypes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { - this.entityTypes = entityTypes; - return this; - } - - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifyStructuredTextRequest build() { - return new DeidentifyStructuredTextRequest( - vaultId, - file, - configurationId, - entityTypes, - tokenType, - allowRegex, - restrictRegex, - transformations, - additionalProperties); - } - } -} 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 deleted file mode 100644 index e65d89e8..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/DeidentifyTextRequest.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * 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.DeidentifyTextRequestFile; -import com.skyflow.generated.rest.types.EntityType; -import com.skyflow.generated.rest.types.TokenTypeWithoutVault; -import com.skyflow.generated.rest.types.Transformations; -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 = DeidentifyTextRequest.Builder.class) -public final class DeidentifyTextRequest { - private final String vaultId; - - private final DeidentifyTextRequestFile file; - - private final Optional configurationId; - - private final Optional> entityTypes; - - private final Optional tokenType; - - private final Optional> allowRegex; - - private final Optional> restrictRegex; - - private final Optional transformations; - - private final Map additionalProperties; - - private DeidentifyTextRequest( - String vaultId, - DeidentifyTextRequestFile file, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, - Optional> allowRegex, - Optional> restrictRegex, - Optional transformations, - Map additionalProperties) { - this.vaultId = vaultId; - this.file = file; - this.configurationId = configurationId; - this.entityTypes = entityTypes; - this.tokenType = tokenType; - this.allowRegex = allowRegex; - this.restrictRegex = restrictRegex; - this.transformations = transformations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to de-identify. Files are specified as Base64-encoded data. - */ - @JsonProperty("file") - public DeidentifyTextRequestFile getFile() { - return file; - } - - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; - } - - @JsonProperty("entity_types") - public Optional> getEntityTypes() { - return entityTypes; - } - - @JsonProperty("token_type") - public Optional getTokenType() { - return tokenType; - } - - @JsonProperty("allow_regex") - public Optional> getAllowRegex() { - return allowRegex; - } - - @JsonProperty("restrict_regex") - public Optional> getRestrictRegex() { - return restrictRegex; - } - - @JsonProperty("transformations") - public Optional getTransformations() { - return transformations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyTextRequest && equalTo((DeidentifyTextRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - 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) - && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.vaultId, - this.file, - this.configurationId, - this.entityTypes, - this.tokenType, - this.allowRegex, - this.restrictRegex, - this.transformations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static VaultIdStage builder() { - return new Builder(); - } - - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); - - Builder from(DeidentifyTextRequest other); - } - - public interface FileStage { - /** - * File to de-identify. Files are specified as Base64-encoded data. - */ - _FinalStage file(@NotNull DeidentifyTextRequestFile file); - } - - public interface _FinalStage { - DeidentifyTextRequest build(); - - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); - - _FinalStage entityTypes(List entityTypes); - - _FinalStage tokenType(Optional tokenType); - - _FinalStage tokenType(TokenTypeWithoutVault tokenType); - - _FinalStage allowRegex(Optional> allowRegex); - - _FinalStage allowRegex(List allowRegex); - - _FinalStage restrictRegex(Optional> restrictRegex); - - _FinalStage restrictRegex(List restrictRegex); - - _FinalStage transformations(Optional transformations); - - _FinalStage transformations(Transformations transformations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, FileStage, _FinalStage { - private String vaultId; - - private DeidentifyTextRequestFile file; - - private Optional transformations = Optional.empty(); - - private Optional> restrictRegex = Optional.empty(); - - private Optional> allowRegex = Optional.empty(); - - private Optional tokenType = Optional.empty(); - - private Optional> entityTypes = Optional.empty(); - - private Optional configurationId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyTextRequest other) { - vaultId(other.getVaultId()); - file(other.getFile()); - configurationId(other.getConfigurationId()); - entityTypes(other.getEntityTypes()); - tokenType(other.getTokenType()); - allowRegex(other.getAllowRegex()); - restrictRegex(other.getRestrictRegex()); - transformations(other.getTransformations()); - return this; - } - - @java.lang.Override - @JsonSetter("vault_id") - public FileStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); - return this; - } - - /** - * File to 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 - @JsonSetter("file") - public _FinalStage file(@NotNull DeidentifyTextRequestFile file) { - this.file = Objects.requireNonNull(file, "file must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage transformations(Transformations transformations) { - this.transformations = Optional.ofNullable(transformations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "transformations", nulls = Nulls.SKIP) - public _FinalStage transformations(Optional transformations) { - this.transformations = transformations; - return this; - } - - @java.lang.Override - public _FinalStage restrictRegex(List restrictRegex) { - this.restrictRegex = Optional.ofNullable(restrictRegex); - return this; - } - - @java.lang.Override - @JsonSetter(value = "restrict_regex", nulls = Nulls.SKIP) - public _FinalStage restrictRegex(Optional> restrictRegex) { - this.restrictRegex = restrictRegex; - return this; - } - - @java.lang.Override - public _FinalStage allowRegex(List allowRegex) { - this.allowRegex = Optional.ofNullable(allowRegex); - return this; - } - - @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 tokenType(TokenTypeWithoutVault tokenType) { - this.tokenType = Optional.ofNullable(tokenType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { - this.tokenType = tokenType; - return this; - } - - @java.lang.Override - public _FinalStage entityTypes(List entityTypes) { - this.entityTypes = Optional.ofNullable(entityTypes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { - this.entityTypes = entityTypes; - return this; - } - - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - - @java.lang.Override - public DeidentifyTextRequest build() { - return new DeidentifyTextRequest( - vaultId, - file, - configurationId, - entityTypes, - tokenType, - allowRegex, - restrictRegex, - transformations, - additionalProperties); - } - } -} 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..6b5a63ad 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 @@ -9,30 +9,28 @@ 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 org.jetbrains.annotations.NotNull; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = GetRunRequest.Builder.class) public final class GetRunRequest { - private final String vaultId; + private final Optional vaultId; private final Map additionalProperties; - private GetRunRequest(String vaultId, Map additionalProperties) { + private GetRunRequest(Optional vaultId, Map additionalProperties) { this.vaultId = vaultId; this.additionalProperties = additionalProperties; } - /** - * @return ID of the vault. - */ @JsonProperty("vault_id") - public String getVaultId() { + public Optional getVaultId() { return vaultId; } @@ -61,50 +59,35 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static Builder builder() { return new Builder(); } - public interface VaultIdStage { - /** - * ID of the vault. - */ - _FinalStage vaultId(@NotNull String vaultId); - - Builder from(GetRunRequest other); - } - - public interface _FinalStage { - GetRunRequest build(); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, _FinalStage { - private String vaultId; + public static final class Builder { + private Optional vaultId = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(GetRunRequest other) { vaultId(other.getVaultId()); 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"); + @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; } - @java.lang.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 deleted file mode 100644 index 4afb0146..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.files.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.skyflow.generated.rest.core.ObjectMappers; -import com.skyflow.generated.rest.resources.files.types.ReidentifyFileRequestFile; -import com.skyflow.generated.rest.resources.files.types.ReidentifyFileRequestFormat; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ReidentifyFileRequest.Builder.class) -public final class ReidentifyFileRequest { - private final String vaultId; - - private final ReidentifyFileRequestFile file; - - private final Optional format; - - private final Map additionalProperties; - - private ReidentifyFileRequest( - String vaultId, - ReidentifyFileRequestFile file, - Optional format, - Map additionalProperties) { - this.vaultId = vaultId; - this.file = file; - this.format = format; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - - /** - * @return File to re-identify. Files are specified as Base64-encoded data or an EFS path. - */ - @JsonProperty("file") - public ReidentifyFileRequestFile getFile() { - return file; - } - - /** - * @return Mapping of preferred data formatting options to entity types. Returned values are dependent on the configuration of the vault storing the data and the permissions of the user or account making the request. - */ - @JsonProperty("format") - public Optional getFormat() { - return format; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ReidentifyFileRequest && equalTo((ReidentifyFileRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ReidentifyFileRequest other) { - return vaultId.equals(other.vaultId) && file.equals(other.file) && format.equals(other.format); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.vaultId, this.file, this.format); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static VaultIdStage builder() { - return new Builder(); - } - - public interface VaultIdStage { - FileStage vaultId(@NotNull String vaultId); - - Builder from(ReidentifyFileRequest other); - } - - public interface FileStage { - /** - * File to re-identify. Files are specified as Base64-encoded data or an EFS path. - */ - _FinalStage file(@NotNull ReidentifyFileRequestFile file); - } - - public interface _FinalStage { - ReidentifyFileRequest build(); - - /** - *

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

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

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

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

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

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

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

- */ - @java.lang.Override - @JsonSetter(value = "format", nulls = Nulls.SKIP) - public _FinalStage format(Optional format) { - this.format = format; - return this; - } - - @java.lang.Override - public ReidentifyFileRequest build() { - return new ReidentifyFileRequest(vaultId, file, format, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequestReidentifyFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequestReidentifyFile.java new file mode 100644 index 00000000..407df7f1 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/requests/ReidentifyFileRequestReidentifyFile.java @@ -0,0 +1,171 @@ +/** + * 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.types.FileDataReidentifyFile; +import com.skyflow.generated.rest.types.Format; +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 = ReidentifyFileRequestReidentifyFile.Builder.class) +public final class ReidentifyFileRequestReidentifyFile { + private final FileDataReidentifyFile file; + + private final String vaultId; + + private final Optional format; + + private final Map additionalProperties; + + private ReidentifyFileRequestReidentifyFile( + FileDataReidentifyFile file, + String vaultId, + Optional format, + Map additionalProperties) { + this.file = file; + this.vaultId = vaultId; + this.format = format; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("file") + public FileDataReidentifyFile getFile() { + return file; + } + + /** + * @return ID of the vault where the entities are stored. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + + @JsonProperty("format") + public Optional getFormat() { + return format; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReidentifyFileRequestReidentifyFile + && equalTo((ReidentifyFileRequestReidentifyFile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReidentifyFileRequestReidentifyFile other) { + return file.equals(other.file) && vaultId.equals(other.vaultId) && format.equals(other.format); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.file, this.vaultId, this.format); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FileStage builder() { + return new Builder(); + } + + public interface FileStage { + VaultIdStage file(@NotNull FileDataReidentifyFile file); + + Builder from(ReidentifyFileRequestReidentifyFile other); + } + + public interface VaultIdStage { + /** + * ID of the vault where the entities are stored. + */ + _FinalStage vaultId(@NotNull String vaultId); + } + + public interface _FinalStage { + ReidentifyFileRequestReidentifyFile build(); + + _FinalStage format(Optional format); + + _FinalStage format(Format format); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FileStage, VaultIdStage, _FinalStage { + private FileDataReidentifyFile file; + + private String vaultId; + + private Optional format = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReidentifyFileRequestReidentifyFile other) { + file(other.getFile()); + vaultId(other.getVaultId()); + format(other.getFormat()); + return this; + } + + @java.lang.Override + @JsonSetter("file") + public VaultIdStage file(@NotNull FileDataReidentifyFile file) { + this.file = Objects.requireNonNull(file, "file must not be null"); + return this; + } + + /** + * 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 + @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 format(Format format) { + this.format = Optional.ofNullable(format); + return this; + } + + @java.lang.Override + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public _FinalStage format(Optional format) { + this.format = format; + return this; + } + + @java.lang.Override + public ReidentifyFileRequestReidentifyFile build() { + return new ReidentifyFileRequestReidentifyFile(file, vaultId, format, 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 deleted file mode 100644 index 6b741b95..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFileDataFormat.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.files.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DeidentifyDocumentRequestFileDataFormat { - DOC("doc"), - - DOCX("docx"), - - PDF("pdf"); - - private final String value; - - DeidentifyDocumentRequestFileDataFormat(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/resources/files/types/DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem.java new file mode 100644 index 00000000..a6a1fa0e --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileAudioRequestDeidentifyAudioEntityTypesItem(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/resources/files/types/DeidentifyAudioRequestOutputTranscription.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription.java similarity index 70% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestOutputTranscription.java rename to src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription.java index bd2d8aac..a19cb5fb 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/DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription.java @@ -5,20 +5,18 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyAudioRequestOutputTranscription { - DIARIZED_TRANSCRIPTION("diarized_transcription"), - - MEDICAL_DIARIZED_TRANSCRIPTION("medical_diarized_transcription"), +public enum DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription { + TRANSCRIPTION("transcription"), MEDICAL_TRANSCRIPTION("medical_transcription"), - PLAINTEXT_TRANSCRIPTION("plaintext_transcription"), + DIARIZED_TRANSCRIPTION("diarized_transcription"), - TRANSCRIPTION("transcription"); + MEDICAL_DIARIZED_TRANSCRIPTION("medical_diarized_transcription"); private final String value; - DeidentifyAudioRequestOutputTranscription(String value) { + DeidentifyFileAudioRequestDeidentifyAudioOutputTranscription(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem.java new file mode 100644 index 00000000..c5eac50a --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileDocumentPdfRequestDeidentifyPdfEntityTypesItem(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/resources/files/types/DeidentifyFileImageRequestDeidentifyImageEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileImageRequestDeidentifyImageEntityTypesItem.java new file mode 100644 index 00000000..c1d3ff51 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileImageRequestDeidentifyImageEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileImageRequestDeidentifyImageEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileImageRequestDeidentifyImageEntityTypesItem(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/resources/files/types/DeidentifyAudioRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileImageRequestDeidentifyImageMaskingMethod.java similarity index 65% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFileDataFormat.java rename to src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileImageRequestDeidentifyImageMaskingMethod.java index 05203b05..f1d50c12 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/DeidentifyFileImageRequestDeidentifyImageMaskingMethod.java @@ -5,14 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyAudioRequestFileDataFormat { - MP_3("mp3"), +public enum DeidentifyFileImageRequestDeidentifyImageMaskingMethod { + BLUR("blur"), - WAV("wav"); + BLACKBOX("blackbox"); private final String value; - DeidentifyAudioRequestFileDataFormat(String value) { + DeidentifyFileImageRequestDeidentifyImageMaskingMethod(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyDocumentEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyDocumentEntityTypesItem.java new file mode 100644 index 00000000..40f92bd0 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyDocumentEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileRequestDeidentifyDocumentEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileRequestDeidentifyDocumentEntityTypesItem(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/resources/files/types/DeidentifyFileRequestDeidentifyPresentationEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyPresentationEntityTypesItem.java new file mode 100644 index 00000000..d54f39eb --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyPresentationEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileRequestDeidentifyPresentationEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileRequestDeidentifyPresentationEntityTypesItem(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/resources/files/types/DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem.java new file mode 100644 index 00000000..91df43b6 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileRequestDeidentifySpreadsheetEntityTypesItem(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/resources/files/types/DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem.java new file mode 100644 index 00000000..e4880d05 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileRequestDeidentifyStructuredTextEntityTypesItem(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/resources/files/types/DeidentifyFileRequestDeidentifyTextEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyTextEntityTypesItem.java new file mode 100644 index 00000000..f883cfc1 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestDeidentifyTextEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileRequestDeidentifyTextEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileRequestDeidentifyTextEntityTypesItem(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/resources/files/types/DeidentifyFileRequestEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestEntityTypesItem.java new file mode 100644 index 00000000..e6d91615 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyFileRequestEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyFileRequestEntityTypesItem(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/resources/files/types/DeidentifyImageRequestMaskingMethod.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestMaskingMethod.java deleted file mode 100644 index 8cf5bf3c..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestMaskingMethod.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.files.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DeidentifyImageRequestMaskingMethod { - BLACKBOX("blackbox"), - - BLUR("blur"); - - private final String value; - - DeidentifyImageRequestMaskingMethod(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/resources/files/types/DeidentifyPresentationRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFile.java deleted file mode 100644 index 1b2e247f..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFile.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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 = DeidentifyPresentationRequestFile.Builder.class) -public final class DeidentifyPresentationRequestFile { - private final String base64; - - private final DeidentifyPresentationRequestFileDataFormat dataFormat; - - private final Map additionalProperties; - - private DeidentifyPresentationRequestFile( - String base64, - DeidentifyPresentationRequestFileDataFormat dataFormat, - Map additionalProperties) { - this.base64 = base64; - this.dataFormat = dataFormat; - this.additionalProperties = additionalProperties; - } - - /** - * @return Base64-encoded data of the file to de-identify. - */ - @JsonProperty("base64") - public String getBase64() { - return base64; - } - - /** - * @return Data format of the file. - */ - @JsonProperty("data_format") - public DeidentifyPresentationRequestFileDataFormat getDataFormat() { - return dataFormat; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyPresentationRequestFile && equalTo((DeidentifyPresentationRequestFile) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeidentifyPresentationRequestFile other) { - return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.base64, this.dataFormat); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Base64Stage builder() { - return new Builder(); - } - - public interface Base64Stage { - /** - * Base64-encoded data of the file to de-identify. - */ - DataFormatStage base64(@NotNull String base64); - - Builder from(DeidentifyPresentationRequestFile other); - } - - public interface DataFormatStage { - /** - * Data format of the file. - */ - _FinalStage dataFormat(@NotNull DeidentifyPresentationRequestFileDataFormat dataFormat); - } - - public interface _FinalStage { - DeidentifyPresentationRequestFile build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { - private String base64; - - private DeidentifyPresentationRequestFileDataFormat dataFormat; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyPresentationRequestFile other) { - base64(other.getBase64()); - dataFormat(other.getDataFormat()); - return this; - } - - /** - * 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 - @JsonSetter("base64") - public DataFormatStage base64(@NotNull String base64) { - this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); - return this; - } - - /** - * Data format of the file.

Data format of the file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifyPresentationRequestFileDataFormat dataFormat) { - this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); - return this; - } - - @java.lang.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 deleted file mode 100644 index e6bcd268..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPresentationRequestFileDataFormat.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.files.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DeidentifyPresentationRequestFileDataFormat { - PPT("ppt"), - - PPTX("pptx"); - - private final String value; - - DeidentifyPresentationRequestFileDataFormat(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/resources/files/types/DeidentifyStructuredTextRequestFile.java b/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFile.java deleted file mode 100644 index d8d5193a..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFile.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * 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 = DeidentifyStructuredTextRequestFile.Builder.class) -public final class DeidentifyStructuredTextRequestFile { - private final String base64; - - private final DeidentifyStructuredTextRequestFileDataFormat dataFormat; - - private final Map additionalProperties; - - private DeidentifyStructuredTextRequestFile( - String base64, - DeidentifyStructuredTextRequestFileDataFormat dataFormat, - Map additionalProperties) { - this.base64 = base64; - this.dataFormat = dataFormat; - this.additionalProperties = additionalProperties; - } - - /** - * @return Base64-encoded data of the file to de-identify. - */ - @JsonProperty("base64") - public String getBase64() { - return base64; - } - - /** - * @return Data format of the file. - */ - @JsonProperty("data_format") - public DeidentifyStructuredTextRequestFileDataFormat getDataFormat() { - return dataFormat; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyStructuredTextRequestFile - && equalTo((DeidentifyStructuredTextRequestFile) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeidentifyStructuredTextRequestFile other) { - return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.base64, this.dataFormat); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Base64Stage builder() { - return new Builder(); - } - - public interface Base64Stage { - /** - * Base64-encoded data of the file to de-identify. - */ - DataFormatStage base64(@NotNull String base64); - - Builder from(DeidentifyStructuredTextRequestFile other); - } - - public interface DataFormatStage { - /** - * Data format of the file. - */ - _FinalStage dataFormat(@NotNull DeidentifyStructuredTextRequestFileDataFormat dataFormat); - } - - public interface _FinalStage { - DeidentifyStructuredTextRequestFile build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { - private String base64; - - private DeidentifyStructuredTextRequestFileDataFormat dataFormat; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyStructuredTextRequestFile other) { - base64(other.getBase64()); - dataFormat(other.getDataFormat()); - return this; - } - - /** - * 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 - @JsonSetter("base64") - public DataFormatStage base64(@NotNull String base64) { - this.base64 = Objects.requireNonNull(base64, "base64 must not be null"); - return this; - } - - /** - * Data format of the file.

Data format of the file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifyStructuredTextRequestFileDataFormat dataFormat) { - this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); - return this; - } - - @java.lang.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 deleted file mode 100644 index 11b30288..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyStructuredTextRequestFileDataFormat.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.files.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DeidentifyStructuredTextRequestFileDataFormat { - JSON("json"), - - XML("xml"); - - private final String value; - - DeidentifyStructuredTextRequestFileDataFormat(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/resources/guardrails/AsyncGuardrailsClient.java b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncGuardrailsClient.java index 1caa38aa..af874ecd 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncGuardrailsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncGuardrailsClient.java @@ -5,8 +5,8 @@ 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 com.skyflow.generated.rest.resources.guardrails.requests.DetectGuardrailsRequest; +import com.skyflow.generated.rest.types.DetectGuardrailsResponse; import java.util.concurrent.CompletableFuture; public class AsyncGuardrailsClient { @@ -29,15 +29,15 @@ public AsyncRawGuardrailsClient withRawResponse() { /** * Preserve safety and compliance with usage policies. */ - public CompletableFuture checkGuardrails(CheckGuardrailsRequest request) { + public CompletableFuture checkGuardrails(DetectGuardrailsRequest request) { return this.rawClient.checkGuardrails(request).thenApply(response -> response.body()); } /** * Preserve safety and compliance with usage policies. */ - public CompletableFuture checkGuardrails( - CheckGuardrailsRequest request, RequestOptions requestOptions) { + public CompletableFuture checkGuardrails( + DetectGuardrailsRequest 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 index fcea229b..0088d7a3 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncRawGuardrailsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/AsyncRawGuardrailsClient.java @@ -14,8 +14,8 @@ 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.resources.guardrails.requests.DetectGuardrailsRequest; +import com.skyflow.generated.rest.types.DetectGuardrailsResponse; import com.skyflow.generated.rest.types.ErrorResponse; import java.io.IOException; import java.util.concurrent.CompletableFuture; @@ -40,16 +40,16 @@ public AsyncRawGuardrailsClient(ClientOptions clientOptions) { /** * Preserve safety and compliance with usage policies. */ - public CompletableFuture> checkGuardrails( - CheckGuardrailsRequest request) { + public CompletableFuture> checkGuardrails( + DetectGuardrailsRequest request) { return checkGuardrails(request, null); } /** * Preserve safety and compliance with usage policies. */ - public CompletableFuture> checkGuardrails( - CheckGuardrailsRequest request, RequestOptions requestOptions) { + public CompletableFuture> checkGuardrails( + DetectGuardrailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/detect/guardrails") @@ -72,7 +72,7 @@ public CompletableFuture> checkGu if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -80,7 +80,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { future.complete(new ApiClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), CheckGuardrailsResponse.class), + responseBody.string(), DetectGuardrailsResponse.class), response)); return; } 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 index fe4ab899..5068196c 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/guardrails/GuardrailsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/GuardrailsClient.java @@ -5,8 +5,8 @@ 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 com.skyflow.generated.rest.resources.guardrails.requests.DetectGuardrailsRequest; +import com.skyflow.generated.rest.types.DetectGuardrailsResponse; public class GuardrailsClient { protected final ClientOptions clientOptions; @@ -28,14 +28,14 @@ public RawGuardrailsClient withRawResponse() { /** * Preserve safety and compliance with usage policies. */ - public CheckGuardrailsResponse checkGuardrails(CheckGuardrailsRequest request) { + public DetectGuardrailsResponse checkGuardrails(DetectGuardrailsRequest request) { return this.rawClient.checkGuardrails(request).body(); } /** * Preserve safety and compliance with usage policies. */ - public CheckGuardrailsResponse checkGuardrails(CheckGuardrailsRequest request, RequestOptions requestOptions) { + public DetectGuardrailsResponse checkGuardrails(DetectGuardrailsRequest 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 index 2667b55a..0223134b 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/guardrails/RawGuardrailsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/RawGuardrailsClient.java @@ -14,8 +14,8 @@ 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.resources.guardrails.requests.DetectGuardrailsRequest; +import com.skyflow.generated.rest.types.DetectGuardrailsResponse; import com.skyflow.generated.rest.types.ErrorResponse; import java.io.IOException; import okhttp3.Headers; @@ -36,15 +36,15 @@ public RawGuardrailsClient(ClientOptions clientOptions) { /** * Preserve safety and compliance with usage policies. */ - public ApiClientHttpResponse checkGuardrails(CheckGuardrailsRequest request) { + public ApiClientHttpResponse checkGuardrails(DetectGuardrailsRequest request) { return checkGuardrails(request, null); } /** * Preserve safety and compliance with usage policies. */ - public ApiClientHttpResponse checkGuardrails( - CheckGuardrailsRequest request, RequestOptions requestOptions) { + public ApiClientHttpResponse checkGuardrails( + DetectGuardrailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/detect/guardrails") @@ -71,7 +71,7 @@ public ApiClientHttpResponse checkGuardrails( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CheckGuardrailsResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DetectGuardrailsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; 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/DetectGuardrailsRequest.java similarity index 75% rename from src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/CheckGuardrailsRequest.java rename to src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/DetectGuardrailsRequest.java index 8fbf90f7..d9485677 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/CheckGuardrailsRequest.java +++ b/src/main/java/com/skyflow/generated/rest/resources/guardrails/requests/DetectGuardrailsRequest.java @@ -20,36 +20,31 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CheckGuardrailsRequest.Builder.class) -public final class CheckGuardrailsRequest { - private final String vaultId; - +@JsonDeserialize(builder = DetectGuardrailsRequest.Builder.class) +public final class DetectGuardrailsRequest { private final String text; private final Optional checkToxicity; private final Optional> denyTopics; + private final String vaultId; + private final Map additionalProperties; - private CheckGuardrailsRequest( - String vaultId, + private DetectGuardrailsRequest( String text, Optional checkToxicity, Optional> denyTopics, + String vaultId, Map additionalProperties) { - this.vaultId = vaultId; this.text = text; this.checkToxicity = checkToxicity; this.denyTopics = denyTopics; + this.vaultId = vaultId; this.additionalProperties = additionalProperties; } - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - /** * @return Text to check against guardrails. */ @@ -59,7 +54,7 @@ public String getText() { } /** - * @return Check for toxicity in the text. + * @return If true, checks for toxicity in the text. */ @JsonProperty("check_toxicity") public Optional getCheckToxicity() { @@ -74,10 +69,18 @@ public Optional> getDenyTopics() { return denyTopics; } + /** + * @return ID of the vault. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CheckGuardrailsRequest && equalTo((CheckGuardrailsRequest) other); + return other instanceof DetectGuardrailsRequest && equalTo((DetectGuardrailsRequest) other); } @JsonAnyGetter @@ -85,16 +88,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(CheckGuardrailsRequest other) { - return vaultId.equals(other.vaultId) - && text.equals(other.text) + private boolean equalTo(DetectGuardrailsRequest other) { + return text.equals(other.text) && checkToxicity.equals(other.checkToxicity) - && denyTopics.equals(other.denyTopics); + && denyTopics.equals(other.denyTopics) + && vaultId.equals(other.vaultId); } @java.lang.Override public int hashCode() { - return Objects.hash(this.vaultId, this.text, this.checkToxicity, this.denyTopics); + return Objects.hash(this.text, this.checkToxicity, this.denyTopics, this.vaultId); } @java.lang.Override @@ -102,28 +105,31 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static TextStage builder() { return new Builder(); } - public interface VaultIdStage { - TextStage vaultId(@NotNull String vaultId); + public interface TextStage { + /** + * Text to check against guardrails. + */ + VaultIdStage text(@NotNull String text); - Builder from(CheckGuardrailsRequest other); + Builder from(DetectGuardrailsRequest other); } - public interface TextStage { + public interface VaultIdStage { /** - * Text to check against guardrails. + * ID of the vault. */ - _FinalStage text(@NotNull String text); + _FinalStage vaultId(@NotNull String vaultId); } public interface _FinalStage { - CheckGuardrailsRequest build(); + DetectGuardrailsRequest build(); /** - *

Check for toxicity in the text.

+ *

If true, checks for toxicity in the text.

*/ _FinalStage checkToxicity(Optional checkToxicity); @@ -138,11 +144,11 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, TextStage, _FinalStage { - private String vaultId; - + public static final class Builder implements TextStage, VaultIdStage, _FinalStage { private String text; + private String vaultId; + private Optional> denyTopics = Optional.empty(); private Optional checkToxicity = Optional.empty(); @@ -153,29 +159,33 @@ public static final class Builder implements VaultIdStage, TextStage, _FinalStag private Builder() {} @java.lang.Override - public Builder from(CheckGuardrailsRequest other) { - vaultId(other.getVaultId()); + public Builder from(DetectGuardrailsRequest other) { text(other.getText()); checkToxicity(other.getCheckToxicity()); denyTopics(other.getDenyTopics()); + vaultId(other.getVaultId()); return this; } + /** + * Text to check against guardrails.

Text to check against guardrails.

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

Text to check against guardrails.

+ * 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("text") - public _FinalStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + @JsonSetter("vault_id") + public _FinalStage vaultId(@NotNull String vaultId) { + this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); return this; } @@ -200,7 +210,7 @@ public _FinalStage denyTopics(Optional> denyTopics) { } /** - *

Check for toxicity in the text.

+ *

If true, checks for toxicity in the text.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -210,7 +220,7 @@ public _FinalStage checkToxicity(Boolean checkToxicity) { } /** - *

Check for toxicity in the text.

+ *

If true, checks for toxicity in the text.

*/ @java.lang.Override @JsonSetter(value = "check_toxicity", nulls = Nulls.SKIP) @@ -220,8 +230,8 @@ public _FinalStage checkToxicity(Optional checkToxicity) { } @java.lang.Override - public CheckGuardrailsRequest build() { - return new CheckGuardrailsRequest(vaultId, text, checkToxicity, denyTopics, additionalProperties); + public DetectGuardrailsRequest build() { + return new DetectGuardrailsRequest(text, checkToxicity, denyTopics, vaultId, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRawRecordsClient.java b/src/main/java/com/skyflow/generated/rest/resources/records/AsyncRawRecordsClient.java index a810f142..d63d1b48 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 @@ -753,8 +753,10 @@ public CompletableFuture> fileServ "file", file.get().getName(), RequestBody.create(file.get(), fileMimeTypeMediaType)); } if (request.getColumnName().isPresent()) { - QueryStringMapper.addFormDataPart( - body, "columnName", request.getColumnName().get(), false); + body.addFormDataPart( + "columnName", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getColumnName().get())); } } catch (Exception e) { throw new RuntimeException(e); @@ -977,21 +979,22 @@ public CompletableFuture> uploadFile .build(); MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM); try { - QueryStringMapper.addFormDataPart(body, "tableName", request.getTableName(), false); - QueryStringMapper.addFormDataPart(body, "columnName", request.getColumnName(), false); + body.addFormDataPart("tableName", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getTableName())); + body.addFormDataPart("columnName", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getColumnName())); String fileMimeType = Files.probeContentType(file.toPath()); MediaType fileMimeTypeMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; body.addFormDataPart("file", file.getName(), RequestBody.create(file, fileMimeTypeMediaType)); if (request.getSkyflowId().isPresent()) { - QueryStringMapper.addFormDataPart( - body, "skyflowID", request.getSkyflowId().get(), false); + body.addFormDataPart( + "skyflowID", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getSkyflowId().get())); } if (request.getReturnFileMetadata().isPresent()) { - QueryStringMapper.addFormDataPart( - body, + body.addFormDataPart( "returnFileMetadata", - request.getReturnFileMetadata().get(), - false); + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getReturnFileMetadata().get())); } } catch (Exception e) { throw new RuntimeException(e); 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 d1b607a0..eb83fa7c 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 @@ -641,8 +641,10 @@ public ApiClientHttpResponse fileServiceUploadFile( "file", file.get().getName(), RequestBody.create(file.get(), fileMimeTypeMediaType)); } if (request.getColumnName().isPresent()) { - QueryStringMapper.addFormDataPart( - body, "columnName", request.getColumnName().get(), false); + body.addFormDataPart( + "columnName", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getColumnName().get())); } } catch (Exception e) { throw new RuntimeException(e); @@ -821,21 +823,22 @@ public ApiClientHttpResponse uploadFileV2( .build(); MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM); try { - QueryStringMapper.addFormDataPart(body, "tableName", request.getTableName(), false); - QueryStringMapper.addFormDataPart(body, "columnName", request.getColumnName(), false); + body.addFormDataPart("tableName", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getTableName())); + body.addFormDataPart("columnName", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getColumnName())); String fileMimeType = Files.probeContentType(file.toPath()); MediaType fileMimeTypeMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; body.addFormDataPart("file", file.getName(), RequestBody.create(file, fileMimeTypeMediaType)); if (request.getSkyflowId().isPresent()) { - QueryStringMapper.addFormDataPart( - body, "skyflowID", request.getSkyflowId().get(), false); + body.addFormDataPart( + "skyflowID", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getSkyflowId().get())); } if (request.getReturnFileMetadata().isPresent()) { - QueryStringMapper.addFormDataPart( - body, + body.addFormDataPart( "returnFileMetadata", - request.getReturnFileMetadata().get(), - false); + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getReturnFileMetadata().get())); } } catch (Exception e) { throw new RuntimeException(e); diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncRawStringsClient.java b/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncRawStringsClient.java index 0dc804b2..96428263 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncRawStringsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncRawStringsClient.java @@ -18,7 +18,7 @@ import com.skyflow.generated.rest.resources.strings.requests.ReidentifyStringRequest; import com.skyflow.generated.rest.types.DeidentifyStringResponse; import com.skyflow.generated.rest.types.ErrorResponse; -import com.skyflow.generated.rest.types.ReidentifyStringResponse; +import com.skyflow.generated.rest.types.IdentifyResponse; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -130,7 +130,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Re-identifies tokens in a string. */ - public CompletableFuture> reidentifyString( + public CompletableFuture> reidentifyString() { + return reidentifyString(ReidentifyStringRequest.builder().build()); + } + + /** + * Re-identifies tokens in a string. + */ + public CompletableFuture> reidentifyString( ReidentifyStringRequest request) { return reidentifyString(request, null); } @@ -138,7 +145,7 @@ public CompletableFuture> reiden /** * Re-identifies tokens in a string. */ - public CompletableFuture> reidentifyString( + public CompletableFuture> reidentifyString( ReidentifyStringRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -162,15 +169,14 @@ public CompletableFuture> reiden if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + 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(), ReidentifyStringResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), IdentifyResponse.class), response)); return; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncStringsClient.java b/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncStringsClient.java index 86e5cd0d..046bb289 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncStringsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/AsyncStringsClient.java @@ -8,7 +8,7 @@ import com.skyflow.generated.rest.resources.strings.requests.DeidentifyStringRequest; import com.skyflow.generated.rest.resources.strings.requests.ReidentifyStringRequest; import com.skyflow.generated.rest.types.DeidentifyStringResponse; -import com.skyflow.generated.rest.types.ReidentifyStringResponse; +import com.skyflow.generated.rest.types.IdentifyResponse; import java.util.concurrent.CompletableFuture; public class AsyncStringsClient { @@ -46,14 +46,21 @@ public CompletableFuture deidentifyString( /** * Re-identifies tokens in a string. */ - public CompletableFuture reidentifyString(ReidentifyStringRequest request) { + public CompletableFuture reidentifyString() { + return this.rawClient.reidentifyString().thenApply(response -> response.body()); + } + + /** + * Re-identifies tokens in a string. + */ + public CompletableFuture reidentifyString(ReidentifyStringRequest request) { return this.rawClient.reidentifyString(request).thenApply(response -> response.body()); } /** * Re-identifies tokens in a string. */ - public CompletableFuture reidentifyString( + public CompletableFuture reidentifyString( ReidentifyStringRequest request, RequestOptions requestOptions) { return this.rawClient.reidentifyString(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/RawStringsClient.java b/src/main/java/com/skyflow/generated/rest/resources/strings/RawStringsClient.java index 0e1fbad0..a5e16949 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/RawStringsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/RawStringsClient.java @@ -18,7 +18,7 @@ import com.skyflow.generated.rest.resources.strings.requests.ReidentifyStringRequest; import com.skyflow.generated.rest.types.DeidentifyStringResponse; import com.skyflow.generated.rest.types.ErrorResponse; -import com.skyflow.generated.rest.types.ReidentifyStringResponse; +import com.skyflow.generated.rest.types.IdentifyResponse; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -105,14 +105,21 @@ public ApiClientHttpResponse deidentifyString( /** * Re-identifies tokens in a string. */ - public ApiClientHttpResponse reidentifyString(ReidentifyStringRequest request) { + public ApiClientHttpResponse reidentifyString() { + return reidentifyString(ReidentifyStringRequest.builder().build()); + } + + /** + * Re-identifies tokens in a string. + */ + public ApiClientHttpResponse reidentifyString(ReidentifyStringRequest request) { return reidentifyString(request, null); } /** * Re-identifies tokens in a string. */ - public ApiClientHttpResponse reidentifyString( + public ApiClientHttpResponse reidentifyString( ReidentifyStringRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -140,8 +147,7 @@ public ApiClientHttpResponse reidentifyString( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new ApiClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReidentifyStringResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), IdentifyResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/StringsClient.java b/src/main/java/com/skyflow/generated/rest/resources/strings/StringsClient.java index 153efe07..5dfca68b 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/StringsClient.java +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/StringsClient.java @@ -8,7 +8,7 @@ import com.skyflow.generated.rest.resources.strings.requests.DeidentifyStringRequest; import com.skyflow.generated.rest.resources.strings.requests.ReidentifyStringRequest; import com.skyflow.generated.rest.types.DeidentifyStringResponse; -import com.skyflow.generated.rest.types.ReidentifyStringResponse; +import com.skyflow.generated.rest.types.IdentifyResponse; public class StringsClient { protected final ClientOptions clientOptions; @@ -44,14 +44,21 @@ public DeidentifyStringResponse deidentifyString(DeidentifyStringRequest request /** * Re-identifies tokens in a string. */ - public ReidentifyStringResponse reidentifyString(ReidentifyStringRequest request) { + public IdentifyResponse reidentifyString() { + return this.rawClient.reidentifyString().body(); + } + + /** + * Re-identifies tokens in a string. + */ + public IdentifyResponse reidentifyString(ReidentifyStringRequest request) { return this.rawClient.reidentifyString(request).body(); } /** * Re-identifies tokens in a string. */ - public ReidentifyStringResponse reidentifyString(ReidentifyStringRequest request, RequestOptions requestOptions) { + public IdentifyResponse reidentifyString(ReidentifyStringRequest request, RequestOptions requestOptions) { return this.rawClient.reidentifyString(request, requestOptions).body(); } } 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 18b6cd98..522142aa 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 @@ -12,8 +12,8 @@ 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 com.skyflow.generated.rest.types.TokenType; +import com.skyflow.generated.rest.resources.strings.types.DeidentifyStringRequestEntityTypesItem; +import com.skyflow.generated.rest.types.TokenTypeMapping; import com.skyflow.generated.rest.types.Transformations; import java.util.HashMap; import java.util.List; @@ -25,15 +25,13 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DeidentifyStringRequest.Builder.class) public final class DeidentifyStringRequest { - private final String vaultId; - private final String text; - private final Optional configurationId; + private final String vaultId; - private final Optional> entityTypes; + private final Optional> entityTypes; - private final Optional tokenType; + private final Optional tokenType; private final Optional> allowRegex; @@ -41,62 +39,71 @@ public final class DeidentifyStringRequest { private final Optional transformations; + private final Optional configurationId; + private final Map additionalProperties; private DeidentifyStringRequest( - String vaultId, String text, - Optional configurationId, - Optional> entityTypes, - Optional tokenType, + String vaultId, + Optional> entityTypes, + Optional tokenType, Optional> allowRegex, Optional> restrictRegex, Optional transformations, + Optional configurationId, Map additionalProperties) { - this.vaultId = vaultId; this.text = text; - this.configurationId = configurationId; + this.vaultId = vaultId; this.entityTypes = entityTypes; this.tokenType = tokenType; this.allowRegex = allowRegex; this.restrictRegex = restrictRegex; this.transformations = transformations; + this.configurationId = configurationId; this.additionalProperties = additionalProperties; } - @JsonProperty("vault_id") - public String getVaultId() { - return vaultId; - } - /** - * @return String to de-identify. + * @return Text to de-identify. */ @JsonProperty("text") public String getText() { return text; } - @JsonProperty("configuration_id") - public Optional getConfigurationId() { - return configurationId; + /** + * @return ID of a vault that you have Detect Invoker or Vault Owner permissions for. + */ + @JsonProperty("vault_id") + public String getVaultId() { + return vaultId; } + /** + * @return Entities to detect and de-identify. + */ @JsonProperty("entity_types") - public Optional> getEntityTypes() { + public Optional> getEntityTypes() { return entityTypes; } @JsonProperty("token_type") - public Optional getTokenType() { + public Optional getTokenType() { return tokenType; } + /** + * @return Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. + */ @JsonProperty("allow_regex") public Optional> getAllowRegex() { return allowRegex; } + /** + * @return Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings. + */ @JsonProperty("restrict_regex") public Optional> getRestrictRegex() { return restrictRegex; @@ -107,6 +114,14 @@ public Optional getTransformations() { return transformations; } + /** + * @return ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file. + */ + @JsonProperty("configuration_id") + public Optional getConfigurationId() { + return configurationId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -119,27 +134,27 @@ public Map getAdditionalProperties() { } private boolean equalTo(DeidentifyStringRequest other) { - return vaultId.equals(other.vaultId) - && text.equals(other.text) - && configurationId.equals(other.configurationId) + return text.equals(other.text) + && vaultId.equals(other.vaultId) && entityTypes.equals(other.entityTypes) && tokenType.equals(other.tokenType) && allowRegex.equals(other.allowRegex) && restrictRegex.equals(other.restrictRegex) - && transformations.equals(other.transformations); + && transformations.equals(other.transformations) + && configurationId.equals(other.configurationId); } @java.lang.Override public int hashCode() { return Objects.hash( - this.vaultId, this.text, - this.configurationId, + this.vaultId, this.entityTypes, this.tokenType, this.allowRegex, this.restrictRegex, - this.transformations); + this.transformations, + this.configurationId); } @java.lang.Override @@ -147,42 +162,50 @@ public String toString() { return ObjectMappers.stringify(this); } - public static VaultIdStage builder() { + public static TextStage builder() { return new Builder(); } - public interface VaultIdStage { - TextStage vaultId(@NotNull String vaultId); + public interface TextStage { + /** + * Text to de-identify. + */ + VaultIdStage text(@NotNull String text); Builder from(DeidentifyStringRequest other); } - public interface TextStage { + public interface VaultIdStage { /** - * String to de-identify. + * ID of a vault that you have Detect Invoker or Vault Owner permissions for. */ - _FinalStage text(@NotNull String text); + _FinalStage vaultId(@NotNull String vaultId); } public interface _FinalStage { DeidentifyStringRequest build(); - _FinalStage configurationId(Optional configurationId); - - _FinalStage configurationId(String configurationId); - - _FinalStage entityTypes(Optional> entityTypes); + /** + *

Entities to detect and de-identify.

+ */ + _FinalStage entityTypes(Optional> entityTypes); - _FinalStage entityTypes(List entityTypes); + _FinalStage entityTypes(List entityTypes); - _FinalStage tokenType(Optional tokenType); + _FinalStage tokenType(Optional tokenType); - _FinalStage tokenType(TokenType tokenType); + _FinalStage tokenType(TokenTypeMapping tokenType); + /** + *

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

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

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ */ _FinalStage restrictRegex(Optional> restrictRegex); _FinalStage restrictRegex(List restrictRegex); @@ -190,13 +213,22 @@ public interface _FinalStage { _FinalStage transformations(Optional transformations); _FinalStage transformations(Transformations transformations); + + /** + *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + _FinalStage configurationId(Optional configurationId); + + _FinalStage configurationId(String configurationId); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements VaultIdStage, TextStage, _FinalStage { + public static final class Builder implements TextStage, VaultIdStage, _FinalStage { + private String text; + private String vaultId; - private String text; + private Optional configurationId = Optional.empty(); private Optional transformations = Optional.empty(); @@ -204,11 +236,9 @@ public static final class Builder implements VaultIdStage, TextStage, _FinalStag private Optional> allowRegex = Optional.empty(); - private Optional tokenType = Optional.empty(); + private Optional tokenType = Optional.empty(); - private Optional> entityTypes = Optional.empty(); - - private Optional configurationId = Optional.empty(); + private Optional> entityTypes = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -217,32 +247,56 @@ private Builder() {} @java.lang.Override public Builder from(DeidentifyStringRequest other) { - vaultId(other.getVaultId()); text(other.getText()); - configurationId(other.getConfigurationId()); + vaultId(other.getVaultId()); entityTypes(other.getEntityTypes()); tokenType(other.getTokenType()); allowRegex(other.getAllowRegex()); restrictRegex(other.getRestrictRegex()); transformations(other.getTransformations()); + configurationId(other.getConfigurationId()); return this; } + /** + * Text to de-identify.

Text to de-identify.

+ * @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 a vault that you have Detect Invoker or Vault Owner permissions for.

ID of a vault that you have Detect Invoker or Vault Owner permissions for.

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

String to de-identify.

+ *

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

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

ID of the Detect configuration to use for de-identification. Can't be specified with fields other than vault_id, text, and file.

+ */ + @java.lang.Override + @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) + public _FinalStage configurationId(Optional configurationId) { + this.configurationId = configurationId; return this; } @@ -259,12 +313,19 @@ public _FinalStage transformations(Optional transformations) { return this; } + /** + *

Regular expressions to replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

+ * @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 replace with '[RESTRICTED]'. Expressions must match the entirety of a detected entity, not just a substring, for the entity to be restricted. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext. If a string is detected as an entity and a restrict_regex pattern matches the entire detected entity, the entity is replaced with '[RESTRICTED]'. If a string is detected as an entity but a restrict_regex pattern only matches a substring of it, the restrict_regex pattern is ignored, and the entity is processed according to the specified tokenization and transformation settings.

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

Regular expressions to display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ * @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 display in plaintext. Entities appear in plaintext if an expression matches either the entirety of a detected entity or a substring of it. Expressions don't match across entity boundaries. If a string or entity matches both allow_regex and restrict_regex, the entity is displayed in plaintext.

+ */ @java.lang.Override @JsonSetter(value = "allow_regex", nulls = Nulls.SKIP) public _FinalStage allowRegex(Optional> allowRegex) { @@ -286,55 +354,49 @@ public _FinalStage allowRegex(Optional> allowRegex) { } @java.lang.Override - public _FinalStage tokenType(TokenType tokenType) { + public _FinalStage tokenType(TokenTypeMapping tokenType) { this.tokenType = Optional.ofNullable(tokenType); return this; } @java.lang.Override @JsonSetter(value = "token_type", nulls = Nulls.SKIP) - public _FinalStage tokenType(Optional tokenType) { + public _FinalStage tokenType(Optional tokenType) { this.tokenType = tokenType; return this; } + /** + *

Entities to detect and de-identify.

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

Entities to detect and de-identify.

+ */ @java.lang.Override @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public _FinalStage entityTypes(Optional> entityTypes) { + public _FinalStage entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - @java.lang.Override - public _FinalStage configurationId(String configurationId) { - this.configurationId = Optional.ofNullable(configurationId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configuration_id", nulls = Nulls.SKIP) - public _FinalStage configurationId(Optional configurationId) { - this.configurationId = configurationId; - return this; - } - @java.lang.Override public DeidentifyStringRequest build() { return new DeidentifyStringRequest( - vaultId, text, - configurationId, + vaultId, entityTypes, tokenType, allowRegex, restrictRegex, transformations, + configurationId, additionalProperties); } } 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..d07aa731 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 @@ -12,28 +12,27 @@ 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.strings.types.ReidentifyStringRequestFormat; +import com.skyflow.generated.rest.types.Format; 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 = ReidentifyStringRequest.Builder.class) public final class ReidentifyStringRequest { - private final String text; + private final Optional text; - private final String vaultId; + private final Optional vaultId; - private final Optional format; + private final Optional format; private final Map additionalProperties; private ReidentifyStringRequest( - String text, - String vaultId, - Optional format, + Optional text, + Optional vaultId, + Optional format, Map additionalProperties) { this.text = text; this.vaultId = vaultId; @@ -42,10 +41,10 @@ private ReidentifyStringRequest( } /** - * @return String to re-identify. + * @return Text to reidentify. */ @JsonProperty("text") - public String getText() { + public Optional getText() { return text; } @@ -53,15 +52,12 @@ public String getText() { * @return ID of the vault where the entities are stored. */ @JsonProperty("vault_id") - public String getVaultId() { + public Optional getVaultId() { return vaultId; } - /** - * @return 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. - */ @JsonProperty("format") - public Optional getFormat() { + public Optional getFormat() { return format; } @@ -90,51 +86,23 @@ public String toString() { return ObjectMappers.stringify(this); } - public static TextStage builder() { + public static Builder builder() { return new Builder(); } - public interface TextStage { - /** - * String to re-identify. - */ - VaultIdStage text(@NotNull String text); - - Builder from(ReidentifyStringRequest other); - } - - public interface VaultIdStage { - /** - * ID of the vault where the entities are stored. - */ - _FinalStage vaultId(@NotNull String vaultId); - } - - public interface _FinalStage { - ReidentifyStringRequest build(); - - /** - *

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.

- */ - _FinalStage format(Optional format); - - _FinalStage format(ReidentifyStringRequestFormat format); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TextStage, VaultIdStage, _FinalStage { - private String text; + public static final class Builder { + private Optional text = Optional.empty(); - private String vaultId; + private Optional vaultId = Optional.empty(); - private Optional format = Optional.empty(); + private Optional format = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ReidentifyStringRequest other) { text(other.getText()); vaultId(other.getVaultId()); @@ -143,48 +111,44 @@ 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. + *

Text to reidentify.

*/ - @java.lang.Override - @JsonSetter("text") - public VaultIdStage text(@NotNull String text) { - this.text = Objects.requireNonNull(text, "text must not be null"); + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public Builder text(Optional text) { + this.text = text; return this; } - /** - * 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 - @JsonSetter("vault_id") - public _FinalStage vaultId(@NotNull String vaultId) { - this.vaultId = Objects.requireNonNull(vaultId, "vaultId must not be null"); + public Builder text(String text) { + this.text = Optional.ofNullable(text); return this; } /** - *

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. + *

ID of the vault where the entities are stored.

*/ - @java.lang.Override - public _FinalStage format(ReidentifyStringRequestFormat format) { - this.format = Optional.ofNullable(format); + @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; } - /** - *

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 @JsonSetter(value = "format", nulls = Nulls.SKIP) - public _FinalStage format(Optional format) { + public Builder format(Optional format) { this.format = format; return this; } - @java.lang.Override + public Builder format(Format format) { + this.format = Optional.ofNullable(format); + return this; + } + public ReidentifyStringRequest build() { return new ReidentifyStringRequest(text, vaultId, format, additionalProperties); } diff --git a/src/main/java/com/skyflow/generated/rest/resources/strings/types/DeidentifyStringRequestEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/resources/strings/types/DeidentifyStringRequestEntityTypesItem.java new file mode 100644 index 00000000..0965b178 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/resources/strings/types/DeidentifyStringRequestEntityTypesItem.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.resources.strings.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeidentifyStringRequestEntityTypesItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + DeidentifyStringRequestEntityTypesItem(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/resources/strings/types/ReidentifyStringRequestFormat.java b/src/main/java/com/skyflow/generated/rest/resources/strings/types/ReidentifyStringRequestFormat.java deleted file mode 100644 index 68c5209f..00000000 --- a/src/main/java/com/skyflow/generated/rest/resources/strings/types/ReidentifyStringRequestFormat.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.skyflow.generated.rest.resources.strings.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 = ReidentifyStringRequestFormat.Builder.class) -public final class ReidentifyStringRequestFormat { - private final Optional> redacted; - - private final Optional> masked; - - private final Optional> plaintext; - - private final Map additionalProperties; - - private ReidentifyStringRequestFormat( - Optional> redacted, - Optional> masked, - Optional> plaintext, - Map additionalProperties) { - this.redacted = redacted; - this.masked = masked; - this.plaintext = plaintext; - this.additionalProperties = additionalProperties; - } - - /** - * @return Entity types to fully redact. - */ - @JsonProperty("redacted") - public Optional> getRedacted() { - return redacted; - } - - /** - * @return Entity types to mask. - */ - @JsonProperty("masked") - public Optional> getMasked() { - return masked; - } - - /** - * @return Entity types to return in plaintext. - */ - @JsonProperty("plaintext") - public Optional> getPlaintext() { - return plaintext; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ReidentifyStringRequestFormat && equalTo((ReidentifyStringRequestFormat) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ReidentifyStringRequestFormat other) { - return redacted.equals(other.redacted) && masked.equals(other.masked) && plaintext.equals(other.plaintext); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.redacted, this.masked, this.plaintext); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> redacted = Optional.empty(); - - private Optional> masked = Optional.empty(); - - private Optional> plaintext = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ReidentifyStringRequestFormat 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 ReidentifyStringRequestFormat build() { - return new ReidentifyStringRequestFormat(redacted, masked, plaintext, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponse.java b/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponse.java deleted file mode 100644 index 324cd1e6..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponse.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 = CheckGuardrailsResponse.Builder.class) -public final class CheckGuardrailsResponse { - private final Optional text; - - private final Optional toxicity; - - private final Optional deniedTopics; - - private final Optional validation; - - private final Map additionalProperties; - - private CheckGuardrailsResponse( - Optional text, - Optional toxicity, - Optional deniedTopics, - Optional validation, - Map additionalProperties) { - this.text = text; - this.toxicity = toxicity; - this.deniedTopics = deniedTopics; - this.validation = validation; - this.additionalProperties = additionalProperties; - } - - /** - * @return Text that was checked against guardrails. - */ - @JsonProperty("text") - public Optional getText() { - return text; - } - - /** - * @return Whether the text is toxic. - */ - @JsonProperty("toxicity") - public Optional getToxicity() { - return toxicity; - } - - /** - * @return Whether any denied topics were found. - */ - @JsonProperty("denied_topics") - public Optional getDeniedTopics() { - return deniedTopics; - } - - /** - * @return Validation result. - */ - @JsonProperty("validation") - public Optional getValidation() { - return validation; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CheckGuardrailsResponse && equalTo((CheckGuardrailsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CheckGuardrailsResponse other) { - return text.equals(other.text) - && toxicity.equals(other.toxicity) - && deniedTopics.equals(other.deniedTopics) - && validation.equals(other.validation); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.text, this.toxicity, this.deniedTopics, this.validation); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional text = Optional.empty(); - - private Optional toxicity = Optional.empty(); - - private Optional deniedTopics = Optional.empty(); - - private Optional validation = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CheckGuardrailsResponse other) { - text(other.getText()); - toxicity(other.getToxicity()); - deniedTopics(other.getDeniedTopics()); - validation(other.getValidation()); - return this; - } - - /** - *

Text that was checked against guardrails.

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

Whether the text is toxic.

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

Whether any denied topics were found.

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

Validation result.

- */ - @JsonSetter(value = "validation", nulls = Nulls.SKIP) - public Builder validation(Optional validation) { - this.validation = validation; - return this; - } - - public Builder validation(CheckGuardrailsResponseValidation validation) { - this.validation = Optional.ofNullable(validation); - return this; - } - - public CheckGuardrailsResponse build() { - return new CheckGuardrailsResponse(text, toxicity, deniedTopics, validation, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutput.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutput.java new file mode 100644 index 00000000..ad4a3550 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutput.java @@ -0,0 +1,165 @@ +/** + * 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 = DeidentifiedFileOutput.Builder.class) +public final class DeidentifiedFileOutput { + private final Optional processedFile; + + private final Optional processedFileType; + + private final Optional processedFileExtension; + + private final Map additionalProperties; + + private DeidentifiedFileOutput( + Optional processedFile, + Optional processedFileType, + Optional processedFileExtension, + Map additionalProperties) { + this.processedFile = processedFile; + this.processedFileType = processedFileType; + this.processedFileExtension = processedFileExtension; + this.additionalProperties = additionalProperties; + } + + /** + * @return File content in Base64 format. + */ + @JsonProperty("processedFile") + public Optional getProcessedFile() { + return processedFile; + } + + /** + * @return Type of the processed file. + */ + @JsonProperty("processedFileType") + public Optional getProcessedFileType() { + return processedFileType; + } + + /** + * @return Extension of the processed file. + */ + @JsonProperty("processedFileExtension") + public Optional getProcessedFileExtension() { + return processedFileExtension; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeidentifiedFileOutput && equalTo((DeidentifiedFileOutput) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeidentifiedFileOutput other) { + return processedFile.equals(other.processedFile) + && processedFileType.equals(other.processedFileType) + && processedFileExtension.equals(other.processedFileExtension); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.processedFile, this.processedFileType, this.processedFileExtension); + } + + @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 processedFile = Optional.empty(); + + private Optional processedFileType = Optional.empty(); + + private Optional processedFileExtension = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeidentifiedFileOutput other) { + processedFile(other.getProcessedFile()); + processedFileType(other.getProcessedFileType()); + processedFileExtension(other.getProcessedFileExtension()); + return this; + } + + /** + *

File content in Base64 format.

+ */ + @JsonSetter(value = "processedFile", 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; + } + + /** + *

Type of the processed file.

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

Extension of the processed file.

+ */ + @JsonSetter(value = "processedFileExtension", nulls = Nulls.SKIP) + public Builder processedFileExtension( + Optional processedFileExtension) { + this.processedFileExtension = processedFileExtension; + return this; + } + + public Builder processedFileExtension(DeidentifiedFileOutputProcessedFileExtension processedFileExtension) { + this.processedFileExtension = Optional.ofNullable(processedFileExtension); + return this; + } + + public DeidentifiedFileOutput build() { + return new DeidentifiedFileOutput( + processedFile, processedFileType, processedFileExtension, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutputProcessedFileExtension.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutputProcessedFileExtension.java new file mode 100644 index 00000000..f7993608 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutputProcessedFileExtension.java @@ -0,0 +1,60 @@ +/** + * 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 DeidentifiedFileOutputProcessedFileExtension { + MP_3("mp3"), + + WAV("wav"), + + PDF("pdf"), + + TXT("txt"), + + CSV("csv"), + + JSON("json"), + + JPG("jpg"), + + JPEG("jpeg"), + + TIF("tif"), + + TIFF("tiff"), + + PNG("png"), + + BMP("bmp"), + + XLS("xls"), + + XLSX("xlsx"), + + DOC("doc"), + + DOCX("docx"), + + PPT("ppt"), + + PPTX("pptx"), + + XML("xml"), + + DCM("dcm"); + + private final String value; + + DeidentifiedFileOutputProcessedFileExtension(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/DeidentifyFileOutputProcessedFileType.java b/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutputProcessedFileType.java similarity index 53% rename from src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutputProcessedFileType.java rename to src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutputProcessedFileType.java index c560dc9e..ba2d3d19 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutputProcessedFileType.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifiedFileOutputProcessedFileType.java @@ -5,30 +5,24 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyFileOutputProcessedFileType { - ENTITIES("entities"), - - PLAINTEXT_TRANSCRIPTION("plaintext_transcription"), - +public enum DeidentifiedFileOutputProcessedFileType { REDACTED_AUDIO("redacted_audio"), - REDACTED_DIARIZED_TRANSCRIPTION("redacted_diarized_transcription"), - - REDACTED_FILE("redacted_file"), - REDACTED_IMAGE("redacted_image"), - REDACTED_MEDICAL_DIARIZED_TRANSCRIPTION("redacted_medical_diarized_transcription"), + REDACTED_TRANSCRIPTION("redacted_transcription"), - REDACTED_MEDICAL_TRANSCRIPTION("redacted_medical_transcription"), + REDACTED_FILE("redacted_file"), REDACTED_TEXT("redacted_text"), - REDACTED_TRANSCRIPTION("redacted_transcription"); + ENTITIES("entities"), + + REDACTED_TRANSCRIPTION_DIARIZE_JSON("redacted_transcription_diarize_json"); private final String value; - DeidentifyFileOutputProcessedFileType(String value) { + DeidentifiedFileOutputProcessedFileType(String value) { this.value = 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..5f01f61e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileResponse.java @@ -9,30 +9,31 @@ 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 org.jetbrains.annotations.NotNull; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DeidentifyFileResponse.Builder.class) public final class DeidentifyFileResponse { - private final String runId; + private final Optional runId; private final Map additionalProperties; - private DeidentifyFileResponse(String runId, Map additionalProperties) { + private DeidentifyFileResponse(Optional runId, Map additionalProperties) { this.runId = runId; this.additionalProperties = additionalProperties; } /** - * @return Status URL for the detect run. + * @return Status URL for the Detect run. */ @JsonProperty("run_id") - public String getRunId() { + public Optional getRunId() { return runId; } @@ -61,50 +62,38 @@ public String toString() { return ObjectMappers.stringify(this); } - public static RunIdStage builder() { + public static Builder builder() { return new Builder(); } - public interface RunIdStage { - /** - * Status URL for the detect run. - */ - _FinalStage runId(@NotNull String runId); - - Builder from(DeidentifyFileResponse other); - } - - public interface _FinalStage { - DeidentifyFileResponse build(); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RunIdStage, _FinalStage { - private String runId; + public static final class Builder { + private Optional runId = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(DeidentifyFileResponse other) { runId(other.getRunId()); return this; } /** - * 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. + *

Status URL for the Detect run.

*/ - @java.lang.Override - @JsonSetter("run_id") - public _FinalStage runId(@NotNull String runId) { - this.runId = Objects.requireNonNull(runId, "runId must not be null"); + @JsonSetter(value = "run_id", nulls = Nulls.SKIP) + public Builder runId(Optional runId) { + this.runId = runId; + return this; + } + + public Builder runId(String runId) { + this.runId = Optional.ofNullable(runId); return this; } - @java.lang.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 deleted file mode 100644 index 9beef0a2..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponse.java +++ /dev/null @@ -1,521 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyStatusResponse.Builder.class) -public final class DeidentifyStatusResponse { - private final DeidentifyStatusResponseStatus status; - - private final List output; - - private final DeidentifyStatusResponseOutputType outputType; - - private final String message; - - private final Optional wordCount; - - private final Optional characterCount; - - private final Optional size; - - private final Optional duration; - - private final Optional pages; - - private final Optional slides; - - private final Map additionalProperties; - - private DeidentifyStatusResponse( - DeidentifyStatusResponseStatus status, - List output, - DeidentifyStatusResponseOutputType outputType, - String message, - Optional wordCount, - Optional characterCount, - Optional size, - Optional duration, - Optional pages, - Optional slides, - Map additionalProperties) { - this.status = status; - this.output = output; - this.outputType = outputType; - this.message = message; - this.wordCount = wordCount; - this.characterCount = characterCount; - this.size = size; - this.duration = duration; - this.pages = pages; - this.slides = slides; - this.additionalProperties = additionalProperties; - } - - /** - * @return Status of the detect run. - */ - @JsonProperty("status") - public DeidentifyStatusResponseStatus getStatus() { - return status; - } - - /** - * @return How the input file was specified. - */ - @JsonProperty("output") - public List getOutput() { - return output; - } - - /** - * @return How the output file is specified. - */ - @JsonProperty("output_type") - public DeidentifyStatusResponseOutputType getOutputType() { - return outputType; - } - - /** - * @return Status details about the detect run. - */ - @JsonProperty("message") - public String getMessage() { - return message; - } - - /** - * @return Number of words in the processed text. - */ - @JsonProperty("word_count") - public Optional getWordCount() { - return wordCount; - } - - /** - * @return Number of characters in the processed text. - */ - @JsonProperty("character_count") - public Optional getCharacterCount() { - return characterCount; - } - - /** - * @return Size of the processed text in kilobytes (KB). - */ - @JsonProperty("size") - public Optional getSize() { - return size; - } - - /** - * @return Duration of the processed audio in seconds. - */ - @JsonProperty("duration") - public Optional getDuration() { - return duration; - } - - /** - * @return Number of pages in the processed PDF. - */ - @JsonProperty("pages") - public Optional getPages() { - return pages; - } - - /** - * @return Number of slides in the processed presentation. - */ - @JsonProperty("slides") - public Optional getSlides() { - return slides; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeidentifyStatusResponse && equalTo((DeidentifyStatusResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeidentifyStatusResponse other) { - return status.equals(other.status) - && output.equals(other.output) - && outputType.equals(other.outputType) - && message.equals(other.message) - && wordCount.equals(other.wordCount) - && characterCount.equals(other.characterCount) - && size.equals(other.size) - && duration.equals(other.duration) - && pages.equals(other.pages) - && slides.equals(other.slides); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.status, - this.output, - this.outputType, - this.message, - this.wordCount, - this.characterCount, - this.size, - this.duration, - this.pages, - this.slides); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static StatusStage builder() { - return new Builder(); - } - - public interface StatusStage { - /** - * Status of the detect run. - */ - OutputTypeStage status(@NotNull DeidentifyStatusResponseStatus status); - - Builder from(DeidentifyStatusResponse other); - } - - public interface OutputTypeStage { - /** - * How the output file is specified. - */ - MessageStage outputType(@NotNull DeidentifyStatusResponseOutputType outputType); - } - - public interface MessageStage { - /** - * Status details about the detect run. - */ - _FinalStage message(@NotNull String message); - } - - public interface _FinalStage { - DeidentifyStatusResponse build(); - - /** - *

How the input file was specified.

- */ - _FinalStage output(List output); - - _FinalStage addOutput(DeidentifyFileOutput output); - - _FinalStage addAllOutput(List output); - - /** - *

Number of words in the processed text.

- */ - _FinalStage wordCount(Optional wordCount); - - _FinalStage wordCount(Integer wordCount); - - /** - *

Number of characters in the processed text.

- */ - _FinalStage characterCount(Optional characterCount); - - _FinalStage characterCount(Integer characterCount); - - /** - *

Size of the processed text in kilobytes (KB).

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

Duration of the processed audio in seconds.

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

Number of pages in the processed PDF.

- */ - _FinalStage pages(Optional pages); - - _FinalStage pages(Integer pages); - - /** - *

Number of slides in the processed presentation.

- */ - _FinalStage slides(Optional slides); - - _FinalStage slides(Integer slides); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements StatusStage, OutputTypeStage, MessageStage, _FinalStage { - private DeidentifyStatusResponseStatus status; - - private DeidentifyStatusResponseOutputType outputType; - - private String message; - - private Optional slides = Optional.empty(); - - private Optional pages = Optional.empty(); - - private Optional duration = Optional.empty(); - - private Optional size = Optional.empty(); - - private Optional characterCount = Optional.empty(); - - private Optional wordCount = Optional.empty(); - - private List output = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeidentifyStatusResponse other) { - status(other.getStatus()); - output(other.getOutput()); - outputType(other.getOutputType()); - message(other.getMessage()); - wordCount(other.getWordCount()); - characterCount(other.getCharacterCount()); - size(other.getSize()); - duration(other.getDuration()); - pages(other.getPages()); - slides(other.getSlides()); - return this; - } - - /** - * 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 - @JsonSetter("status") - public OutputTypeStage status(@NotNull DeidentifyStatusResponseStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); - return this; - } - - /** - * How the output file is specified.

How the output file is specified.

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

Status details about the detect run.

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

Number of slides in the processed presentation.

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

Number of slides in the processed presentation.

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

Number of pages in the processed PDF.

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

Number of pages in the processed PDF.

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

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(Double duration) { - this.duration = Optional.ofNullable(duration); - return this; - } - - /** - *

Duration of the processed audio in seconds.

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

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(Double size) { - this.size = Optional.ofNullable(size); - return this; - } - - /** - *

Size of the processed text in kilobytes (KB).

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

Number of characters in the processed text.

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

Number of characters in the processed text.

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

Number of words in the processed text.

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

Number of words in the processed text.

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

How the input file was specified.

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

How the input file was specified.

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

How the input file was specified.

- */ - @java.lang.Override - @JsonSetter(value = "output", nulls = Nulls.SKIP) - public _FinalStage output(List output) { - this.output.clear(); - this.output.addAll(output); - return this; - } - - @java.lang.Override - public DeidentifyStatusResponse build() { - return new DeidentifyStatusResponse( - status, - output, - outputType, - message, - wordCount, - characterCount, - size, - duration, - pages, - slides, - additionalProperties); - } - } -} 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..d510fc77 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStringResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/DeidentifyStringResponse.java @@ -12,31 +12,30 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.skyflow.generated.rest.core.ObjectMappers; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DeidentifyStringResponse.Builder.class) public final class DeidentifyStringResponse { - private final String processedText; + private final Optional processedText; - private final List entities; + private final Optional> entities; - private final int wordCount; + private final Optional wordCount; - private final int characterCount; + private final Optional characterCount; private final Map additionalProperties; private DeidentifyStringResponse( - String processedText, - List entities, - int wordCount, - int characterCount, + Optional processedText, + Optional> entities, + Optional wordCount, + Optional characterCount, Map additionalProperties) { this.processedText = processedText; this.entities = entities; @@ -49,7 +48,7 @@ private DeidentifyStringResponse( * @return De-identified text. */ @JsonProperty("processed_text") - public String getProcessedText() { + public Optional getProcessedText() { return processedText; } @@ -57,7 +56,7 @@ public String getProcessedText() { * @return Detected entities. */ @JsonProperty("entities") - public List getEntities() { + public Optional> getEntities() { return entities; } @@ -65,7 +64,7 @@ public List getEntities() { * @return Number of words from the input text. */ @JsonProperty("word_count") - public int getWordCount() { + public Optional getWordCount() { return wordCount; } @@ -73,7 +72,7 @@ public int getWordCount() { * @return Number of characters from the input text. */ @JsonProperty("character_count") - public int getCharacterCount() { + public Optional getCharacterCount() { return characterCount; } @@ -91,8 +90,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DeidentifyStringResponse other) { return processedText.equals(other.processedText) && entities.equals(other.entities) - && wordCount == other.wordCount - && characterCount == other.characterCount; + && wordCount.equals(other.wordCount) + && characterCount.equals(other.characterCount); } @java.lang.Override @@ -105,62 +104,25 @@ public String toString() { return ObjectMappers.stringify(this); } - public static ProcessedTextStage builder() { + public static Builder builder() { return new Builder(); } - public interface ProcessedTextStage { - /** - * De-identified text. - */ - WordCountStage processedText(@NotNull String processedText); - - Builder from(DeidentifyStringResponse other); - } - - public interface WordCountStage { - /** - * Number of words from the input text. - */ - CharacterCountStage wordCount(int wordCount); - } - - public interface CharacterCountStage { - /** - * Number of characters from the input text. - */ - _FinalStage characterCount(int characterCount); - } - - public interface _FinalStage { - DeidentifyStringResponse build(); - - /** - *

Detected entities.

- */ - _FinalStage entities(List entities); - - _FinalStage addEntities(DetectedEntity entities); - - _FinalStage addAllEntities(List entities); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ProcessedTextStage, WordCountStage, CharacterCountStage, _FinalStage { - private String processedText; + public static final class Builder { + private Optional processedText = Optional.empty(); - private int wordCount; + private Optional> entities = Optional.empty(); - private int characterCount; + private Optional wordCount = Optional.empty(); - private List entities = new ArrayList<>(); + private Optional characterCount = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(DeidentifyStringResponse other) { processedText(other.getProcessedText()); entities(other.getEntities()); @@ -170,70 +132,61 @@ public Builder from(DeidentifyStringResponse other) { } /** - * De-identified text.

De-identified text.

- * @return Reference to {@code this} so that method calls can be chained together. + *

De-identified text.

*/ - @java.lang.Override - @JsonSetter("processed_text") - public WordCountStage processedText(@NotNull String processedText) { - this.processedText = Objects.requireNonNull(processedText, "processedText must not be null"); + @JsonSetter(value = "processed_text", nulls = Nulls.SKIP) + public Builder processedText(Optional processedText) { + this.processedText = processedText; return this; } - /** - * 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 - @JsonSetter("word_count") - public CharacterCountStage wordCount(int wordCount) { - this.wordCount = wordCount; + public Builder processedText(String processedText) { + this.processedText = Optional.ofNullable(processedText); return this; } /** - * 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. + *

Detected entities.

*/ - @java.lang.Override - @JsonSetter("character_count") - public _FinalStage characterCount(int characterCount) { - this.characterCount = characterCount; + @JsonSetter(value = "entities", nulls = Nulls.SKIP) + public Builder entities(Optional> entities) { + this.entities = entities; return this; } - /** - *

Detected entities.

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

Detected entities.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Number of words from the input text.

*/ - @java.lang.Override - public _FinalStage addEntities(DetectedEntity entities) { - this.entities.add(entities); + @JsonSetter(value = "word_count", nulls = Nulls.SKIP) + public Builder wordCount(Optional wordCount) { + this.wordCount = wordCount; + return this; + } + + public Builder wordCount(Integer wordCount) { + this.wordCount = Optional.ofNullable(wordCount); return this; } /** - *

Detected entities.

+ *

Number of characters from the input text.

*/ - @java.lang.Override - @JsonSetter(value = "entities", nulls = Nulls.SKIP) - public _FinalStage entities(List entities) { - this.entities.clear(); - this.entities.addAll(entities); + @JsonSetter(value = "character_count", nulls = Nulls.SKIP) + public Builder characterCount(Optional characterCount) { + this.characterCount = characterCount; + return this; + } + + public Builder characterCount(Integer characterCount) { + this.characterCount = Optional.ofNullable(characterCount); return this; } - @java.lang.Override public DeidentifyStringResponse build() { return new DeidentifyStringResponse( processedText, entities, wordCount, characterCount, additionalProperties); diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectGuardrailsResponse.java b/src/main/java/com/skyflow/generated/rest/types/DetectGuardrailsResponse.java new file mode 100644 index 00000000..3f3d8558 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/DetectGuardrailsResponse.java @@ -0,0 +1,236 @@ +/** + * 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; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DetectGuardrailsResponse.Builder.class) +public final class DetectGuardrailsResponse { + private final String text; + + private final Optional toxic; + + private final Optional deniedTopic; + + private final DetectGuardrailsResponseValidation validation; + + private final Map additionalProperties; + + private DetectGuardrailsResponse( + String text, + Optional toxic, + Optional deniedTopic, + DetectGuardrailsResponseValidation validation, + Map additionalProperties) { + this.text = text; + this.toxic = toxic; + this.deniedTopic = deniedTopic; + this.validation = validation; + this.additionalProperties = additionalProperties; + } + + /** + * @return Text that was checked against guardrails. + */ + @JsonProperty("text") + public String getText() { + return text; + } + + /** + * @return Whether the text is toxic. + */ + @JsonProperty("toxic") + public Optional getToxic() { + return toxic; + } + + /** + * @return Whether the text included a denied topic. + */ + @JsonProperty("denied_topic") + public Optional getDeniedTopic() { + return deniedTopic; + } + + /** + * @return Whether the text passed validation. + */ + @JsonProperty("validation") + public DetectGuardrailsResponseValidation getValidation() { + return validation; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DetectGuardrailsResponse && equalTo((DetectGuardrailsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DetectGuardrailsResponse other) { + return text.equals(other.text) + && toxic.equals(other.toxic) + && deniedTopic.equals(other.deniedTopic) + && validation.equals(other.validation); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text, this.toxic, this.deniedTopic, this.validation); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TextStage builder() { + return new Builder(); + } + + public interface TextStage { + /** + * Text that was checked against guardrails. + */ + ValidationStage text(@NotNull String text); + + Builder from(DetectGuardrailsResponse other); + } + + public interface ValidationStage { + /** + * Whether the text passed validation. + */ + _FinalStage validation(@NotNull DetectGuardrailsResponseValidation validation); + } + + public interface _FinalStage { + DetectGuardrailsResponse build(); + + /** + *

Whether the text is toxic.

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

Whether the text included a denied topic.

+ */ + _FinalStage deniedTopic(Optional deniedTopic); + + _FinalStage deniedTopic(Boolean deniedTopic); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TextStage, ValidationStage, _FinalStage { + private String text; + + private DetectGuardrailsResponseValidation validation; + + private Optional deniedTopic = Optional.empty(); + + private Optional toxic = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DetectGuardrailsResponse other) { + text(other.getText()); + toxic(other.getToxic()); + deniedTopic(other.getDeniedTopic()); + validation(other.getValidation()); + return this; + } + + /** + * Text that was checked against guardrails.

Text that was checked against guardrails.

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

Whether the text passed validation.

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

Whether the text included a denied topic.

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

Whether the text included a denied topic.

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

Whether the text is toxic.

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

Whether the text is toxic.

+ */ + @java.lang.Override + @JsonSetter(value = "toxic", nulls = Nulls.SKIP) + public _FinalStage toxic(Optional toxic) { + this.toxic = toxic; + return this; + } + + @java.lang.Override + public DetectGuardrailsResponse build() { + return new DetectGuardrailsResponse(text, toxic, deniedTopic, validation, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java b/src/main/java/com/skyflow/generated/rest/types/DetectGuardrailsResponseValidation.java similarity index 78% rename from src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java rename to src/main/java/com/skyflow/generated/rest/types/DetectGuardrailsResponseValidation.java index 2ff9edb8..679f9184 100644 --- a/src/main/java/com/skyflow/generated/rest/types/CheckGuardrailsResponseValidation.java +++ b/src/main/java/com/skyflow/generated/rest/types/DetectGuardrailsResponseValidation.java @@ -5,14 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum CheckGuardrailsResponseValidation { +public enum DetectGuardrailsResponseValidation { FAILED("failed"), PASSED("passed"); private final String value; - CheckGuardrailsResponseValidation(String value) { + DetectGuardrailsResponseValidation(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponse.java b/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponse.java new file mode 100644 index 00000000..ddfececa --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponse.java @@ -0,0 +1,357 @@ +/** + * 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 = DetectRunsResponse.Builder.class) +public final class DetectRunsResponse { + private final Optional status; + + private final Optional outputType; + + private final Optional> output; + + private final Optional message; + + private final Optional size; + + private final Optional wordCharacterCount; + + private final Optional duration; + + private final Optional pages; + + private final Optional slides; + + private final Map additionalProperties; + + private DetectRunsResponse( + Optional status, + Optional outputType, + Optional> output, + Optional message, + Optional size, + Optional wordCharacterCount, + Optional duration, + Optional pages, + Optional slides, + Map additionalProperties) { + this.status = status; + this.outputType = outputType; + this.output = output; + this.message = message; + this.size = size; + this.wordCharacterCount = wordCharacterCount; + this.duration = duration; + this.pages = pages; + this.slides = slides; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of the operation. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Format of the output file. + */ + @JsonProperty("outputType") + public Optional getOutputType() { + return outputType; + } + + /** + * @return Details of output files. Files are specified as Base64-encoded data. + */ + @JsonProperty("output") + public Optional> getOutput() { + return output; + } + + /** + * @return Status details about the Detect run. + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + /** + * @return Size of the processed file in kilobytes (KB). + */ + @JsonProperty("size") + public Optional getSize() { + return size; + } + + @JsonProperty("wordCharacterCount") + public Optional getWordCharacterCount() { + return wordCharacterCount; + } + + /** + * @return Duration of the processed audio in seconds. + */ + @JsonProperty("duration") + public Optional getDuration() { + return duration; + } + + /** + * @return Number of pages in the processed PDF. + */ + @JsonProperty("pages") + public Optional getPages() { + return pages; + } + + /** + * @return Number of slides in the processed presentation. + */ + @JsonProperty("slides") + public Optional getSlides() { + return slides; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DetectRunsResponse && equalTo((DetectRunsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DetectRunsResponse other) { + return status.equals(other.status) + && outputType.equals(other.outputType) + && output.equals(other.output) + && message.equals(other.message) + && size.equals(other.size) + && wordCharacterCount.equals(other.wordCharacterCount) + && duration.equals(other.duration) + && pages.equals(other.pages) + && slides.equals(other.slides); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.status, + this.outputType, + this.output, + this.message, + this.size, + this.wordCharacterCount, + this.duration, + this.pages, + this.slides); + } + + @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 outputType = Optional.empty(); + + private Optional> output = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional wordCharacterCount = Optional.empty(); + + private Optional duration = Optional.empty(); + + private Optional pages = Optional.empty(); + + private Optional slides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DetectRunsResponse other) { + status(other.getStatus()); + outputType(other.getOutputType()); + output(other.getOutput()); + message(other.getMessage()); + size(other.getSize()); + wordCharacterCount(other.getWordCharacterCount()); + duration(other.getDuration()); + pages(other.getPages()); + slides(other.getSlides()); + return this; + } + + /** + *

Status of the operation.

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

Format of the output file.

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

Details of output files. Files are specified as Base64-encoded data.

+ */ + @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 Detect run.

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

Size of the processed file in kilobytes (KB).

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

Duration of the processed audio in seconds.

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

Number of pages in the processed PDF.

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

Number of slides in the processed presentation.

+ */ + @JsonSetter(value = "slides", nulls = Nulls.SKIP) + public Builder slides(Optional slides) { + this.slides = slides; + return this; + } + + public Builder slides(Integer slides) { + this.slides = Optional.ofNullable(slides); + return this; + } + + public DetectRunsResponse build() { + return new DetectRunsResponse( + status, + outputType, + output, + message, + size, + wordCharacterCount, + duration, + pages, + slides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java b/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponseOutputType.java similarity index 69% rename from src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java rename to src/main/java/com/skyflow/generated/rest/types/DetectRunsResponseOutputType.java index 4db4d813..4fb7d748 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseOutputType.java +++ b/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponseOutputType.java @@ -5,14 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyStatusResponseOutputType { - BASE_64("BASE64"), +public enum DetectRunsResponseOutputType { + UNKNOWN("UNKNOWN"), - UNKNOWN("UNKNOWN"); + BASE_64("BASE64"); private final String value; - DeidentifyStatusResponseOutputType(String value) { + DetectRunsResponseOutputType(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java b/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponseStatus.java similarity index 72% rename from src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java rename to src/main/java/com/skyflow/generated/rest/types/DetectRunsResponseStatus.java index f03db2ed..39f11600 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyStatusResponseStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/DetectRunsResponseStatus.java @@ -5,18 +5,18 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyStatusResponseStatus { - FAILED("FAILED"), +public enum DetectRunsResponseStatus { + UNKNOWN("UNKNOWN"), - IN_PROGRESS("IN_PROGRESS"), + FAILED("FAILED"), SUCCESS("SUCCESS"), - UNKNOWN("UNKNOWN"); + IN_PROGRESS("IN_PROGRESS"); private final String value; - DeidentifyStatusResponseStatus(String value) { + DetectRunsResponseStatus(String value) { this.value = value; } 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..161feba5 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ErrorResponseError.java +++ b/src/main/java/com/skyflow/generated/rest/types/ErrorResponseError.java @@ -57,17 +57,11 @@ public int getGrpcCode() { return grpcCode; } - /** - * @return HTTP status codes. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status. - */ @JsonProperty("http_code") public int getHttpCode() { return httpCode; } - /** - * @return HTTP status message. - */ @JsonProperty("http_status") public String getHttpStatus() { return httpStatus; @@ -126,16 +120,10 @@ public interface GrpcCodeStage { } public interface HttpCodeStage { - /** - * HTTP status codes. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status. - */ HttpStatusStage httpCode(int httpCode); } public interface HttpStatusStage { - /** - * HTTP status message. - */ MessageStage httpStatus(@NotNull String httpStatus); } @@ -190,10 +178,6 @@ public HttpCodeStage grpcCode(int grpcCode) { return this; } - /** - * 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 @JsonSetter("http_code") public HttpStatusStage httpCode(int httpCode) { @@ -201,10 +185,6 @@ public HttpStatusStage httpCode(int httpCode) { return this; } - /** - * HTTP status message.

HTTP status message.

- * @return Reference to {@code this} so that method calls can be chained together. - */ @java.lang.Override @JsonSetter("http_status") public MessageStage httpStatus(@NotNull String httpStatus) { diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileData.java similarity index 66% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileData.java index f21ddeef..a012b8b0 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileData.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,23 +17,22 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyFileRequestFile.Builder.class) -public final class DeidentifyFileRequestFile { +@JsonDeserialize(builder = FileData.Builder.class) +public final class FileData { private final String base64; - private final DeidentifyFileRequestFileDataFormat dataFormat; + private final FileDataDataFormat dataFormat; private final Map additionalProperties; - private DeidentifyFileRequestFile( - String base64, DeidentifyFileRequestFileDataFormat dataFormat, Map additionalProperties) { + private FileData(String base64, FileDataDataFormat dataFormat, Map additionalProperties) { this.base64 = base64; this.dataFormat = dataFormat; this.additionalProperties = additionalProperties; } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -41,17 +40,17 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") - public DeidentifyFileRequestFileDataFormat getDataFormat() { + public FileDataDataFormat getDataFormat() { return dataFormat; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyFileRequestFile && equalTo((DeidentifyFileRequestFile) other); + return other instanceof FileData && equalTo((FileData) other); } @JsonAnyGetter @@ -59,7 +58,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyFileRequestFile other) { + private boolean equalTo(FileData other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } @@ -79,29 +78,29 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ DataFormatStage base64(@NotNull String base64); - Builder from(DeidentifyFileRequestFile other); + Builder from(FileData other); } public interface DataFormatStage { /** - * Data format of the file. + * Format of the file. */ - _FinalStage dataFormat(@NotNull DeidentifyFileRequestFileDataFormat dataFormat); + _FinalStage dataFormat(@NotNull FileDataDataFormat dataFormat); } public interface _FinalStage { - DeidentifyFileRequestFile build(); + FileData build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { private String base64; - private DeidentifyFileRequestFileDataFormat dataFormat; + private FileDataDataFormat dataFormat; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -109,14 +108,14 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} @java.lang.Override - public Builder from(DeidentifyFileRequestFile other) { + public Builder from(FileData other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -127,19 +126,19 @@ public DataFormatStage base64(@NotNull String base64) { } /** - * Data format of the file.

Data format of the file.

+ * Format of the file.

Format of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifyFileRequestFileDataFormat dataFormat) { + public _FinalStage dataFormat(@NotNull FileDataDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } @java.lang.Override - public DeidentifyFileRequestFile build() { - return new DeidentifyFileRequestFile(base64, dataFormat, additionalProperties); + public FileData build() { + return new FileData(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/types/FileDataDataFormat.java similarity index 77% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFileDataFormat.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDataFormat.java index b0ab22b9..d49957ae 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyFileRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDataFormat.java @@ -1,54 +1,56 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyFileRequestFileDataFormat { - BMP("bmp"), +public enum FileDataDataFormat { + MP_3("mp3"), - CSV("csv"), + WAV("wav"), - DCM("dcm"), + PDF("pdf"), - DOC("doc"), + TXT("txt"), - DOCX("docx"), + CSV("csv"), - JPEG("jpeg"), + JSON("json"), JPG("jpg"), - JSON("json"), + JPEG("jpeg"), - MP_3("mp3"), + TIF("tif"), - PDF("pdf"), + TIFF("tiff"), PNG("png"), - PPT("ppt"), + BMP("bmp"), - PPTX("pptx"), + XLS("xls"), - TIF("tif"), + XLSX("xlsx"), - TIFF("tiff"), + DOC("doc"), - TXT("txt"), + DOCX("docx"), - WAV("wav"), + PPT("ppt"), - XLS("xls"), + PPTX("pptx"), - XLSX("xlsx"), + XML("xml"), + + DCM("dcm"), - XML("xml"); + JSONL("jsonl"); private final String value; - DeidentifyFileRequestFileDataFormat(String value) { + FileDataDataFormat(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyAudio.java similarity index 66% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyAudio.java index ad124de0..db1aeea9 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyAudioRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyAudio.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,23 +17,23 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyAudioRequestFile.Builder.class) -public final class DeidentifyAudioRequestFile { +@JsonDeserialize(builder = FileDataDeidentifyAudio.Builder.class) +public final class FileDataDeidentifyAudio { private final String base64; - private final DeidentifyAudioRequestFileDataFormat dataFormat; + private final FileDataDeidentifyAudioDataFormat dataFormat; private final Map additionalProperties; - private DeidentifyAudioRequestFile( - String base64, DeidentifyAudioRequestFileDataFormat dataFormat, Map additionalProperties) { + private FileDataDeidentifyAudio( + String base64, FileDataDeidentifyAudioDataFormat dataFormat, Map additionalProperties) { this.base64 = base64; this.dataFormat = dataFormat; this.additionalProperties = additionalProperties; } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -41,17 +41,17 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") - public DeidentifyAudioRequestFileDataFormat getDataFormat() { + public FileDataDeidentifyAudioDataFormat getDataFormat() { return dataFormat; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyAudioRequestFile && equalTo((DeidentifyAudioRequestFile) other); + return other instanceof FileDataDeidentifyAudio && equalTo((FileDataDeidentifyAudio) other); } @JsonAnyGetter @@ -59,7 +59,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyAudioRequestFile other) { + private boolean equalTo(FileDataDeidentifyAudio other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } @@ -79,29 +79,29 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ DataFormatStage base64(@NotNull String base64); - Builder from(DeidentifyAudioRequestFile other); + Builder from(FileDataDeidentifyAudio other); } public interface DataFormatStage { /** - * Data format of the file. + * Format of the file. */ - _FinalStage dataFormat(@NotNull DeidentifyAudioRequestFileDataFormat dataFormat); + _FinalStage dataFormat(@NotNull FileDataDeidentifyAudioDataFormat dataFormat); } public interface _FinalStage { - DeidentifyAudioRequestFile build(); + FileDataDeidentifyAudio build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { private String base64; - private DeidentifyAudioRequestFileDataFormat dataFormat; + private FileDataDeidentifyAudioDataFormat dataFormat; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -109,14 +109,14 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} @java.lang.Override - public Builder from(DeidentifyAudioRequestFile other) { + public Builder from(FileDataDeidentifyAudio other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -127,19 +127,19 @@ public DataFormatStage base64(@NotNull String base64) { } /** - * Data format of the file.

Data format of the file.

+ * Format of the file.

Format of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifyAudioRequestFileDataFormat dataFormat) { + public _FinalStage dataFormat(@NotNull FileDataDeidentifyAudioDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } @java.lang.Override - public DeidentifyAudioRequestFile build() { - return new DeidentifyAudioRequestFile(base64, dataFormat, additionalProperties); + public FileDataDeidentifyAudio build() { + return new FileDataDeidentifyAudio(base64, dataFormat, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyAudioDataFormat.java similarity index 66% rename from src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyAudioDataFormat.java index 45dba579..dbc10429 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVaultDefault.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyAudioDataFormat.java @@ -5,14 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum TokenTypeWithoutVaultDefault { - ENTITY_ONLY("entity_only"), +public enum FileDataDeidentifyAudioDataFormat { + MP_3("mp3"), - ENTITY_UNQ_COUNTER("entity_unq_counter"); + WAV("wav"); private final String value; - TokenTypeWithoutVaultDefault(String value) { + FileDataDeidentifyAudioDataFormat(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyDocument.java similarity index 68% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyDocument.java index 116fd94d..3ebbdc1e 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyDocument.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,23 +17,23 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyImageRequestFile.Builder.class) -public final class DeidentifyImageRequestFile { +@JsonDeserialize(builder = FileDataDeidentifyDocument.Builder.class) +public final class FileDataDeidentifyDocument { private final String base64; - private final DeidentifyImageRequestFileDataFormat dataFormat; + private final FileDataDeidentifyDocumentDataFormat dataFormat; private final Map additionalProperties; - private DeidentifyImageRequestFile( - String base64, DeidentifyImageRequestFileDataFormat dataFormat, Map additionalProperties) { + private FileDataDeidentifyDocument( + String base64, FileDataDeidentifyDocumentDataFormat dataFormat, Map additionalProperties) { this.base64 = base64; this.dataFormat = dataFormat; this.additionalProperties = additionalProperties; } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -41,17 +41,17 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") - public DeidentifyImageRequestFileDataFormat getDataFormat() { + public FileDataDeidentifyDocumentDataFormat getDataFormat() { return dataFormat; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyImageRequestFile && equalTo((DeidentifyImageRequestFile) other); + return other instanceof FileDataDeidentifyDocument && equalTo((FileDataDeidentifyDocument) other); } @JsonAnyGetter @@ -59,7 +59,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyImageRequestFile other) { + private boolean equalTo(FileDataDeidentifyDocument other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } @@ -79,29 +79,29 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ DataFormatStage base64(@NotNull String base64); - Builder from(DeidentifyImageRequestFile other); + Builder from(FileDataDeidentifyDocument other); } public interface DataFormatStage { /** - * Data format of the file. + * Format of the file. */ - _FinalStage dataFormat(@NotNull DeidentifyImageRequestFileDataFormat dataFormat); + _FinalStage dataFormat(@NotNull FileDataDeidentifyDocumentDataFormat dataFormat); } public interface _FinalStage { - DeidentifyImageRequestFile build(); + FileDataDeidentifyDocument build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { private String base64; - private DeidentifyImageRequestFileDataFormat dataFormat; + private FileDataDeidentifyDocumentDataFormat dataFormat; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -109,14 +109,14 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} @java.lang.Override - public Builder from(DeidentifyImageRequestFile other) { + public Builder from(FileDataDeidentifyDocument other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -127,19 +127,19 @@ public DataFormatStage base64(@NotNull String base64) { } /** - * Data format of the file.

Data format of the file.

+ * Format of the file.

Format of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifyImageRequestFileDataFormat dataFormat) { + public _FinalStage dataFormat(@NotNull FileDataDeidentifyDocumentDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } @java.lang.Override - public DeidentifyImageRequestFile build() { - return new DeidentifyImageRequestFile(base64, dataFormat, additionalProperties); + public FileDataDeidentifyDocument build() { + return new FileDataDeidentifyDocument(base64, dataFormat, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyDocumentDataFormat.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyDocumentDataFormat.java new file mode 100644 index 00000000..5446fa2f --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyDocumentDataFormat.java @@ -0,0 +1,26 @@ +/** + * 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 FileDataDeidentifyDocumentDataFormat { + PDF("pdf"), + + DOC("doc"), + + DOCX("docx"); + + private final String value; + + FileDataDeidentifyDocumentDataFormat(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/FileDataDeidentifyImage.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyImage.java new file mode 100644 index 00000000..785e58c5 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyImage.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.skyflow.generated.rest.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.skyflow.generated.rest.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FileDataDeidentifyImage.Builder.class) +public final class FileDataDeidentifyImage { + private final String base64; + + private final FileDataDeidentifyImageDataFormat dataFormat; + + private final Map additionalProperties; + + private FileDataDeidentifyImage( + String base64, FileDataDeidentifyImageDataFormat dataFormat, Map additionalProperties) { + this.base64 = base64; + this.dataFormat = dataFormat; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded data of the file. + */ + @JsonProperty("base64") + public String getBase64() { + return base64; + } + + /** + * @return Format of the file. + */ + @JsonProperty("data_format") + public FileDataDeidentifyImageDataFormat getDataFormat() { + return dataFormat; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileDataDeidentifyImage && equalTo((FileDataDeidentifyImage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileDataDeidentifyImage other) { + return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.base64, this.dataFormat); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Base64Stage builder() { + return new Builder(); + } + + public interface Base64Stage { + /** + * Base64-encoded data of the file. + */ + DataFormatStage base64(@NotNull String base64); + + Builder from(FileDataDeidentifyImage other); + } + + public interface DataFormatStage { + /** + * Format of the file. + */ + _FinalStage dataFormat(@NotNull FileDataDeidentifyImageDataFormat dataFormat); + } + + public interface _FinalStage { + FileDataDeidentifyImage build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { + private String base64; + + private FileDataDeidentifyImageDataFormat dataFormat; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FileDataDeidentifyImage other) { + base64(other.getBase64()); + dataFormat(other.getDataFormat()); + return this; + } + + /** + * Base64-encoded data of the file.

Base64-encoded data of the file.

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

Format of the file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data_format") + public _FinalStage dataFormat(@NotNull FileDataDeidentifyImageDataFormat dataFormat) { + this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); + return this; + } + + @java.lang.Override + public FileDataDeidentifyImage build() { + return new FileDataDeidentifyImage(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/types/FileDataDeidentifyImageDataFormat.java similarity index 64% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFileDataFormat.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyImageDataFormat.java index cfb324d9..6f1ed581 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyImageRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyImageDataFormat.java @@ -1,26 +1,26 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifyImageRequestFileDataFormat { - BMP("bmp"), +public enum FileDataDeidentifyImageDataFormat { + JPG("jpg"), JPEG("jpeg"), - JPG("jpg"), + TIF("tif"), - PNG("png"), + TIFF("tiff"), - TIF("tif"), + PNG("png"), - TIFF("tiff"); + BMP("bmp"); private final String value; - DeidentifyImageRequestFileDataFormat(String value) { + FileDataDeidentifyImageDataFormat(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPdf.java similarity index 72% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPdf.java index 14028aab..25e91ce8 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyPdfRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPdf.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,19 +17,19 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyPdfRequestFile.Builder.class) -public final class DeidentifyPdfRequestFile { +@JsonDeserialize(builder = FileDataDeidentifyPdf.Builder.class) +public final class FileDataDeidentifyPdf { private final String base64; private final Map additionalProperties; - private DeidentifyPdfRequestFile(String base64, Map additionalProperties) { + private FileDataDeidentifyPdf(String base64, Map additionalProperties) { this.base64 = base64; this.additionalProperties = additionalProperties; } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -37,7 +37,7 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") public String getDataFormat() { @@ -47,7 +47,7 @@ public String getDataFormat() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyPdfRequestFile && equalTo((DeidentifyPdfRequestFile) other); + return other instanceof FileDataDeidentifyPdf && equalTo((FileDataDeidentifyPdf) other); } @JsonAnyGetter @@ -55,7 +55,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyPdfRequestFile other) { + private boolean equalTo(FileDataDeidentifyPdf other) { return base64.equals(other.base64); } @@ -75,15 +75,15 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ _FinalStage base64(@NotNull String base64); - Builder from(DeidentifyPdfRequestFile other); + Builder from(FileDataDeidentifyPdf other); } public interface _FinalStage { - DeidentifyPdfRequestFile build(); + FileDataDeidentifyPdf build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -96,13 +96,13 @@ public static final class Builder implements Base64Stage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeidentifyPdfRequestFile other) { + public Builder from(FileDataDeidentifyPdf other) { base64(other.getBase64()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -113,8 +113,8 @@ public _FinalStage base64(@NotNull String base64) { } @java.lang.Override - public DeidentifyPdfRequestFile build() { - return new DeidentifyPdfRequestFile(base64, additionalProperties); + public FileDataDeidentifyPdf build() { + return new FileDataDeidentifyPdf(base64, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPresentation.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPresentation.java new file mode 100644 index 00000000..fce353e0 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPresentation.java @@ -0,0 +1,147 @@ +/** + * 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 = FileDataDeidentifyPresentation.Builder.class) +public final class FileDataDeidentifyPresentation { + private final String base64; + + private final FileDataDeidentifyPresentationDataFormat dataFormat; + + private final Map additionalProperties; + + private FileDataDeidentifyPresentation( + String base64, + FileDataDeidentifyPresentationDataFormat dataFormat, + Map additionalProperties) { + this.base64 = base64; + this.dataFormat = dataFormat; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded data of the file. + */ + @JsonProperty("base64") + public String getBase64() { + return base64; + } + + /** + * @return Format of the file. + */ + @JsonProperty("data_format") + public FileDataDeidentifyPresentationDataFormat getDataFormat() { + return dataFormat; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileDataDeidentifyPresentation && equalTo((FileDataDeidentifyPresentation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileDataDeidentifyPresentation other) { + return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.base64, this.dataFormat); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Base64Stage builder() { + return new Builder(); + } + + public interface Base64Stage { + /** + * Base64-encoded data of the file. + */ + DataFormatStage base64(@NotNull String base64); + + Builder from(FileDataDeidentifyPresentation other); + } + + public interface DataFormatStage { + /** + * Format of the file. + */ + _FinalStage dataFormat(@NotNull FileDataDeidentifyPresentationDataFormat dataFormat); + } + + public interface _FinalStage { + FileDataDeidentifyPresentation build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { + private String base64; + + private FileDataDeidentifyPresentationDataFormat dataFormat; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FileDataDeidentifyPresentation other) { + base64(other.getBase64()); + dataFormat(other.getDataFormat()); + return this; + } + + /** + * Base64-encoded data of the file.

Base64-encoded data of the file.

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

Format of the file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data_format") + public _FinalStage dataFormat(@NotNull FileDataDeidentifyPresentationDataFormat dataFormat) { + this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); + return this; + } + + @java.lang.Override + public FileDataDeidentifyPresentation build() { + return new FileDataDeidentifyPresentation(base64, dataFormat, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPresentationDataFormat.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPresentationDataFormat.java new file mode 100644 index 00000000..c0b6fcca --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyPresentationDataFormat.java @@ -0,0 +1,24 @@ +/** + * 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 FileDataDeidentifyPresentationDataFormat { + PPT("ppt"), + + PPTX("pptx"); + + private final String value; + + FileDataDeidentifyPresentationDataFormat(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/resources/files/types/DeidentifyDocumentRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifySpreadsheet.java similarity index 68% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifySpreadsheet.java index 76c7972c..853b98db 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyDocumentRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifySpreadsheet.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,17 +17,17 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyDocumentRequestFile.Builder.class) -public final class DeidentifyDocumentRequestFile { +@JsonDeserialize(builder = FileDataDeidentifySpreadsheet.Builder.class) +public final class FileDataDeidentifySpreadsheet { private final String base64; - private final DeidentifyDocumentRequestFileDataFormat dataFormat; + private final FileDataDeidentifySpreadsheetDataFormat dataFormat; private final Map additionalProperties; - private DeidentifyDocumentRequestFile( + private FileDataDeidentifySpreadsheet( String base64, - DeidentifyDocumentRequestFileDataFormat dataFormat, + FileDataDeidentifySpreadsheetDataFormat dataFormat, Map additionalProperties) { this.base64 = base64; this.dataFormat = dataFormat; @@ -35,7 +35,7 @@ private DeidentifyDocumentRequestFile( } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -43,17 +43,17 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") - public DeidentifyDocumentRequestFileDataFormat getDataFormat() { + public FileDataDeidentifySpreadsheetDataFormat getDataFormat() { return dataFormat; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyDocumentRequestFile && equalTo((DeidentifyDocumentRequestFile) other); + return other instanceof FileDataDeidentifySpreadsheet && equalTo((FileDataDeidentifySpreadsheet) other); } @JsonAnyGetter @@ -61,7 +61,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyDocumentRequestFile other) { + private boolean equalTo(FileDataDeidentifySpreadsheet other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } @@ -81,29 +81,29 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ DataFormatStage base64(@NotNull String base64); - Builder from(DeidentifyDocumentRequestFile other); + Builder from(FileDataDeidentifySpreadsheet other); } public interface DataFormatStage { /** - * Data format of the file. + * Format of the file. */ - _FinalStage dataFormat(@NotNull DeidentifyDocumentRequestFileDataFormat dataFormat); + _FinalStage dataFormat(@NotNull FileDataDeidentifySpreadsheetDataFormat dataFormat); } public interface _FinalStage { - DeidentifyDocumentRequestFile build(); + FileDataDeidentifySpreadsheet build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { private String base64; - private DeidentifyDocumentRequestFileDataFormat dataFormat; + private FileDataDeidentifySpreadsheetDataFormat dataFormat; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -111,14 +111,14 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} @java.lang.Override - public Builder from(DeidentifyDocumentRequestFile other) { + public Builder from(FileDataDeidentifySpreadsheet other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -129,19 +129,19 @@ public DataFormatStage base64(@NotNull String base64) { } /** - * Data format of the file.

Data format of the file.

+ * Format of the file.

Format of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifyDocumentRequestFileDataFormat dataFormat) { + public _FinalStage dataFormat(@NotNull FileDataDeidentifySpreadsheetDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } @java.lang.Override - public DeidentifyDocumentRequestFile build() { - return new DeidentifyDocumentRequestFile(base64, dataFormat, additionalProperties); + public FileDataDeidentifySpreadsheet build() { + return new FileDataDeidentifySpreadsheet(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/types/FileDataDeidentifySpreadsheetDataFormat.java similarity index 66% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFileDataFormat.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifySpreadsheetDataFormat.java index 795a2666..496fdd26 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifySpreadsheetDataFormat.java @@ -1,11 +1,11 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonValue; -public enum DeidentifySpreadsheetRequestFileDataFormat { +public enum FileDataDeidentifySpreadsheetDataFormat { CSV("csv"), XLS("xls"), @@ -14,7 +14,7 @@ public enum DeidentifySpreadsheetRequestFileDataFormat { private final String value; - DeidentifySpreadsheetRequestFileDataFormat(String value) { + FileDataDeidentifySpreadsheetDataFormat(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyStructuredText.java similarity index 68% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyStructuredText.java index 2e291563..a2ca1ba0 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifySpreadsheetRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyStructuredText.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,17 +17,17 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifySpreadsheetRequestFile.Builder.class) -public final class DeidentifySpreadsheetRequestFile { +@JsonDeserialize(builder = FileDataDeidentifyStructuredText.Builder.class) +public final class FileDataDeidentifyStructuredText { private final String base64; - private final DeidentifySpreadsheetRequestFileDataFormat dataFormat; + private final FileDataDeidentifyStructuredTextDataFormat dataFormat; private final Map additionalProperties; - private DeidentifySpreadsheetRequestFile( + private FileDataDeidentifyStructuredText( String base64, - DeidentifySpreadsheetRequestFileDataFormat dataFormat, + FileDataDeidentifyStructuredTextDataFormat dataFormat, Map additionalProperties) { this.base64 = base64; this.dataFormat = dataFormat; @@ -35,7 +35,7 @@ private DeidentifySpreadsheetRequestFile( } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -43,17 +43,17 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") - public DeidentifySpreadsheetRequestFileDataFormat getDataFormat() { + public FileDataDeidentifyStructuredTextDataFormat getDataFormat() { return dataFormat; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifySpreadsheetRequestFile && equalTo((DeidentifySpreadsheetRequestFile) other); + return other instanceof FileDataDeidentifyStructuredText && equalTo((FileDataDeidentifyStructuredText) other); } @JsonAnyGetter @@ -61,7 +61,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifySpreadsheetRequestFile other) { + private boolean equalTo(FileDataDeidentifyStructuredText other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } @@ -81,29 +81,29 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ DataFormatStage base64(@NotNull String base64); - Builder from(DeidentifySpreadsheetRequestFile other); + Builder from(FileDataDeidentifyStructuredText other); } public interface DataFormatStage { /** - * Data format of the file. + * Format of the file. */ - _FinalStage dataFormat(@NotNull DeidentifySpreadsheetRequestFileDataFormat dataFormat); + _FinalStage dataFormat(@NotNull FileDataDeidentifyStructuredTextDataFormat dataFormat); } public interface _FinalStage { - DeidentifySpreadsheetRequestFile build(); + FileDataDeidentifyStructuredText build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { private String base64; - private DeidentifySpreadsheetRequestFileDataFormat dataFormat; + private FileDataDeidentifyStructuredTextDataFormat dataFormat; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -111,14 +111,14 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} @java.lang.Override - public Builder from(DeidentifySpreadsheetRequestFile other) { + public Builder from(FileDataDeidentifyStructuredText other) { base64(other.getBase64()); dataFormat(other.getDataFormat()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -129,19 +129,19 @@ public DataFormatStage base64(@NotNull String base64) { } /** - * Data format of the file.

Data format of the file.

+ * Format of the file.

Format of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull DeidentifySpreadsheetRequestFileDataFormat dataFormat) { + public _FinalStage dataFormat(@NotNull FileDataDeidentifyStructuredTextDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } @java.lang.Override - public DeidentifySpreadsheetRequestFile build() { - return new DeidentifySpreadsheetRequestFile(base64, dataFormat, additionalProperties); + public FileDataDeidentifyStructuredText build() { + return new FileDataDeidentifyStructuredText(base64, dataFormat, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyStructuredTextDataFormat.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyStructuredTextDataFormat.java new file mode 100644 index 00000000..613a4455 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyStructuredTextDataFormat.java @@ -0,0 +1,24 @@ +/** + * 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 FileDataDeidentifyStructuredTextDataFormat { + JSON("json"), + + XML("xml"); + + private final String value; + + FileDataDeidentifyStructuredTextDataFormat(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/resources/files/types/DeidentifyTextRequestFile.java b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyText.java similarity index 72% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyTextRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyText.java index c7cbc5b3..cba1d62c 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/DeidentifyTextRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataDeidentifyText.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,19 +17,19 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyTextRequestFile.Builder.class) -public final class DeidentifyTextRequestFile { +@JsonDeserialize(builder = FileDataDeidentifyText.Builder.class) +public final class FileDataDeidentifyText { private final String base64; private final Map additionalProperties; - private DeidentifyTextRequestFile(String base64, Map additionalProperties) { + private FileDataDeidentifyText(String base64, Map additionalProperties) { this.base64 = base64; this.additionalProperties = additionalProperties; } /** - * @return Base64-encoded data of the file to de-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -37,7 +37,7 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") public String getDataFormat() { @@ -47,7 +47,7 @@ public String getDataFormat() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyTextRequestFile && equalTo((DeidentifyTextRequestFile) other); + return other instanceof FileDataDeidentifyText && equalTo((FileDataDeidentifyText) other); } @JsonAnyGetter @@ -55,7 +55,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyTextRequestFile other) { + private boolean equalTo(FileDataDeidentifyText other) { return base64.equals(other.base64); } @@ -75,15 +75,15 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to de-identify. + * Base64-encoded data of the file. */ _FinalStage base64(@NotNull String base64); - Builder from(DeidentifyTextRequestFile other); + Builder from(FileDataDeidentifyText other); } public interface _FinalStage { - DeidentifyTextRequestFile build(); + FileDataDeidentifyText build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -96,13 +96,13 @@ public static final class Builder implements Base64Stage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeidentifyTextRequestFile other) { + public Builder from(FileDataDeidentifyText other) { base64(other.getBase64()); return this; } /** - * Base64-encoded data of the file to de-identify.

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

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -113,8 +113,8 @@ public _FinalStage base64(@NotNull String base64) { } @java.lang.Override - public DeidentifyTextRequestFile build() { - return new DeidentifyTextRequestFile(base64, additionalProperties); + public FileDataDeidentifyText build() { + return new FileDataDeidentifyText(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/types/FileDataReidentifyFile.java similarity index 66% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFile.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataReidentifyFile.java index bea9b303..37778509 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFile.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataReidentifyFile.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -17,23 +17,23 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ReidentifyFileRequestFile.Builder.class) -public final class ReidentifyFileRequestFile { +@JsonDeserialize(builder = FileDataReidentifyFile.Builder.class) +public final class FileDataReidentifyFile { private final String base64; - private final ReidentifyFileRequestFileDataFormat dataFormat; + private final FileDataReidentifyFileDataFormat dataFormat; private final Map additionalProperties; - private ReidentifyFileRequestFile( - String base64, ReidentifyFileRequestFileDataFormat dataFormat, Map additionalProperties) { + private FileDataReidentifyFile( + String base64, FileDataReidentifyFileDataFormat dataFormat, Map additionalProperties) { this.base64 = base64; this.dataFormat = dataFormat; this.additionalProperties = additionalProperties; } /** - * @return Base64-encoded data of the file to re-identify. + * @return Base64-encoded data of the file. */ @JsonProperty("base64") public String getBase64() { @@ -41,17 +41,17 @@ public String getBase64() { } /** - * @return Data format of the file. + * @return Format of the file. */ @JsonProperty("data_format") - public ReidentifyFileRequestFileDataFormat getDataFormat() { + public FileDataReidentifyFileDataFormat getDataFormat() { return dataFormat; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ReidentifyFileRequestFile && equalTo((ReidentifyFileRequestFile) other); + return other instanceof FileDataReidentifyFile && equalTo((FileDataReidentifyFile) other); } @JsonAnyGetter @@ -59,7 +59,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ReidentifyFileRequestFile other) { + private boolean equalTo(FileDataReidentifyFile other) { return base64.equals(other.base64) && dataFormat.equals(other.dataFormat); } @@ -79,29 +79,29 @@ public static Base64Stage builder() { public interface Base64Stage { /** - * Base64-encoded data of the file to re-identify. + * Base64-encoded data of the file. */ DataFormatStage base64(@NotNull String base64); - Builder from(ReidentifyFileRequestFile other); + Builder from(FileDataReidentifyFile other); } public interface DataFormatStage { /** - * Data format of the file. + * Format of the file. */ - _FinalStage dataFormat(@NotNull ReidentifyFileRequestFileDataFormat dataFormat); + _FinalStage dataFormat(@NotNull FileDataReidentifyFileDataFormat dataFormat); } public interface _FinalStage { - ReidentifyFileRequestFile build(); + FileDataReidentifyFile build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements Base64Stage, DataFormatStage, _FinalStage { private String base64; - private ReidentifyFileRequestFileDataFormat dataFormat; + private FileDataReidentifyFileDataFormat dataFormat; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -109,14 +109,14 @@ public static final class Builder implements Base64Stage, DataFormatStage, _Fina private Builder() {} @java.lang.Override - public Builder from(ReidentifyFileRequestFile other) { + public Builder from(FileDataReidentifyFile 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.

+ * Base64-encoded data of the file.

Base64-encoded data of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -127,19 +127,19 @@ public DataFormatStage base64(@NotNull String base64) { } /** - * Data format of the file.

Data format of the file.

+ * Format of the file.

Format of the file.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("data_format") - public _FinalStage dataFormat(@NotNull ReidentifyFileRequestFileDataFormat dataFormat) { + public _FinalStage dataFormat(@NotNull FileDataReidentifyFileDataFormat dataFormat) { this.dataFormat = Objects.requireNonNull(dataFormat, "dataFormat must not be null"); return this; } @java.lang.Override - public ReidentifyFileRequestFile build() { - return new ReidentifyFileRequestFile(base64, dataFormat, additionalProperties); + public FileDataReidentifyFile build() { + return new FileDataReidentifyFile(base64, dataFormat, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFileDataFormat.java b/src/main/java/com/skyflow/generated/rest/types/FileDataReidentifyFileDataFormat.java similarity index 72% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFileDataFormat.java rename to src/main/java/com/skyflow/generated/rest/types/FileDataReidentifyFileDataFormat.java index 3e1555f3..fc8df337 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFileDataFormat.java +++ b/src/main/java/com/skyflow/generated/rest/types/FileDataReidentifyFileDataFormat.java @@ -1,30 +1,30 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonValue; -public enum ReidentifyFileRequestFileDataFormat { - CSV("csv"), - - DOC("doc"), +public enum FileDataReidentifyFileDataFormat { + TXT("txt"), - DOCX("docx"), + CSV("csv"), JSON("json"), - TXT("txt"), - XLS("xls"), XLSX("xlsx"), + DOC("doc"), + + DOCX("docx"), + XML("xml"); private final String value; - ReidentifyFileRequestFileDataFormat(String value) { + FileDataReidentifyFileDataFormat(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFormat.java b/src/main/java/com/skyflow/generated/rest/types/Format.java similarity index 65% rename from src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFormat.java rename to src/main/java/com/skyflow/generated/rest/types/Format.java index 232fcd55..ad3e814d 100644 --- a/src/main/java/com/skyflow/generated/rest/resources/files/types/ReidentifyFileRequestFormat.java +++ b/src/main/java/com/skyflow/generated/rest/types/Format.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.skyflow.generated.rest.resources.files.types; +package com.skyflow.generated.rest.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ 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; @@ -20,20 +19,20 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ReidentifyFileRequestFormat.Builder.class) -public final class ReidentifyFileRequestFormat { - private final Optional> redacted; +@JsonDeserialize(builder = Format.Builder.class) +public final class Format { + private final Optional> redacted; - private final Optional> masked; + private final Optional> masked; - private final Optional> plaintext; + private final Optional> plaintext; private final Map additionalProperties; - private ReidentifyFileRequestFormat( - Optional> redacted, - Optional> masked, - Optional> plaintext, + private Format( + Optional> redacted, + Optional> masked, + Optional> plaintext, Map additionalProperties) { this.redacted = redacted; this.masked = masked; @@ -45,7 +44,7 @@ private ReidentifyFileRequestFormat( * @return Entity types to fully redact. */ @JsonProperty("redacted") - public Optional> getRedacted() { + public Optional> getRedacted() { return redacted; } @@ -53,7 +52,7 @@ public Optional> getRedacted() { * @return Entity types to mask. */ @JsonProperty("masked") - public Optional> getMasked() { + public Optional> getMasked() { return masked; } @@ -61,14 +60,14 @@ public Optional> getMasked() { * @return Entity types to return in plaintext. */ @JsonProperty("plaintext") - public Optional> getPlaintext() { + public Optional> getPlaintext() { return plaintext; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ReidentifyFileRequestFormat && equalTo((ReidentifyFileRequestFormat) other); + return other instanceof Format && equalTo((Format) other); } @JsonAnyGetter @@ -76,7 +75,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ReidentifyFileRequestFormat other) { + private boolean equalTo(Format other) { return redacted.equals(other.redacted) && masked.equals(other.masked) && plaintext.equals(other.plaintext); } @@ -96,18 +95,18 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> redacted = Optional.empty(); + private Optional> redacted = Optional.empty(); - private Optional> masked = Optional.empty(); + private Optional> masked = Optional.empty(); - private Optional> plaintext = Optional.empty(); + private Optional> plaintext = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(ReidentifyFileRequestFormat other) { + public Builder from(Format other) { redacted(other.getRedacted()); masked(other.getMasked()); plaintext(other.getPlaintext()); @@ -118,12 +117,12 @@ public Builder from(ReidentifyFileRequestFormat other) { *

Entity types to fully redact.

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

Entity types to mask.

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

Entity types to return in plaintext.

*/ @JsonSetter(value = "plaintext", nulls = Nulls.SKIP) - public Builder plaintext(Optional> plaintext) { + public Builder plaintext(Optional> plaintext) { this.plaintext = plaintext; return this; } - public Builder plaintext(List plaintext) { + public Builder plaintext(List plaintext) { this.plaintext = Optional.ofNullable(plaintext); return this; } - public ReidentifyFileRequestFormat build() { - return new ReidentifyFileRequestFormat(redacted, masked, plaintext, additionalProperties); + public Format build() { + return new Format(redacted, masked, plaintext, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/EntityType.java b/src/main/java/com/skyflow/generated/rest/types/FormatMaskedItem.java similarity index 95% rename from src/main/java/com/skyflow/generated/rest/types/EntityType.java rename to src/main/java/com/skyflow/generated/rest/types/FormatMaskedItem.java index e6dcf699..c3b8d6b9 100644 --- a/src/main/java/com/skyflow/generated/rest/types/EntityType.java +++ b/src/main/java/com/skyflow/generated/rest/types/FormatMaskedItem.java @@ -5,21 +5,11 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum EntityType { - ACCOUNT_NUMBER("account_number"), - +public enum FormatMaskedItem { AGE("age"), - ALL("all"), - BANK_ACCOUNT("bank_account"), - BLOOD_TYPE("blood_type"), - - CONDITION("condition"), - - CORPORATE_ACTION("corporate_action"), - CREDIT_CARD("credit_card"), CREDIT_CARD_EXPIRATION("credit_card_expiration"), @@ -30,43 +20,47 @@ public enum EntityType { DATE_INTERVAL("date_interval"), - DAY("day"), - DOB("dob"), - DOSE("dose"), - DRIVER_LICENSE("driver_license"), - DRUG("drug"), + EMAIL_ADDRESS("email_address"), - DURATION("duration"), + HEALTHCARE_NUMBER("healthcare_number"), - EFFECT("effect"), + IP_ADDRESS("ip_address"), - EMAIL_ADDRESS("email_address"), + LOCATION("location"), - EVENT("event"), + NAME("name"), - FILENAME("filename"), + NUMERICAL_PII("numerical_pii"), - FINANCIAL_METRIC("financial_metric"), + PHONE_NUMBER("phone_number"), - GENDER("gender"), + SSN("ssn"), - HEALTHCARE_NUMBER("healthcare_number"), + URL("url"), - INJURY("injury"), + VEHICLE_ID("vehicle_id"), - IP_ADDRESS("ip_address"), + MEDICAL_CODE("medical_code"), - LANGUAGE("language"), + NAME_FAMILY("name_family"), - LOCATION("location"), + NAME_GIVEN("name_given"), - LOCATION_ADDRESS("location_address"), + ACCOUNT_NUMBER("account_number"), - LOCATION_ADDRESS_STREET("location_address_street"), + EVENT("event"), + + FILENAME("filename"), + + GENDER("gender"), + + LANGUAGE("language"), + + LOCATION_ADDRESS("location_address"), LOCATION_CITY("location_city"), @@ -80,30 +74,14 @@ public enum EntityType { MARITAL_STATUS("marital_status"), - MEDICAL_CODE("medical_code"), - - MEDICAL_PROCESS("medical_process"), - MONEY("money"), - MONTH("month"), - - NAME("name"), - - NAME_FAMILY("name_family"), - - NAME_GIVEN("name_given"), - NAME_MEDICAL_PROFESSIONAL("name_medical_professional"), - NUMERICAL_PII("numerical_pii"), - OCCUPATION("occupation"), ORGANIZATION("organization"), - ORGANIZATION_ID("organization_id"), - ORGANIZATION_MEDICAL_FACILITY("organization_medical_facility"), ORIGIN("origin"), @@ -112,43 +90,65 @@ public enum EntityType { PASSWORD("password"), - PHONE_NUMBER("phone_number"), - PHYSICAL_ATTRIBUTE("physical_attribute"), POLITICAL_AFFILIATION("political_affiliation"), - PRODUCT("product"), + RELIGION("religion"), - PROJECT("project"), + TIME("time"), - RELIGION("religion"), + USERNAME("username"), - ROUTING_NUMBER("routing_number"), + ZODIAC_SIGN("zodiac_sign"), - SEXUALITY("sexuality"), + BLOOD_TYPE("blood_type"), - SSN("ssn"), + CONDITION("condition"), + + DOSE("dose"), + + DRUG("drug"), + + INJURY("injury"), + + MEDICAL_PROCESS("medical_process"), STATISTICS("statistics"), - TIME("time"), + ROUTING_NUMBER("routing_number"), + + CORPORATE_ACTION("corporate_action"), + + FINANCIAL_METRIC("financial_metric"), + + PRODUCT("product"), TREND("trend"), - URL("url"), + DURATION("duration"), - USERNAME("username"), + LOCATION_ADDRESS_STREET("location_address_street"), - VEHICLE_ID("vehicle_id"), + ALL("all"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), - YEAR("year"), + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), - ZODIAC_SIGN("zodiac_sign"); + YEAR("year"); private final String value; - EntityType(String value) { + FormatMaskedItem(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/FormatPlaintextItem.java b/src/main/java/com/skyflow/generated/rest/types/FormatPlaintextItem.java new file mode 100644 index 00000000..0698f38e --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FormatPlaintextItem.java @@ -0,0 +1,160 @@ +/** + * 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 FormatPlaintextItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + FormatPlaintextItem(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/FormatRedactedItem.java b/src/main/java/com/skyflow/generated/rest/types/FormatRedactedItem.java new file mode 100644 index 00000000..bd3c4284 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/FormatRedactedItem.java @@ -0,0 +1,160 @@ +/** + * 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 FormatRedactedItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + FormatRedactedItem(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/ReidentifyStringResponse.java b/src/main/java/com/skyflow/generated/rest/types/IdentifyResponse.java similarity index 56% rename from src/main/java/com/skyflow/generated/rest/types/ReidentifyStringResponse.java rename to src/main/java/com/skyflow/generated/rest/types/IdentifyResponse.java index ba305e63..970403ed 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ReidentifyStringResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/IdentifyResponse.java @@ -9,22 +9,21 @@ 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; +import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ReidentifyStringResponse.Builder.class) -public final class ReidentifyStringResponse { - private final Optional text; +@JsonDeserialize(builder = IdentifyResponse.Builder.class) +public final class IdentifyResponse { + private final String text; private final Map additionalProperties; - private ReidentifyStringResponse(Optional text, Map additionalProperties) { + private IdentifyResponse(String text, Map additionalProperties) { this.text = text; this.additionalProperties = additionalProperties; } @@ -33,14 +32,14 @@ private ReidentifyStringResponse(Optional text, Map addi * @return Re-identified text. */ @JsonProperty("text") - public Optional getText() { + public String getText() { return text; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ReidentifyStringResponse && equalTo((ReidentifyStringResponse) other); + return other instanceof IdentifyResponse && equalTo((IdentifyResponse) other); } @JsonAnyGetter @@ -48,7 +47,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ReidentifyStringResponse other) { + private boolean equalTo(IdentifyResponse other) { return text.equals(other.text); } @@ -62,40 +61,52 @@ public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static TextStage builder() { return new Builder(); } + public interface TextStage { + /** + * Re-identified text. + */ + _FinalStage text(@NotNull String text); + + Builder from(IdentifyResponse other); + } + + public interface _FinalStage { + IdentifyResponse build(); + } + @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional text = Optional.empty(); + public static final class Builder implements TextStage, _FinalStage { + private String text; @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(ReidentifyStringResponse other) { + @java.lang.Override + public Builder from(IdentifyResponse other) { text(other.getText()); return this; } /** - *

Re-identified text.

+ * Re-identified text.

Re-identified text.

+ * @return Reference to {@code this} so that method calls can be chained together. */ - @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); + @java.lang.Override + @JsonSetter("text") + public _FinalStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - public ReidentifyStringResponse build() { - return new ReidentifyStringResponse(text, additionalProperties); + @java.lang.Override + public IdentifyResponse build() { + return new IdentifyResponse(text, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/EntityLocation.java b/src/main/java/com/skyflow/generated/rest/types/Locations.java similarity index 92% rename from src/main/java/com/skyflow/generated/rest/types/EntityLocation.java rename to src/main/java/com/skyflow/generated/rest/types/Locations.java index 6e711422..84b7d285 100644 --- a/src/main/java/com/skyflow/generated/rest/types/EntityLocation.java +++ b/src/main/java/com/skyflow/generated/rest/types/Locations.java @@ -18,8 +18,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EntityLocation.Builder.class) -public final class EntityLocation { +@JsonDeserialize(builder = Locations.Builder.class) +public final class Locations { private final Optional startIndex; private final Optional endIndex; @@ -30,7 +30,7 @@ public final class EntityLocation { private final Map additionalProperties; - private EntityLocation( + private Locations( Optional startIndex, Optional endIndex, Optional startIndexProcessed, @@ -78,7 +78,7 @@ public Optional getEndIndexProcessed() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof EntityLocation && equalTo((EntityLocation) other); + return other instanceof Locations && equalTo((Locations) other); } @JsonAnyGetter @@ -86,7 +86,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(EntityLocation other) { + private boolean equalTo(Locations other) { return startIndex.equals(other.startIndex) && endIndex.equals(other.endIndex) && startIndexProcessed.equals(other.startIndexProcessed) @@ -122,7 +122,7 @@ public static final class Builder { private Builder() {} - public Builder from(EntityLocation other) { + public Builder from(Locations other) { startIndex(other.getStartIndex()); endIndex(other.getEndIndex()); startIndexProcessed(other.getStartIndexProcessed()); @@ -186,9 +186,8 @@ public Builder endIndexProcessed(Integer endIndexProcessed) { return this; } - public EntityLocation build() { - return new EntityLocation( - startIndex, endIndex, startIndexProcessed, endIndexProcessed, additionalProperties); + public Locations build() { + return new Locations(startIndex, endIndex, startIndexProcessed, endIndexProcessed, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifiedFileOutput.java similarity index 72% rename from src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java rename to src/main/java/com/skyflow/generated/rest/types/ReidentifiedFileOutput.java index 59839994..4b00e81d 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DeidentifyFileOutput.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifiedFileOutput.java @@ -18,20 +18,20 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeidentifyFileOutput.Builder.class) -public final class DeidentifyFileOutput { +@JsonDeserialize(builder = ReidentifiedFileOutput.Builder.class) +public final class ReidentifiedFileOutput { private final Optional processedFile; - private final Optional processedFileType; + private final Optional processedFileType; - private final Optional processedFileExtension; + private final Optional processedFileExtension; private final Map additionalProperties; - private DeidentifyFileOutput( + private ReidentifiedFileOutput( Optional processedFile, - Optional processedFileType, - Optional processedFileExtension, + Optional processedFileType, + Optional processedFileExtension, Map additionalProperties) { this.processedFile = processedFile; this.processedFileType = processedFileType; @@ -40,7 +40,7 @@ private DeidentifyFileOutput( } /** - * @return URL or base64-encoded data of the output. + * @return File content in Base64 format. */ @JsonProperty("processed_file") public Optional getProcessedFile() { @@ -51,7 +51,7 @@ public Optional getProcessedFile() { * @return Type of the processed file. */ @JsonProperty("processed_file_type") - public Optional getProcessedFileType() { + public Optional getProcessedFileType() { return processedFileType; } @@ -59,14 +59,14 @@ public Optional getProcessedFileType() { * @return Extension of the processed file. */ @JsonProperty("processed_file_extension") - public Optional getProcessedFileExtension() { + public Optional getProcessedFileExtension() { return processedFileExtension; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeidentifyFileOutput && equalTo((DeidentifyFileOutput) other); + return other instanceof ReidentifiedFileOutput && equalTo((ReidentifiedFileOutput) other); } @JsonAnyGetter @@ -74,7 +74,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeidentifyFileOutput other) { + private boolean equalTo(ReidentifiedFileOutput other) { return processedFile.equals(other.processedFile) && processedFileType.equals(other.processedFileType) && processedFileExtension.equals(other.processedFileExtension); @@ -98,16 +98,16 @@ public static Builder builder() { public static final class Builder { private Optional processedFile = Optional.empty(); - private Optional processedFileType = Optional.empty(); + private Optional processedFileType = Optional.empty(); - private Optional processedFileExtension = Optional.empty(); + private Optional processedFileExtension = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(DeidentifyFileOutput other) { + public Builder from(ReidentifiedFileOutput other) { processedFile(other.getProcessedFile()); processedFileType(other.getProcessedFileType()); processedFileExtension(other.getProcessedFileExtension()); @@ -115,7 +115,7 @@ public Builder from(DeidentifyFileOutput other) { } /** - *

URL or base64-encoded data of the output.

+ *

File content in Base64 format.

*/ @JsonSetter(value = "processed_file", nulls = Nulls.SKIP) public Builder processedFile(Optional processedFile) { @@ -132,12 +132,12 @@ public Builder processedFile(String processedFile) { *

Type of the processed file.

*/ @JsonSetter(value = "processed_file_type", nulls = Nulls.SKIP) - public Builder processedFileType(Optional processedFileType) { + public Builder processedFileType(Optional processedFileType) { this.processedFileType = processedFileType; return this; } - public Builder processedFileType(DeidentifyFileOutputProcessedFileType processedFileType) { + public Builder processedFileType(String processedFileType) { this.processedFileType = Optional.ofNullable(processedFileType); return this; } @@ -146,18 +146,19 @@ public Builder processedFileType(DeidentifyFileOutputProcessedFileType processed *

Extension of the processed file.

*/ @JsonSetter(value = "processed_file_extension", nulls = Nulls.SKIP) - public Builder processedFileExtension(Optional processedFileExtension) { + public Builder processedFileExtension( + Optional processedFileExtension) { this.processedFileExtension = processedFileExtension; return this; } - public Builder processedFileExtension(String processedFileExtension) { + public Builder processedFileExtension(ReidentifiedFileOutputProcessedFileExtension processedFileExtension) { this.processedFileExtension = Optional.ofNullable(processedFileExtension); return this; } - public DeidentifyFileOutput build() { - return new DeidentifyFileOutput( + public ReidentifiedFileOutput build() { + return new ReidentifiedFileOutput( processedFile, processedFileType, processedFileExtension, additionalProperties); } } diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifiedFileOutputProcessedFileExtension.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifiedFileOutputProcessedFileExtension.java new file mode 100644 index 00000000..73bb0e58 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifiedFileOutputProcessedFileExtension.java @@ -0,0 +1,60 @@ +/** + * 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 ReidentifiedFileOutputProcessedFileExtension { + MP_3("mp3"), + + WAV("wav"), + + PDF("pdf"), + + TXT("txt"), + + CSV("csv"), + + JSON("json"), + + JPG("jpg"), + + JPEG("jpeg"), + + TIF("tif"), + + TIFF("tiff"), + + PNG("png"), + + BMP("bmp"), + + XLS("xls"), + + XLSX("xlsx"), + + DOC("doc"), + + DOCX("docx"), + + PPT("ppt"), + + PPTX("pptx"), + + XML("xml"), + + DCM("dcm"); + + private final String value; + + ReidentifiedFileOutputProcessedFileExtension(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java index 46804db0..54866826 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponse.java @@ -9,28 +9,29 @@ 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 org.jetbrains.annotations.NotNull; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ReidentifyFileResponse.Builder.class) public final class ReidentifyFileResponse { - private final ReidentifyFileResponseStatus status; + private final Optional status; - private final ReidentifyFileResponseOutputType outputType; + private final Optional outputType; - private final ReidentifyFileResponseOutput output; + private final Optional output; private final Map additionalProperties; private ReidentifyFileResponse( - ReidentifyFileResponseStatus status, - ReidentifyFileResponseOutputType outputType, - ReidentifyFileResponseOutput output, + Optional status, + Optional outputType, + Optional output, Map additionalProperties) { this.status = status; this.outputType = outputType; @@ -39,10 +40,10 @@ private ReidentifyFileResponse( } /** - * @return Status of the re-identify operation. + * @return Status of the operation. */ @JsonProperty("status") - public ReidentifyFileResponseStatus getStatus() { + public Optional getStatus() { return status; } @@ -50,12 +51,12 @@ public ReidentifyFileResponseStatus getStatus() { * @return Format of the output file. */ @JsonProperty("output_type") - public ReidentifyFileResponseOutputType getOutputType() { + public Optional getOutputType() { return outputType; } @JsonProperty("output") - public ReidentifyFileResponseOutput getOutput() { + public Optional getOutput() { return output; } @@ -84,48 +85,23 @@ public String toString() { return ObjectMappers.stringify(this); } - public static StatusStage builder() { + public static Builder 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; + public static final class Builder { + private Optional status = Optional.empty(); - private ReidentifyFileResponseOutputType outputType; + private Optional outputType = Optional.empty(); - private ReidentifyFileResponseOutput output; + private Optional output = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ReidentifyFileResponse other) { status(other.getStatus()); outputType(other.getOutputType()); @@ -134,35 +110,44 @@ public Builder from(ReidentifyFileResponse other) { } /** - * 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. + *

Status of the operation.

*/ - @java.lang.Override - @JsonSetter("status") - public OutputTypeStage status(@NotNull ReidentifyFileResponseStatus status) { - this.status = Objects.requireNonNull(status, "status must not be null"); + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ReidentifyFileResponseStatus status) { + this.status = Optional.ofNullable(status); 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. + *

Format of the output file.

*/ - @java.lang.Override - @JsonSetter("output_type") - public OutputStage outputType(@NotNull ReidentifyFileResponseOutputType outputType) { - this.outputType = Objects.requireNonNull(outputType, "outputType must not be null"); + @JsonSetter(value = "output_type", nulls = Nulls.SKIP) + public Builder outputType(Optional outputType) { + this.outputType = outputType; + return this; + } + + public Builder outputType(ReidentifyFileResponseOutputType outputType) { + this.outputType = Optional.ofNullable(outputType); + return this; + } + + @JsonSetter(value = "output", nulls = Nulls.SKIP) + public Builder output(Optional output) { + this.output = output; return this; } - @java.lang.Override - @JsonSetter("output") - public _FinalStage output(@NotNull ReidentifyFileResponseOutput output) { - this.output = Objects.requireNonNull(output, "output must not be null"); + public Builder output(ReidentifiedFileOutput output) { + this.output = Optional.ofNullable(output); return this; } - @java.lang.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 deleted file mode 100644 index 266a9475..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutput.java +++ /dev/null @@ -1,154 +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 = ReidentifyFileResponseOutput.Builder.class) -public final class ReidentifyFileResponseOutput { - private final String processedFile; - - private final String processedFileExtension; - - private final Map additionalProperties; - - private ReidentifyFileResponseOutput( - String processedFile, String processedFileExtension, Map additionalProperties) { - this.processedFile = processedFile; - this.processedFileExtension = processedFileExtension; - this.additionalProperties = additionalProperties; - } - - /** - * @return Re-identified file content in base64 format. - */ - @JsonProperty("processed_file") - public String getProcessedFile() { - return processedFile; - } - - /** - * @return Type of the processed file. - */ - @JsonProperty("processed_file_type") - public String getProcessedFileType() { - return "reidentified_file"; - } - - /** - * @return Extension of the processed file. - */ - @JsonProperty("processed_file_extension") - public String getProcessedFileExtension() { - return processedFileExtension; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ReidentifyFileResponseOutput && equalTo((ReidentifyFileResponseOutput) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ReidentifyFileResponseOutput other) { - return processedFile.equals(other.processedFile) && processedFileExtension.equals(other.processedFileExtension); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.processedFile, this.processedFileExtension); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ProcessedFileStage builder() { - return new Builder(); - } - - public interface ProcessedFileStage { - /** - * Re-identified file content in base64 format. - */ - ProcessedFileExtensionStage processedFile(@NotNull String processedFile); - - Builder from(ReidentifyFileResponseOutput other); - } - - public interface ProcessedFileExtensionStage { - /** - * Extension of the processed file. - */ - _FinalStage processedFileExtension(@NotNull String processedFileExtension); - } - - public interface _FinalStage { - ReidentifyFileResponseOutput build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ProcessedFileStage, ProcessedFileExtensionStage, _FinalStage { - private String processedFile; - - private String processedFileExtension; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ReidentifyFileResponseOutput other) { - processedFile(other.getProcessedFile()); - processedFileExtension(other.getProcessedFileExtension()); - return this; - } - - /** - * Re-identified file content in base64 format.

Re-identified file content in base64 format.

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

Extension of the processed file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("processed_file_extension") - public _FinalStage processedFileExtension(@NotNull String processedFileExtension) { - this.processedFileExtension = - Objects.requireNonNull(processedFileExtension, "processedFileExtension must not be null"); - return this; - } - - @java.lang.Override - public ReidentifyFileResponseOutput build() { - return new ReidentifyFileResponseOutput(processedFile, processedFileExtension, additionalProperties); - } - } -} diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java index 167cb387..a47b1ea3 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseOutputType.java @@ -6,9 +6,9 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum ReidentifyFileResponseOutputType { - BASE_64("BASE64"), + UNKNOWN("UNKNOWN"), - UNKNOWN("UNKNOWN"); + BASE_64("BASE64"); private final String value; diff --git a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java index 7b56adcf..e4cbac24 100644 --- a/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java +++ b/src/main/java/com/skyflow/generated/rest/types/ReidentifyFileResponseStatus.java @@ -6,13 +6,13 @@ import com.fasterxml.jackson.annotation.JsonValue; public enum ReidentifyFileResponseStatus { - FAILED("FAILED"), + UNKNOWN("UNKNOWN"), - IN_PROGRESS("IN_PROGRESS"), + FAILED("FAILED"), SUCCESS("SUCCESS"), - UNKNOWN("UNKNOWN"); + IN_PROGRESS("IN_PROGRESS"); private final String value; diff --git a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java b/src/main/java/com/skyflow/generated/rest/types/ShiftDates.java similarity index 75% rename from src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java rename to src/main/java/com/skyflow/generated/rest/types/ShiftDates.java index 1e11938b..afdb073d 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDates.java +++ b/src/main/java/com/skyflow/generated/rest/types/ShiftDates.java @@ -19,35 +19,27 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TransformationsShiftDates.Builder.class) -public final class TransformationsShiftDates { - private final Optional maxDays; - +@JsonDeserialize(builder = ShiftDates.Builder.class) +public final class ShiftDates { private final Optional minDays; - private final Optional> entityTypes; + private final Optional maxDays; + + private final Optional> entityTypes; private final Map additionalProperties; - private TransformationsShiftDates( - Optional maxDays, + private ShiftDates( Optional minDays, - Optional> entityTypes, + Optional maxDays, + Optional> entityTypes, Map additionalProperties) { - this.maxDays = maxDays; this.minDays = minDays; + this.maxDays = maxDays; this.entityTypes = entityTypes; this.additionalProperties = additionalProperties; } - /** - * @return Maximum number of days to shift the date by. - */ - @JsonProperty("max_days") - public Optional getMaxDays() { - return maxDays; - } - /** * @return Minimum number of days to shift the date by. */ @@ -56,18 +48,26 @@ public Optional getMinDays() { return minDays; } + /** + * @return Maximum number of days to shift the date by. + */ + @JsonProperty("max_days") + public Optional getMaxDays() { + return maxDays; + } + /** * @return Entity types to shift dates for. */ @JsonProperty("entity_types") - public Optional> getEntityTypes() { + public Optional> getEntityTypes() { return entityTypes; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TransformationsShiftDates && equalTo((TransformationsShiftDates) other); + return other instanceof ShiftDates && equalTo((ShiftDates) other); } @JsonAnyGetter @@ -75,13 +75,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TransformationsShiftDates other) { - return maxDays.equals(other.maxDays) && minDays.equals(other.minDays) && entityTypes.equals(other.entityTypes); + private boolean equalTo(ShiftDates other) { + return minDays.equals(other.minDays) && maxDays.equals(other.maxDays) && entityTypes.equals(other.entityTypes); } @java.lang.Override public int hashCode() { - return Objects.hash(this.maxDays, this.minDays, this.entityTypes); + return Objects.hash(this.minDays, this.maxDays, this.entityTypes); } @java.lang.Override @@ -95,49 +95,49 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional maxDays = Optional.empty(); - private Optional minDays = Optional.empty(); - private Optional> entityTypes = Optional.empty(); + private Optional maxDays = Optional.empty(); + + private Optional> entityTypes = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(TransformationsShiftDates other) { - maxDays(other.getMaxDays()); + public Builder from(ShiftDates other) { minDays(other.getMinDays()); + maxDays(other.getMaxDays()); entityTypes(other.getEntityTypes()); return this; } /** - *

Maximum number of days to shift the date by.

+ *

Minimum number of days to shift the date by.

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

Minimum number of days to shift the date by.

+ *

Maximum number of days to shift the date by.

*/ - @JsonSetter(value = "min_days", nulls = Nulls.SKIP) - public Builder minDays(Optional minDays) { - this.minDays = minDays; + @JsonSetter(value = "max_days", nulls = Nulls.SKIP) + public Builder maxDays(Optional maxDays) { + this.maxDays = maxDays; return this; } - public Builder minDays(Integer minDays) { - this.minDays = Optional.ofNullable(minDays); + public Builder maxDays(Integer maxDays) { + this.maxDays = Optional.ofNullable(maxDays); return this; } @@ -145,18 +145,18 @@ public Builder minDays(Integer minDays) { *

Entity types to shift dates for.

*/ @JsonSetter(value = "entity_types", nulls = Nulls.SKIP) - public Builder entityTypes(Optional> entityTypes) { + public Builder entityTypes(Optional> entityTypes) { this.entityTypes = entityTypes; return this; } - public Builder entityTypes(List entityTypes) { + public Builder entityTypes(List entityTypes) { this.entityTypes = Optional.ofNullable(entityTypes); return this; } - public TransformationsShiftDates build() { - return new TransformationsShiftDates(maxDays, minDays, entityTypes, additionalProperties); + public ShiftDates build() { + return new ShiftDates(minDays, maxDays, entityTypes, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java b/src/main/java/com/skyflow/generated/rest/types/ShiftDatesEntityTypesItem.java similarity index 78% rename from src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java rename to src/main/java/com/skyflow/generated/rest/types/ShiftDatesEntityTypesItem.java index 148cea23..fad29e10 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TransformationsShiftDatesEntityTypesItem.java +++ b/src/main/java/com/skyflow/generated/rest/types/ShiftDatesEntityTypesItem.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum TransformationsShiftDatesEntityTypesItem { +public enum ShiftDatesEntityTypesItem { DATE("date"), DATE_INTERVAL("date_interval"), @@ -14,7 +14,7 @@ public enum TransformationsShiftDatesEntityTypesItem { private final String value; - TransformationsShiftDatesEntityTypesItem(String value) { + ShiftDatesEntityTypesItem(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/DetectedEntity.java b/src/main/java/com/skyflow/generated/rest/types/StringResponseEntities.java similarity index 85% rename from src/main/java/com/skyflow/generated/rest/types/DetectedEntity.java rename to src/main/java/com/skyflow/generated/rest/types/StringResponseEntities.java index 6de2200a..da3e7f5e 100644 --- a/src/main/java/com/skyflow/generated/rest/types/DetectedEntity.java +++ b/src/main/java/com/skyflow/generated/rest/types/StringResponseEntities.java @@ -18,13 +18,13 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DetectedEntity.Builder.class) -public final class DetectedEntity { +@JsonDeserialize(builder = StringResponseEntities.Builder.class) +public final class StringResponseEntities { private final Optional token; private final Optional value; - private final Optional location; + private final Optional location; private final Optional entityType; @@ -32,10 +32,10 @@ public final class DetectedEntity { private final Map additionalProperties; - private DetectedEntity( + private StringResponseEntities( Optional token, Optional value, - Optional location, + Optional location, Optional entityType, Optional> entityScores, Map additionalProperties) { @@ -64,7 +64,7 @@ public Optional getValue() { } @JsonProperty("location") - public Optional getLocation() { + public Optional getLocation() { return location; } @@ -77,7 +77,7 @@ public Optional getEntityType() { } /** - * @return entity_scores and their scores. + * @return Labels and their scores. */ @JsonProperty("entity_scores") public Optional> getEntityScores() { @@ -87,7 +87,7 @@ public Optional> getEntityScores() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DetectedEntity && equalTo((DetectedEntity) other); + return other instanceof StringResponseEntities && equalTo((StringResponseEntities) other); } @JsonAnyGetter @@ -95,7 +95,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DetectedEntity other) { + private boolean equalTo(StringResponseEntities other) { return token.equals(other.token) && value.equals(other.value) && location.equals(other.location) @@ -123,7 +123,7 @@ public static final class Builder { private Optional value = Optional.empty(); - private Optional location = Optional.empty(); + private Optional location = Optional.empty(); private Optional entityType = Optional.empty(); @@ -134,7 +134,7 @@ public static final class Builder { private Builder() {} - public Builder from(DetectedEntity other) { + public Builder from(StringResponseEntities other) { token(other.getToken()); value(other.getValue()); location(other.getLocation()); @@ -172,12 +172,12 @@ public Builder value(String value) { } @JsonSetter(value = "location", nulls = Nulls.SKIP) - public Builder location(Optional location) { + public Builder location(Optional location) { this.location = location; return this; } - public Builder location(EntityLocation location) { + public Builder location(Locations location) { this.location = Optional.ofNullable(location); return this; } @@ -197,7 +197,7 @@ public Builder entityType(String entityType) { } /** - *

entity_scores and their scores.

+ *

Labels and their scores.

*/ @JsonSetter(value = "entity_scores", nulls = Nulls.SKIP) public Builder entityScores(Optional> entityScores) { @@ -210,8 +210,8 @@ public Builder entityScores(Map entityScores) { return this; } - public DetectedEntity build() { - return new DetectedEntity(token, value, location, entityType, entityScores, additionalProperties); + public StringResponseEntities build() { + return new StringResponseEntities(token, value, location, entityType, entityScores, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenType.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMapping.java similarity index 57% rename from src/main/java/com/skyflow/generated/rest/types/TokenType.java rename to src/main/java/com/skyflow/generated/rest/types/TokenTypeMapping.java index a50e861b..dfdf71be 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenType.java +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMapping.java @@ -19,64 +19,67 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TokenType.Builder.class) -public final class TokenType { - private final Optional default_; +@JsonDeserialize(builder = TokenTypeMapping.Builder.class) +public final class TokenTypeMapping { + private final Optional> vaultToken; - private final Optional> vaultToken; + private final Optional> entityOnly; - private final Optional> entityUnqCounter; + private final Optional> entityUnqCounter; - private final Optional> entityOnly; + private final Optional default_; private final Map additionalProperties; - private TokenType( - Optional default_, - Optional> vaultToken, - Optional> entityUnqCounter, - Optional> entityOnly, + private TokenTypeMapping( + Optional> vaultToken, + Optional> entityOnly, + Optional> entityUnqCounter, + Optional default_, Map additionalProperties) { - this.default_ = default_; this.vaultToken = vaultToken; - this.entityUnqCounter = entityUnqCounter; this.entityOnly = entityOnly; + this.entityUnqCounter = entityUnqCounter; + this.default_ = default_; this.additionalProperties = additionalProperties; } - @JsonProperty("default") - public Optional getDefault() { - return default_; - } - /** * @return Entity types to replace with vault tokens. */ @JsonProperty("vault_token") - public Optional> getVaultToken() { + public Optional> getVaultToken() { return vaultToken; } + /** + * @return Entity types to replace with entity tokens. + */ + @JsonProperty("entity_only") + public Optional> getEntityOnly() { + return entityOnly; + } + /** * @return Entity types to replace with entity tokens with unique counters. */ @JsonProperty("entity_unq_counter") - public Optional> getEntityUnqCounter() { + public Optional> getEntityUnqCounter() { return entityUnqCounter; } /** - * @return Entity types to replace with entity tokens. + * @return Default token type to generate for detected entities. */ - @JsonProperty("entity_only") - public Optional> getEntityOnly() { - return entityOnly; + @JsonProperty("default") + public Optional getDefault() { + return default_; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TokenType && equalTo((TokenType) other); + return other instanceof TokenTypeMapping && equalTo((TokenTypeMapping) other); } @JsonAnyGetter @@ -84,16 +87,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TokenType other) { - return default_.equals(other.default_) - && vaultToken.equals(other.vaultToken) + private boolean equalTo(TokenTypeMapping other) { + return vaultToken.equals(other.vaultToken) + && entityOnly.equals(other.entityOnly) && entityUnqCounter.equals(other.entityUnqCounter) - && entityOnly.equals(other.entityOnly); + && default_.equals(other.default_); } @java.lang.Override public int hashCode() { - return Objects.hash(this.default_, this.vaultToken, this.entityUnqCounter, this.entityOnly); + return Objects.hash(this.vaultToken, this.entityOnly, this.entityUnqCounter, this.default_); } @java.lang.Override @@ -107,49 +110,52 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional default_ = Optional.empty(); + private Optional> vaultToken = Optional.empty(); - private Optional> vaultToken = Optional.empty(); + private Optional> entityOnly = Optional.empty(); - private Optional> entityUnqCounter = Optional.empty(); + private Optional> entityUnqCounter = Optional.empty(); - private Optional> entityOnly = Optional.empty(); + private Optional default_ = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(TokenType other) { - default_(other.getDefault()); + public Builder from(TokenTypeMapping other) { vaultToken(other.getVaultToken()); - entityUnqCounter(other.getEntityUnqCounter()); entityOnly(other.getEntityOnly()); + entityUnqCounter(other.getEntityUnqCounter()); + default_(other.getDefault()); return this; } - @JsonSetter(value = "default", nulls = Nulls.SKIP) - public Builder default_(Optional default_) { - this.default_ = default_; + /** + *

Entity types to replace with vault tokens.

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

Entity types to replace with vault tokens.

+ *

Entity types to replace with entity tokens.

*/ - @JsonSetter(value = "vault_token", nulls = Nulls.SKIP) - public Builder vaultToken(Optional> vaultToken) { - this.vaultToken = vaultToken; + @JsonSetter(value = "entity_only", nulls = Nulls.SKIP) + public Builder entityOnly(Optional> entityOnly) { + this.entityOnly = entityOnly; return this; } - public Builder vaultToken(List vaultToken) { - this.vaultToken = Optional.ofNullable(vaultToken); + public Builder entityOnly(List entityOnly) { + this.entityOnly = Optional.ofNullable(entityOnly); return this; } @@ -157,32 +163,32 @@ public Builder vaultToken(List vaultToken) { *

Entity types to replace with entity tokens with unique counters.

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

Entity types to replace with entity tokens.

+ *

Default token type to generate for detected entities.

*/ - @JsonSetter(value = "entity_only", nulls = Nulls.SKIP) - public Builder entityOnly(Optional> entityOnly) { - this.entityOnly = entityOnly; + @JsonSetter(value = "default", nulls = Nulls.SKIP) + public Builder default_(Optional default_) { + this.default_ = default_; return this; } - public Builder entityOnly(List entityOnly) { - this.entityOnly = Optional.ofNullable(entityOnly); + public Builder default_(TokenTypeMappingDefault default_) { + this.default_ = Optional.ofNullable(default_); return this; } - public TokenType build() { - return new TokenType(default_, vaultToken, entityUnqCounter, entityOnly, additionalProperties); + public TokenTypeMapping build() { + return new TokenTypeMapping(vaultToken, entityOnly, entityUnqCounter, default_, additionalProperties); } } } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingDefault.java similarity index 84% rename from src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java rename to src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingDefault.java index 14ab8f0f..ee9075da 100644 --- a/src/main/java/com/skyflow/generated/rest/types/TokenTypeDefault.java +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingDefault.java @@ -5,16 +5,16 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum TokenTypeDefault { - ENTITY_ONLY("entity_only"), - +public enum TokenTypeMappingDefault { ENTITY_UNQ_COUNTER("entity_unq_counter"), + ENTITY_ONLY("entity_only"), + VAULT_TOKEN("vault_token"); private final String value; - TokenTypeDefault(String value) { + TokenTypeMappingDefault(String value) { this.value = value; } diff --git a/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingEntityOnlyItem.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingEntityOnlyItem.java new file mode 100644 index 00000000..409784f7 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingEntityOnlyItem.java @@ -0,0 +1,160 @@ +/** + * 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 TokenTypeMappingEntityOnlyItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + TokenTypeMappingEntityOnlyItem(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/TokenTypeMappingEntityUnqCounterItem.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingEntityUnqCounterItem.java new file mode 100644 index 00000000..21623aa0 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingEntityUnqCounterItem.java @@ -0,0 +1,160 @@ +/** + * 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 TokenTypeMappingEntityUnqCounterItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + TokenTypeMappingEntityUnqCounterItem(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/TokenTypeMappingVaultTokenItem.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingVaultTokenItem.java new file mode 100644 index 00000000..da575473 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/TokenTypeMappingVaultTokenItem.java @@ -0,0 +1,160 @@ +/** + * 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 TokenTypeMappingVaultTokenItem { + 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("gender"), + + 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"), + + SEXUALITY("sexuality"), + + EFFECT("effect"), + + PROJECT("project"), + + ORGANIZATION_ID("organization_id"), + + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private final String value; + + TokenTypeMappingVaultTokenItem(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/TokenTypeWithoutVault.java b/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVault.java deleted file mode 100644 index 5f5938a0..00000000 --- a/src/main/java/com/skyflow/generated/rest/types/TokenTypeWithoutVault.java +++ /dev/null @@ -1,158 +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 = TokenTypeWithoutVault.Builder.class) -public final class TokenTypeWithoutVault { - private final Optional default_; - - private final Optional> entityUnqCounter; - - private final Optional> entityOnly; - - private final Map additionalProperties; - - private TokenTypeWithoutVault( - Optional default_, - Optional> entityUnqCounter, - Optional> entityOnly, - Map additionalProperties) { - this.default_ = default_; - this.entityUnqCounter = entityUnqCounter; - this.entityOnly = entityOnly; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("default") - public Optional getDefault() { - return default_; - } - - /** - * @return Entity types to replace with entity tokens with unique counters. - */ - @JsonProperty("entity_unq_counter") - public Optional> getEntityUnqCounter() { - return entityUnqCounter; - } - - /** - * @return Entity types to replace with entity tokens. - */ - @JsonProperty("entity_only") - public Optional> getEntityOnly() { - return entityOnly; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TokenTypeWithoutVault && equalTo((TokenTypeWithoutVault) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TokenTypeWithoutVault other) { - return default_.equals(other.default_) - && entityUnqCounter.equals(other.entityUnqCounter) - && entityOnly.equals(other.entityOnly); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.default_, this.entityUnqCounter, this.entityOnly); - } - - @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 default_ = Optional.empty(); - - private Optional> entityUnqCounter = Optional.empty(); - - private Optional> entityOnly = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TokenTypeWithoutVault other) { - default_(other.getDefault()); - entityUnqCounter(other.getEntityUnqCounter()); - entityOnly(other.getEntityOnly()); - return this; - } - - @JsonSetter(value = "default", nulls = Nulls.SKIP) - public Builder default_(Optional default_) { - this.default_ = default_; - return this; - } - - public Builder default_(TokenTypeWithoutVaultDefault default_) { - this.default_ = Optional.ofNullable(default_); - return this; - } - - /** - *

Entity types to replace with entity tokens with unique counters.

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

Entity types to replace with entity tokens.

- */ - @JsonSetter(value = "entity_only", nulls = Nulls.SKIP) - public Builder entityOnly(Optional> entityOnly) { - this.entityOnly = entityOnly; - return this; - } - - public Builder entityOnly(List entityOnly) { - this.entityOnly = Optional.ofNullable(entityOnly); - return this; - } - - public TokenTypeWithoutVault build() { - return new TokenTypeWithoutVault(default_, entityUnqCounter, entityOnly, additionalProperties); - } - } -} 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..37de75ff 100644 --- a/src/main/java/com/skyflow/generated/rest/types/Transformations.java +++ b/src/main/java/com/skyflow/generated/rest/types/Transformations.java @@ -20,20 +20,17 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Transformations.Builder.class) public final class Transformations { - private final Optional shiftDates; + private final Optional shiftDates; private final Map additionalProperties; - private Transformations(Optional shiftDates, Map additionalProperties) { + private Transformations(Optional shiftDates, Map additionalProperties) { this.shiftDates = shiftDates; this.additionalProperties = additionalProperties; } - /** - * @return Shift dates by a specified number of days. - */ @JsonProperty("shift_dates") - public Optional getShiftDates() { + public Optional getShiftDates() { return shiftDates; } @@ -68,7 +65,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional shiftDates = Optional.empty(); + private Optional shiftDates = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -80,16 +77,13 @@ public Builder from(Transformations other) { return this; } - /** - *

Shift dates by a specified number of days.

- */ @JsonSetter(value = "shift_dates", nulls = Nulls.SKIP) - public Builder shiftDates(Optional shiftDates) { + public Builder shiftDates(Optional shiftDates) { this.shiftDates = shiftDates; return this; } - public Builder shiftDates(TransformationsShiftDates shiftDates) { + public Builder shiftDates(ShiftDates shiftDates) { this.shiftDates = Optional.ofNullable(shiftDates); return this; } diff --git a/src/main/java/com/skyflow/generated/rest/types/WordCharacterCount.java b/src/main/java/com/skyflow/generated/rest/types/WordCharacterCount.java new file mode 100644 index 00000000..d2757ff9 --- /dev/null +++ b/src/main/java/com/skyflow/generated/rest/types/WordCharacterCount.java @@ -0,0 +1,130 @@ +/** + * 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 = WordCharacterCount.Builder.class) +public final class WordCharacterCount { + private final Optional wordCount; + + private final Optional characterCount; + + private final Map additionalProperties; + + private WordCharacterCount( + Optional wordCount, Optional characterCount, Map additionalProperties) { + this.wordCount = wordCount; + this.characterCount = characterCount; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of words in the processed text. + */ + @JsonProperty("wordCount") + public Optional getWordCount() { + return wordCount; + } + + /** + * @return Number of characters in the processed text. + */ + @JsonProperty("characterCount") + public Optional getCharacterCount() { + return characterCount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WordCharacterCount && equalTo((WordCharacterCount) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WordCharacterCount other) { + return wordCount.equals(other.wordCount) && characterCount.equals(other.characterCount); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.wordCount, this.characterCount); + } + + @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 wordCount = Optional.empty(); + + private Optional characterCount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(WordCharacterCount other) { + wordCount(other.getWordCount()); + characterCount(other.getCharacterCount()); + return this; + } + + /** + *

Number of words in the processed text.

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

Number of characters in the processed text.

+ */ + @JsonSetter(value = "characterCount", nulls = Nulls.SKIP) + public Builder characterCount(Optional characterCount) { + this.characterCount = characterCount; + return this; + } + + public Builder characterCount(Integer characterCount) { + this.characterCount = Optional.ofNullable(characterCount); + return this; + } + + public WordCharacterCount build() { + return new WordCharacterCount(wordCount, characterCount, additionalProperties); + } + } +} diff --git a/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java b/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java index 23d09ab8..eff0bb17 100644 --- a/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java +++ b/src/main/java/com/skyflow/serviceaccount/util/BearerToken.java @@ -16,7 +16,6 @@ import com.skyflow.utils.Utils; import com.skyflow.utils.logger.LogUtil; import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureAlgorithm; import java.io.File; import java.io.FileNotFoundException; @@ -155,8 +154,8 @@ private static String getSignedToken( .claim("aud", tokenURI) .claim("sub", clientID) .claim("ctx", context) - .setExpiration(expirationDate) - .signWith(SignatureAlgorithm.RS256, pvtKey) + .expiration(expirationDate) + .signWith(pvtKey, Jwts.SIG.RS256) .compact(); } diff --git a/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java b/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java index ecdfa89f..70a5a330 100644 --- a/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java +++ b/src/main/java/com/skyflow/serviceaccount/util/SignedDataTokens.java @@ -12,7 +12,6 @@ import com.skyflow.utils.Utils; import com.skyflow.utils.logger.LogUtil; import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureAlgorithm; import java.io.File; import java.io.FileNotFoundException; @@ -143,8 +142,8 @@ private static List getSignedToken( .claim("sub", clientID) .claim("ctx", context) .claim("tok", dataToken) - .setExpiration(expirationDate) - .signWith(SignatureAlgorithm.RS256, pvtKey) + .expiration(expirationDate) + .signWith(pvtKey, Jwts.SIG.RS256) .compact(); SignedDataTokenResponse responseObject = new SignedDataTokenResponse(dataToken, eachSignedDataToken); list.add(responseObject); diff --git a/src/main/java/com/skyflow/utils/Constants.java b/src/main/java/com/skyflow/utils/Constants.java index f12e6a48..6af03281 100644 --- a/src/main/java/com/skyflow/utils/Constants.java +++ b/src/main/java/com/skyflow/utils/Constants.java @@ -1,5 +1,9 @@ package com.skyflow.utils; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + public final class Constants { public static final String SECURE_PROTOCOL = "https://"; public static final String DEV_DOMAIN = ".vault.skyflowapis.dev"; @@ -13,9 +17,10 @@ public final class Constants { public static final String ORDER_ASCENDING = "ASCENDING"; public static final String API_KEY_REGEX = "^sky-[a-zA-Z0-9]{5}-[a-fA-F0-9]{32}$"; public static final String ENV_CREDENTIALS_KEY_NAME = "SKYFLOW_CREDENTIALS"; - public static final String SDK_NAME = "Skyflow Java SDK "; - public static final String SDK_VERSION = "v2"; - public static final String SDK_PREFIX = SDK_NAME + SDK_VERSION; + public static final String SDK_NAME = "Skyflow Java SDK"; + public static final String DEFAULT_SDK_VERSION = "v2"; + public static final String SDK_VERSION; + public static final String SDK_PREFIX; public static final String SDK_METRIC_NAME_VERSION = "sdk_name_version"; public static final String SDK_METRIC_NAME_VERSION_PREFIX = "skyflow-java@"; public static final String SDK_METRIC_CLIENT_DEVICE_MODEL = "sdk_client_device_model"; @@ -28,4 +33,22 @@ public final class Constants { public static final String PROCESSED_FILE_NAME_PREFIX = "processed-"; public static final String ERROR_FROM_CLIENT_HEADER_KEY = "error-from-client"; public static final String DEIDENTIFIED_FILE_PREFIX = "deidentified"; + + static { + String sdkVersion; + // Use a static initializer block to read the properties file + Properties properties = new Properties(); + try (InputStream input = Constants.class.getClassLoader().getResourceAsStream("sdk.properties")) { + if (input == null) { + sdkVersion = DEFAULT_SDK_VERSION; + } else { + properties.load(input); + sdkVersion = properties.getProperty("sdk.version", DEFAULT_SDK_VERSION); + } + } catch (IOException ex) { + sdkVersion = DEFAULT_SDK_VERSION; + } + SDK_VERSION = sdkVersion; + SDK_PREFIX = SDK_NAME + " " + SDK_VERSION; + } } diff --git a/src/main/java/com/skyflow/vault/controller/DetectController.java b/src/main/java/com/skyflow/vault/controller/DetectController.java index c92e6b2c..d95bbd6e 100644 --- a/src/main/java/com/skyflow/vault/controller/DetectController.java +++ b/src/main/java/com/skyflow/vault/controller/DetectController.java @@ -9,14 +9,15 @@ import com.skyflow.errors.ErrorMessage; import com.skyflow.errors.SkyflowException; import com.skyflow.generated.rest.core.ApiClientApiException; +import com.skyflow.generated.rest.core.RequestOptions; 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; import com.skyflow.utils.Constants; +import com.skyflow.utils.Utils; import com.skyflow.utils.logger.LogUtil; import com.skyflow.utils.validations.Validations; import com.skyflow.vault.detect.*; @@ -34,6 +35,7 @@ public final class DetectController extends VaultClient { src.map(context::serialize).orElse(null)) .serializeNulls() .create(); + private static final JsonObject skyMetadata = Utils.getMetrics(); public DetectController(VaultConfig vaultConfig, Credentials credentials) { super(vaultConfig, credentials); @@ -53,8 +55,9 @@ public DeidentifyTextResponse deidentifyText(DeidentifyTextRequest deidentifyTex String vaultId = super.getVaultConfig().getVaultId(); DeidentifyStringRequest request = getDeidentifyStringRequest(deidentifyTextRequest, vaultId); - // Call the API to de-identify the string - deidentifyStringResponse = super.getDetectTextApi().deidentifyString(request); + // get SDK metrics and call the API to de-identify the string + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); + deidentifyStringResponse = super.getDetectTextApi().deidentifyString(request, requestOptions); // Parse the response to DeIdentifyTextResponse deidentifyTextResponse = getDeIdentifyTextResponse(deidentifyStringResponse); @@ -80,11 +83,12 @@ public ReidentifyTextResponse reidentifyText(ReidentifyTextRequest reidentifyTex String vaultId = super.getVaultConfig().getVaultId(); ReidentifyStringRequest request = getReidentifyStringRequest(reidentifyTextRequest, vaultId); - // Call the API to re-identify the string - ReidentifyStringResponse reidentifyStringResponse = super.getDetectTextApi().reidentifyString(request); + // Get SDK metrics and call the API to re-identify the string + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); + IdentifyResponse reidentifyStringResponse = super.getDetectTextApi().reidentifyString(request, requestOptions); // Parse the response to ReidentifyTextResponse - reidentifyTextResponse = new ReidentifyTextResponse(reidentifyStringResponse.getText().orElse(null)); + reidentifyTextResponse = new ReidentifyTextResponse(reidentifyStringResponse.getText()); LogUtil.printInfoLog(InfoLogs.REIDENTIFY_TEXT_REQUEST_RESOLVED.getLog()); } catch (ApiClientApiException ex) { String bodyString = extractBodyAsString(ex); @@ -124,7 +128,7 @@ public DeidentifyFileResponse deidentifyFile(DeidentifyFileRequest request) thro com.skyflow.generated.rest.types.DeidentifyFileResponse apiResponse = processFileByType(fileExtension, base64Content, request, vaultId); try { - response = pollForResults(apiResponse.getRunId(), request.getWaitTime()); + response = pollForResults(apiResponse.getRunId().get(), request.getWaitTime()); } catch (Exception ex) { throw new SkyflowException(ErrorCode.SERVER_ERROR.getCode(), ErrorMessage.PollingForResultsFailed.getMessage()); } @@ -135,7 +139,7 @@ public DeidentifyFileResponse deidentifyFile(DeidentifyFileRequest request) thro if (base64File != null) { byte[] decodedBytes = Base64.getDecoder().decode(base64File); String outputDir = request.getOutputDirectory(); - String outputFileName = Constants.PROCESSED_FILE_NAME_PREFIX + fileName.substring(0, fileName.lastIndexOf('.')) + "."+response.getExtension(); + 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); @@ -157,7 +161,7 @@ public DeidentifyFileResponse deidentifyFile(DeidentifyFileRequest request) thro 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"; + 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); @@ -193,17 +197,19 @@ private DeidentifyFileResponse pollForResults(String runId, Integer maxWaitTime) int currentWaitTime = 1; maxWaitTime = maxWaitTime == null ? 64 : maxWaitTime; - DeidentifyStatusResponse response = null; + DetectRunsResponse response = null; while (true) { try { GetRunRequest getRunRequest = GetRunRequest.builder() .vaultId(super.getVaultConfig().getVaultId()) .build(); + + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); response = super.getDetectFileAPi() - .getRun(runId, getRunRequest); + .getRun(runId, getRunRequest, requestOptions); - DeidentifyStatusResponseStatus status = response.getStatus(); + DetectRunsResponseStatus status = response.getStatus().get(); if (DeidentifyFileStatus.IN_PROGRESS.value().equalsIgnoreCase(String.valueOf(status))) { if (currentWaitTime >= maxWaitTime) { @@ -223,8 +229,8 @@ private DeidentifyFileResponse pollForResults(String runId, Integer maxWaitTime) Thread.sleep(waitTime * 1000); - } else if (status == DeidentifyStatusResponseStatus.SUCCESS || - status == DeidentifyStatusResponseStatus.FAILED) { + } else if (status == DetectRunsResponseStatus.SUCCESS || + status == DetectRunsResponseStatus.FAILED) { return parseDeidentifyFileResponse(response, runId, status.toString()); } } catch (ApiClientApiException e) { @@ -236,48 +242,43 @@ private DeidentifyFileResponse pollForResults(String runId, Integer maxWaitTime) } - private static synchronized DeidentifyFileResponse parseDeidentifyFileResponse(DeidentifyStatusResponse response, + private static synchronized DeidentifyFileResponse parseDeidentifyFileResponse(DetectRunsResponse response, String runId, String status) throws SkyflowException { - DeidentifyFileOutput firstOutput = getFirstOutput(response); + + DeidentifiedFileOutput firstOutput = getFirstOutput(response); if (firstOutput == null) { return new DeidentifyFileResponse( null, null, - response.getOutputType().name(), + response.getOutputType().get().toString(), null, null, null, - response.getSize().orElse(null), - response.getDuration().orElse(null), + response.getSize().get(), + response.getDuration().get(), response.getPages().orElse(null), response.getSlides().orElse(null), getEntities(response), runId, - response.getStatus().name() + response.getStatus().get().name() ); } - Object wordCharObj = response.getAdditionalProperties().get("word_character_count"); Integer wordCount = null; Integer charCount = null; - if (wordCharObj instanceof Map) { - Map wordCharMap = (Map) wordCharObj; - Object wc = wordCharMap.get("word_count"); - Object cc = wordCharMap.get("character_count"); - if (wc instanceof Number) { - wordCount = ((Number) wc).intValue(); - } - if (cc instanceof Number) { - charCount = ((Number) cc).intValue(); - } + WordCharacterCount wordCharacterCount = response.getWordCharacterCount().orElse(null); + if (wordCharacterCount != null) { + wordCount = wordCharacterCount.getWordCount().orElse(null); + charCount = wordCharacterCount.getCharacterCount().orElse(null); } File processedFileObject = null; FileInfo fileInfo = null; - Optional processedFileBase64 = Optional.of(firstOutput).flatMap(DeidentifyFileOutput::getProcessedFile); - Optional processedFileExtension = Optional.of(firstOutput).flatMap(DeidentifyFileOutput::getProcessedFileExtension); + Optional processedFileBase64 = Optional.of(firstOutput).flatMap(DeidentifiedFileOutput::getProcessedFile); + Optional + processedFileExtension = Optional.of(firstOutput).flatMap(DeidentifiedFileOutput::getProcessedFileExtension); if (processedFileBase64.isPresent() && processedFileExtension.isPresent()) { try { byte[] decodedBytes = Base64.getDecoder().decode(processedFileBase64.get()); @@ -294,38 +295,40 @@ 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()); + .orElse(DetectRunsResponseStatus.UNKNOWN.toString()); - return new DeidentifyFileResponse( + String fileExtension = firstOutput.getProcessedFileExtension().get().toString(); + Float sizeInKb = response.getSize().orElse(null); + Float durationInSeconds = response.getDuration().orElse(null); + DeidentifyFileResponse deidentifyFileResponse = new DeidentifyFileResponse( fileInfo, firstOutput.getProcessedFile().orElse(null), processedFileType, fileExtension, wordCount, charCount, - response.getSize().orElse(null), - response.getDuration().orElse(null), + sizeInKb, + durationInSeconds, response.getPages().orElse(null), response.getSlides().orElse(null), getEntities(response), runId, status ); + + return deidentifyFileResponse; } - private static synchronized DeidentifyFileOutput getFirstOutput(DeidentifyStatusResponse response) { - List outputs = response.getOutput(); + private static synchronized DeidentifiedFileOutput getFirstOutput(DetectRunsResponse response) { + List outputs = response.getOutput().get(); return outputs != null && !outputs.isEmpty() ? outputs.get(0) : null; } - private static synchronized List getEntities(DeidentifyStatusResponse response) { + private static synchronized List getEntities(DetectRunsResponse response) { List entities = new ArrayList<>(); - List outputs = response.getOutput(); - DeidentifyFileOutput deidentifyFileOutput = outputs != null && !outputs.isEmpty() ? outputs.get(1) : null; + Optional> outputs = response.getOutput(); + DeidentifiedFileOutput deidentifyFileOutput = outputs.isPresent() ? outputs.get().get(0) : null; if (deidentifyFileOutput != null) { entities.add(new FileEntityInfo( @@ -345,21 +348,21 @@ private String extractBodyAsString(ApiClientApiException e) { } - private com.skyflow.generated.rest.types.DeidentifyFileResponse processFileByType(String fileExtension, String base64Content, DeidentifyFileRequest request, String vaultId) throws SkyflowException { + private com.skyflow.generated.rest.types.DeidentifyFileResponse processFileByType(String fileExtension, String base64Content, DeidentifyFileRequest request, String vaultId) throws SkyflowException { switch (fileExtension.toLowerCase()) { case "txt": - com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest textFileRequest = + com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText textFileRequest = super.getDeidentifyTextFileRequest(request, vaultId, base64Content); return super.getDetectFileAPi().deidentifyText(textFileRequest); case "mp3": case "wav": - DeidentifyAudioRequest audioRequest = + DeidentifyFileAudioRequestDeidentifyAudio audioRequest = super.getDeidentifyAudioRequest(request, vaultId, base64Content, fileExtension); return super.getDetectFileAPi().deidentifyAudio(audioRequest); case "pdf": - DeidentifyPdfRequest pdfRequest = + DeidentifyFileDocumentPdfRequestDeidentifyPdf pdfRequest = super.getDeidentifyPdfRequest(request, vaultId, base64Content); return super.getDetectFileAPi().deidentifyPdf(pdfRequest); @@ -370,32 +373,32 @@ private com.skyflow.generated.rest.types.DeidentifyFileResponse processFileByTyp case "bmp": case "tif": case "tiff": - DeidentifyImageRequest imageRequest = + DeidentifyFileImageRequestDeidentifyImage imageRequest = super.getDeidentifyImageRequest(request, vaultId, base64Content, fileExtension); return super.getDetectFileAPi().deidentifyImage(imageRequest); case "ppt": case "pptx": - DeidentifyPresentationRequest presentationRequest = + DeidentifyFileRequestDeidentifyPresentation presentationRequest = super.getDeidentifyPresentationRequest(request, vaultId, base64Content, fileExtension); return super.getDetectFileAPi().deidentifyPresentation(presentationRequest); case "csv": case "xls": case "xlsx": - DeidentifySpreadsheetRequest spreadsheetRequest = + DeidentifyFileRequestDeidentifySpreadsheet spreadsheetRequest = super.getDeidentifySpreadsheetRequest(request, vaultId, base64Content, fileExtension); return super.getDetectFileAPi().deidentifySpreadsheet(spreadsheetRequest); case "doc": case "docx": - DeidentifyDocumentRequest documentRequest = + DeidentifyFileRequestDeidentifyDocument documentRequest = super.getDeidentifyDocumentRequest(request, vaultId, base64Content, fileExtension); return super.getDetectFileAPi().deidentifyDocument(documentRequest); case "json": case "xml": - DeidentifyStructuredTextRequest structuredTextRequest = + DeidentifyFileRequestDeidentifyStructuredText structuredTextRequest = super.getDeidentifyStructuredTextRequest(request, vaultId, base64Content, fileExtension); return super.getDetectFileAPi().deidentifyStructuredText(structuredTextRequest); @@ -420,7 +423,7 @@ public DeidentifyFileResponse getDetectRun(GetDetectRunRequest request) throws S .vaultId(vaultId) .build(); - com.skyflow.generated.rest.types.DeidentifyStatusResponse apiResponse = + com.skyflow.generated.rest.types.DetectRunsResponse apiResponse = super.getDetectFileAPi().getRun(runId, getRunRequest); return parseDeidentifyFileResponse(apiResponse, runId, apiResponse.getStatus().toString()); diff --git a/src/main/java/com/skyflow/vault/controller/VaultController.java b/src/main/java/com/skyflow/vault/controller/VaultController.java index 3493227c..5ea637ae 100644 --- a/src/main/java/com/skyflow/vault/controller/VaultController.java +++ b/src/main/java/com/skyflow/vault/controller/VaultController.java @@ -5,9 +5,11 @@ import com.skyflow.config.Credentials; import com.skyflow.config.VaultConfig; import com.skyflow.enums.RedactionType; +import com.skyflow.errors.ErrorCode; import com.skyflow.errors.SkyflowException; import com.skyflow.generated.rest.core.ApiClientApiException; import com.skyflow.generated.rest.core.ApiClientHttpResponse; +import com.skyflow.generated.rest.core.RequestOptions; import com.skyflow.generated.rest.resources.query.requests.QueryServiceExecuteQueryBody; import com.skyflow.generated.rest.resources.records.requests.*; import com.skyflow.generated.rest.resources.records.types.RecordServiceBulkGetRecordRequestOrderBy; @@ -18,6 +20,7 @@ import com.skyflow.logs.ErrorLogs; import com.skyflow.logs.InfoLogs; import com.skyflow.utils.Constants; +import com.skyflow.utils.Utils; import com.skyflow.utils.logger.LogUtil; import com.skyflow.utils.validations.Validations; import com.skyflow.vault.data.*; @@ -29,6 +32,7 @@ public final class VaultController extends VaultClient { private static final Gson gson = new GsonBuilder().serializeNulls().create(); + private static final JsonObject skyMetadata = Utils.getMetrics(); public VaultController(VaultConfig vaultConfig, Credentials credentials) { super(vaultConfig, credentials); @@ -118,7 +122,8 @@ public InsertResponse insert(InsertRequest insertRequest) throws SkyflowExceptio setBearerToken(); if (continueOnError) { RecordServiceBatchOperationBody insertBody = super.getBatchInsertRequestBody(insertRequest); - batchInsertResult = super.getRecordsApi().withRawResponse().recordServiceBatchOperation(super.getVaultConfig().getVaultId(), insertBody); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); + batchInsertResult = super.getRecordsApi().withRawResponse().recordServiceBatchOperation(super.getVaultConfig().getVaultId(), insertBody, requestOptions); LogUtil.printInfoLog(InfoLogs.INSERT_REQUEST_RESOLVED.getLog()); Optional>> records = batchInsertResult.body().getResponses(); @@ -132,8 +137,8 @@ public InsertResponse insert(InsertRequest insertRequest) throws SkyflowExceptio if (insertRecord.containsKey("skyflowId")) { insertedFields.add(insertRecord); } else { - insertRecord.put("requestId", batchInsertResult.headers().get("x-request-id").get(0)); - insertRecord.put("httpCode", 400); + insertRecord.put("requestId", batchInsertResult.headers().get(Constants.REQUEST_ID_HEADER_KEY).get(0)); + insertRecord.put("httpCode", ErrorCode.INVALID_INPUT.getCode()); errorFields.add(insertRecord); } } @@ -176,7 +181,8 @@ public DetokenizeResponse detokenize(DetokenizeRequest detokenizeRequest) throws Validations.validateDetokenizeRequest(detokenizeRequest); setBearerToken(); V1DetokenizePayload payload = super.getDetokenizePayload(detokenizeRequest); - result = super.getTokensApi().withRawResponse().recordServiceDetokenize(super.getVaultConfig().getVaultId(), payload); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); + result = super.getTokensApi().withRawResponse().recordServiceDetokenize(super.getVaultConfig().getVaultId(), payload, requestOptions); LogUtil.printInfoLog(InfoLogs.DETOKENIZE_REQUEST_RESOLVED.getLog()); Map> responseHeaders = result.headers(); String requestId = responseHeaders.get(Constants.REQUEST_ID_HEADER_KEY).get(0); @@ -238,11 +244,12 @@ public GetResponse get(GetRequest getRequest) throws SkyflowException { .orderBy(RecordServiceBulkGetRecordRequestOrderBy.valueOf(getRequest.getOrderBy())) .build(); - + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); result = super.getRecordsApi().recordServiceBulkGetRecord( super.getVaultConfig().getVaultId(), getRequest.getTable(), - recordServiceBulkGetRecordRequest + recordServiceBulkGetRecordRequest, + requestOptions ); LogUtil.printInfoLog(InfoLogs.GET_REQUEST_RESOLVED.getLog()); List records = result.getRecords().get(); @@ -270,11 +277,13 @@ public UpdateResponse update(UpdateRequest updateRequest) throws SkyflowExceptio Validations.validateUpdateRequest(updateRequest); setBearerToken(); RecordServiceUpdateRecordBody updateBody = super.getUpdateRequestBody(updateRequest); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); result = super.getRecordsApi().recordServiceUpdateRecord( super.getVaultConfig().getVaultId(), updateRequest.getTable(), updateRequest.getData().remove("skyflow_id").toString(), - updateBody + updateBody, + requestOptions ); LogUtil.printInfoLog(InfoLogs.UPDATE_REQUEST_RESOLVED.getLog()); skyflowId = String.valueOf(result.getSkyflowId()); @@ -298,8 +307,9 @@ public DeleteResponse delete(DeleteRequest deleteRequest) throws SkyflowExceptio RecordServiceBulkDeleteRecordBody deleteBody = RecordServiceBulkDeleteRecordBody.builder().skyflowIds(deleteRequest.getIds()) .build(); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); result = super.getRecordsApi().recordServiceBulkDeleteRecord( - super.getVaultConfig().getVaultId(), deleteRequest.getTable(), deleteBody); + super.getVaultConfig().getVaultId(), deleteRequest.getTable(), deleteBody, requestOptions); LogUtil.printInfoLog(InfoLogs.DELETE_REQUEST_RESOLVED.getLog()); } catch (ApiClientApiException e) { String bodyString = gson.toJson(e.body()); @@ -318,8 +328,12 @@ public QueryResponse query(QueryRequest queryRequest) throws SkyflowException { LogUtil.printInfoLog(InfoLogs.VALIDATING_QUERY_REQUEST.getLog()); Validations.validateQueryRequest(queryRequest); setBearerToken(); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); result = super.getQueryApi().queryServiceExecuteQuery( - super.getVaultConfig().getVaultId(), QueryServiceExecuteQueryBody.builder().query(queryRequest.getQuery()).build()); + super.getVaultConfig().getVaultId(), + QueryServiceExecuteQueryBody.builder().query(queryRequest.getQuery()).build(), + requestOptions + ); LogUtil.printInfoLog(InfoLogs.QUERY_REQUEST_RESOLVED.getLog()); if (result.getRecords().isPresent()) { List records = result.getRecords().get(); // Extract the List from Optional @@ -345,7 +359,8 @@ public TokenizeResponse tokenize(TokenizeRequest tokenizeRequest) throws Skyflow Validations.validateTokenizeRequest(tokenizeRequest); setBearerToken(); V1TokenizePayload payload = super.getTokenizePayload(tokenizeRequest); - result = super.getTokensApi().recordServiceTokenize(super.getVaultConfig().getVaultId(), payload); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); + result = super.getTokensApi().recordServiceTokenize(super.getVaultConfig().getVaultId(), payload, requestOptions); LogUtil.printInfoLog(InfoLogs.TOKENIZE_REQUEST_RESOLVED.getLog()); if (result != null && result.getRecords().isPresent() && !result.getRecords().get().isEmpty()) { for (V1TokenizeRecordResponse response : result.getRecords().get()) { @@ -380,7 +395,13 @@ public FileUploadResponse uploadFile(FileUploadRequest fileUploadRequest) throws .returnFileMetadata(false) .build(); - UploadFileV2Response uploadFileV2Response = super.getRecordsApi().uploadFileV2(super.getVaultConfig().getVaultId(), file, uploadFileV2Request); + RequestOptions requestOptions = RequestOptions.builder().addHeader(Constants.SDK_METRICS_HEADER_KEY, skyMetadata.toString()).build(); + UploadFileV2Response uploadFileV2Response = super.getRecordsApi().uploadFileV2( + super.getVaultConfig().getVaultId(), + file, + uploadFileV2Request, + requestOptions + ); fileUploadResponse = new FileUploadResponse( uploadFileV2Response.getSkyflowId().orElse(null), @@ -392,7 +413,7 @@ public FileUploadResponse uploadFile(FileUploadRequest fileUploadRequest) throws LogUtil.printErrorLog(ErrorLogs.UPLOAD_FILE_REQUEST_REJECTED.getLog()); throw new SkyflowException(e.statusCode(), e, e.headers(), bodyString); } catch (IOException e) { - LogUtil.printErrorLog(ErrorLogs.UPLOAD_FILE_REQUEST_REJECTED.getLog()); + LogUtil.printErrorLog(ErrorLogs.UPLOAD_FILE_REQUEST_REJECTED.getLog()); throw new SkyflowException(e.getMessage(), e); } LogUtil.printInfoLog(InfoLogs.FILE_UPLOAD_SUCCESS.getLog()); diff --git a/src/main/java/com/skyflow/vault/detect/DeidentifyFileResponse.java b/src/main/java/com/skyflow/vault/detect/DeidentifyFileResponse.java index 66590f8e..08636d77 100644 --- a/src/main/java/com/skyflow/vault/detect/DeidentifyFileResponse.java +++ b/src/main/java/com/skyflow/vault/detect/DeidentifyFileResponse.java @@ -3,7 +3,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import java.io.File; import java.util.List; public class DeidentifyFileResponse { @@ -13,8 +12,8 @@ public class DeidentifyFileResponse { private final String extension; private final Integer wordCount; private final Integer charCount; - private final Double sizeInKb; - private final Double durationInSeconds; + private final Float sizeInKb; + private final Float durationInSeconds; private final Integer pageCount; private final Integer slideCount; private final List entities; @@ -23,8 +22,8 @@ public class DeidentifyFileResponse { public DeidentifyFileResponse(FileInfo file, String fileBase64, String type, String extension, - Integer wordCount, Integer charCount, Double sizeInKb, - Double durationInSeconds, Integer pageCount, Integer slideCount, + Integer wordCount, Integer charCount, Float sizeInKb, + Float durationInSeconds, Integer pageCount, Integer slideCount, List entities, String runId, String status) { this.file = file; this.fileBase64 = fileBase64; @@ -69,11 +68,11 @@ public Integer getCharCount() { return charCount; } - public Double getSizeInKb() { + public Float getSizeInKb() { return sizeInKb; } - public Double getDurationInSeconds() { + public Float getDurationInSeconds() { return durationInSeconds; } diff --git a/src/main/java/com/skyflow/vault/detect/FileEntityInfo.java b/src/main/java/com/skyflow/vault/detect/FileEntityInfo.java index e177a99a..1c41e6ac 100644 --- a/src/main/java/com/skyflow/vault/detect/FileEntityInfo.java +++ b/src/main/java/com/skyflow/vault/detect/FileEntityInfo.java @@ -1,16 +1,17 @@ package com.skyflow.vault.detect; -import com.skyflow.generated.rest.types.DeidentifyFileOutputProcessedFileType; +import com.skyflow.generated.rest.types.DeidentifiedFileOutputProcessedFileExtension; +import com.skyflow.generated.rest.types.DeidentifiedFileOutputProcessedFileType; public class FileEntityInfo { private final String file; private final String type; private final String extension; - public FileEntityInfo(String file, DeidentifyFileOutputProcessedFileType type, String extension) { + public FileEntityInfo(String file, DeidentifiedFileOutputProcessedFileType type, DeidentifiedFileOutputProcessedFileExtension extension) { this.file = file; this.type = String.valueOf(type); - this.extension = extension; + this.extension = String.valueOf(extension); } public String getFile() { return file; } diff --git a/src/main/resources/sdk.properties b/src/main/resources/sdk.properties new file mode 100644 index 00000000..54fb1501 --- /dev/null +++ b/src/main/resources/sdk.properties @@ -0,0 +1 @@ +sdk.version=${sdk.version} \ No newline at end of file diff --git a/src/test/java/com/skyflow/VaultClientTests.java b/src/test/java/com/skyflow/VaultClientTests.java index 1ebb1b23..4c9be65f 100644 --- a/src/test/java/com/skyflow/VaultClientTests.java +++ b/src/test/java/com/skyflow/VaultClientTests.java @@ -18,15 +18,13 @@ import com.skyflow.generated.rest.resources.tokens.TokensClient; import com.skyflow.generated.rest.resources.tokens.requests.V1DetokenizePayload; import com.skyflow.generated.rest.resources.tokens.requests.V1TokenizePayload; -import com.skyflow.generated.rest.types.DeidentifyStringResponse; -import com.skyflow.generated.rest.types.DetectedEntity; -import com.skyflow.generated.rest.types.EntityLocation; -import com.skyflow.generated.rest.types.V1Byot; +import com.skyflow.generated.rest.types.*; import com.skyflow.vault.data.InsertRequest; import com.skyflow.vault.data.UpdateRequest; import com.skyflow.vault.detect.*; import com.skyflow.vault.detect.DeidentifyFileRequest; import com.skyflow.vault.detect.DeidentifyTextRequest; +import com.skyflow.vault.detect.Transformations; import com.skyflow.vault.tokens.ColumnValue; import com.skyflow.vault.tokens.DetokenizeData; import com.skyflow.vault.tokens.DetokenizeRequest; @@ -351,15 +349,15 @@ public void testSetBearerTokenWithEnvCredentials() { @Test public void testGetDeIdentifyTextResponse() { - List entities = new ArrayList<>(); - EntityLocation location = EntityLocation.builder() + List entities = new ArrayList<>(); + Locations location = Locations.builder() .startIndex(2) .endIndex(10) .startIndexProcessed(3) .endIndexProcessed(8) .build(); - DetectedEntity detectedEntity = DetectedEntity.builder() + StringResponseEntities detectedEntity = StringResponseEntities.builder() .token("token123") .value("value123") .location(location) @@ -528,7 +526,7 @@ public void testGetDeidentifyImageRequest() { String base64Content = "base64string"; String format = "jpg"; - DeidentifyImageRequest imageRequest = vaultClient.getDeidentifyImageRequest(request, vaultId, base64Content, format); + DeidentifyFileImageRequestDeidentifyImage imageRequest = vaultClient.getDeidentifyImageRequest(request, vaultId, base64Content, format); Assert.assertEquals(vaultId, imageRequest.getVaultId()); Assert.assertEquals(base64Content, imageRequest.getFile().getBase64()); @@ -552,7 +550,7 @@ public void testGetDeidentifyPresentationRequest() { String base64Content = "base64string"; String format = "pptx"; - DeidentifyPresentationRequest presRequest = vaultClient.getDeidentifyPresentationRequest(request, vaultId, base64Content, format); + DeidentifyFileRequestDeidentifyPresentation presRequest = vaultClient.getDeidentifyPresentationRequest(request, vaultId, base64Content, format); Assert.assertEquals(vaultId, presRequest.getVaultId()); Assert.assertEquals(base64Content, presRequest.getFile().getBase64()); @@ -576,7 +574,7 @@ public void testGetDeidentifySpreadsheetRequest() { String base64Content = "base64string"; String format = "csv"; - DeidentifySpreadsheetRequest spreadsheetRequest = vaultClient.getDeidentifySpreadsheetRequest(request, vaultId, base64Content, format); + DeidentifyFileRequestDeidentifySpreadsheet spreadsheetRequest = vaultClient.getDeidentifySpreadsheetRequest(request, vaultId, base64Content, format); Assert.assertEquals(vaultId, spreadsheetRequest.getVaultId()); Assert.assertEquals(base64Content, spreadsheetRequest.getFile().getBase64()); @@ -600,7 +598,7 @@ public void testGetDeidentifyStructuredTextRequest() { String base64Content = "base64string"; String format = "json"; - DeidentifyStructuredTextRequest structuredTextRequest = vaultClient.getDeidentifyStructuredTextRequest(request, vaultId, base64Content, format); + DeidentifyFileRequestDeidentifyStructuredText structuredTextRequest = vaultClient.getDeidentifyStructuredTextRequest(request, vaultId, base64Content, format); Assert.assertEquals(vaultId, structuredTextRequest.getVaultId()); Assert.assertEquals(base64Content, structuredTextRequest.getFile().getBase64()); @@ -624,7 +622,7 @@ public void testGetDeidentifyDocumentRequest() { String base64Content = "base64string"; String format = "docx"; - DeidentifyDocumentRequest documentRequest = vaultClient.getDeidentifyDocumentRequest(request, vaultId, base64Content, format); + DeidentifyFileRequestDeidentifyDocument documentRequest = vaultClient.getDeidentifyDocumentRequest(request, vaultId, base64Content, format); Assert.assertEquals(vaultId, documentRequest.getVaultId()); Assert.assertEquals(base64Content, documentRequest.getFile().getBase64()); @@ -649,7 +647,7 @@ public void testGetDeidentifyPdfRequest() { String vaultId = "vault123"; String base64Content = "base64string"; - DeidentifyPdfRequest pdfRequest = vaultClient.getDeidentifyPdfRequest(request, vaultId, base64Content); + DeidentifyFileDocumentPdfRequestDeidentifyPdf pdfRequest = vaultClient.getDeidentifyPdfRequest(request, vaultId, base64Content); Assert.assertEquals(vaultId, pdfRequest.getVaultId()); Assert.assertEquals(base64Content, pdfRequest.getFile().getBase64()); @@ -669,14 +667,14 @@ public void testGetDeidentifyAudioRequest() throws SkyflowException { .tokenFormat(tokenFormat) .bleep(bleep) .outputProcessedAudio(true) - .outputTranscription(DetectOutputTranscriptions.PLAINTEXT_TRANSCRIPTION) + .outputTranscription(DetectOutputTranscriptions.TRANSCRIPTION) .build(); String vaultId = "vault123"; String base64Content = "base64string"; String dataFormat = "mp3"; - DeidentifyAudioRequest audioRequest = vaultClient.getDeidentifyAudioRequest(request, vaultId, base64Content, dataFormat); + DeidentifyFileAudioRequestDeidentifyAudio audioRequest = vaultClient.getDeidentifyAudioRequest(request, vaultId, base64Content, dataFormat); Assert.assertEquals(vaultId, audioRequest.getVaultId()); Assert.assertEquals(base64Content, audioRequest.getFile().getBase64()); @@ -699,7 +697,7 @@ public void testGetDeidentifyTextFileRequest() { String vaultId = "vault123"; String base64Content = "base64string"; - com.skyflow.generated.rest.resources.files.requests.DeidentifyTextRequest textRequest = + com.skyflow.generated.rest.resources.files.requests.DeidentifyFileRequestDeidentifyText textRequest = vaultClient.getDeidentifyTextFileRequest(request, vaultId, base64Content); Assert.assertEquals(vaultId, textRequest.getVaultId()); @@ -770,8 +768,8 @@ public void testGetReidentifyStringRequest_AllFields() throws Exception { ReidentifyStringRequest result = vaultClient.getReidentifyStringRequest(req, "vaultId"); Assert.assertNotNull(result); - Assert.assertEquals("vaultId", result.getVaultId()); - Assert.assertEquals("Sensitive data", result.getText()); + Assert.assertEquals("vaultId", result.getVaultId().get()); + Assert.assertEquals("Sensitive data", result.getText().get()); Assert.assertNotNull(result.getFormat()); } @@ -783,8 +781,8 @@ public void testGetReidentifyStringRequest_NullFields() throws Exception { ReidentifyStringRequest result = vaultClient.getReidentifyStringRequest(req, "vaultId"); Assert.assertNotNull(result); - Assert.assertEquals("vaultId", result.getVaultId()); - Assert.assertEquals("No entities", result.getText()); + Assert.assertEquals("vaultId", result.getVaultId().get()); + Assert.assertEquals("No entities", result.getText().get()); Assert.assertNotNull(result.getFormat()); } @@ -867,7 +865,7 @@ public void testMapAudioDataFormat_mp3() throws Exception { java.lang.reflect.Method method = VaultClient.class.getDeclaredMethod("mapAudioDataFormat", String.class); method.setAccessible(true); Object result = method.invoke(vaultClient, "mp3"); - Assert.assertEquals(com.skyflow.generated.rest.resources.files.types.DeidentifyAudioRequestFileDataFormat.MP_3, result); + Assert.assertEquals(FileDataDeidentifyAudioDataFormat.MP_3, result); } @Test @@ -875,7 +873,7 @@ public void testMapAudioDataFormat_wav() throws Exception { java.lang.reflect.Method method = VaultClient.class.getDeclaredMethod("mapAudioDataFormat", String.class); method.setAccessible(true); Object result = method.invoke(vaultClient, "wav"); - Assert.assertEquals(com.skyflow.generated.rest.resources.files.types.DeidentifyAudioRequestFileDataFormat.WAV, result); + Assert.assertEquals(FileDataDeidentifyAudioDataFormat.WAV, result); } @Test diff --git a/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java b/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java index 04083077..f431042d 100644 --- a/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java +++ b/src/test/java/com/skyflow/serviceaccount/util/SignedDataTokensTests.java @@ -109,18 +109,14 @@ public void testEmptyCredentialsString() { try { SignedDataTokens signedTokens = SignedDataTokens.builder().setCredentials("").build(); signedTokens.getSignedDataTokens(); - System.out.println("in try block"); Assert.fail(EXCEPTION_NOT_THROWN); } catch (SkyflowException e) { - System.out.println("caught skyflow exception"); - System.out.println(e); Assert.assertEquals(ErrorCode.INVALID_INPUT.getCode(), e.getHttpCode()); Assert.assertEquals( Utils.parameterizedString(ErrorMessage.InvalidCredentials.getMessage(), invalidJsonFilePath), e.getMessage() ); } catch (Exception e) { - System.out.println("catching exception"); System.out.println(e); } } diff --git a/src/test/java/com/skyflow/utils/UtilsTests.java b/src/test/java/com/skyflow/utils/UtilsTests.java index 83e5a6ff..4e910e15 100644 --- a/src/test/java/com/skyflow/utils/UtilsTests.java +++ b/src/test/java/com/skyflow/utils/UtilsTests.java @@ -208,7 +208,7 @@ public void testGetMetricsWithException() { System.clearProperty("java.version"); JsonObject metrics = Utils.getMetrics(); - Assert.assertEquals("skyflow-java@v2", metrics.get(Constants.SDK_METRIC_NAME_VERSION).getAsString()); + Assert.assertEquals("skyflow-java@" + Constants.SDK_VERSION, metrics.get(Constants.SDK_METRIC_NAME_VERSION).getAsString()); Assert.assertEquals("Java@", metrics.get(Constants.SDK_METRIC_RUNTIME_DETAILS).getAsString()); Assert.assertTrue(metrics.get(Constants.SDK_METRIC_CLIENT_DEVICE_MODEL).getAsString().isEmpty()); Assert.assertTrue(metrics.get(Constants.SDK_METRIC_CLIENT_OS_DETAILS).getAsString().isEmpty()); diff --git a/src/test/java/com/skyflow/vault/data/FileUploadTests.java b/src/test/java/com/skyflow/vault/data/FileUploadTests.java index 7758fe36..4eac8bed 100644 --- a/src/test/java/com/skyflow/vault/data/FileUploadTests.java +++ b/src/test/java/com/skyflow/vault/data/FileUploadTests.java @@ -89,7 +89,6 @@ public void testValidFileUploadRequestWithFileObject() { Validations.validateFileUploadRequest(request); Assert.assertEquals(fileObject, request.getFileObject()); } catch (SkyflowException e) { - System.out.println("## e:" + e.getMessage()); Assert.fail(INVALID_EXCEPTION_THROWN); } } diff --git a/src/test/java/com/skyflow/vault/detect/DeidentifyFileResponseTest.java b/src/test/java/com/skyflow/vault/detect/DeidentifyFileResponseTest.java index 89cf5114..62c7ac7e 100644 --- a/src/test/java/com/skyflow/vault/detect/DeidentifyFileResponseTest.java +++ b/src/test/java/com/skyflow/vault/detect/DeidentifyFileResponseTest.java @@ -1,11 +1,11 @@ package com.skyflow.vault.detect; -import com.skyflow.generated.rest.types.DeidentifyFileOutputProcessedFileType; +import com.skyflow.generated.rest.types.DeidentifiedFileOutputProcessedFileExtension; +import com.skyflow.generated.rest.types.DeidentifiedFileOutputProcessedFileType; import org.junit.Assert; import org.junit.Test; import java.io.File; -import java.util.Arrays; import java.util.Collections; public class DeidentifyFileResponseTest { @@ -18,11 +18,11 @@ public void testAllGettersAndToString() { String extension = ".pdf"; Integer wordCount = 100; Integer charCount = 500; - Double sizeInKb = 123.45; - Double durationInSeconds = 12.3; + Float sizeInKb = 123.45F; + Float durationInSeconds = 12.3F; Integer pageCount = 5; Integer slideCount = 0; - FileEntityInfo entityInfo = new FileEntityInfo("PERSON", DeidentifyFileOutputProcessedFileType.ENTITIES, "John Doe"); + FileEntityInfo entityInfo = new FileEntityInfo("PERSON", DeidentifiedFileOutputProcessedFileType.ENTITIES, DeidentifiedFileOutputProcessedFileExtension.PDF); java.util.List entities = Collections.singletonList(entityInfo); String runId = "run-123"; String status = "SUCCESS"; diff --git a/src/test/java/com/skyflow/vault/detect/FileEntityInfoTest.java b/src/test/java/com/skyflow/vault/detect/FileEntityInfoTest.java index e1f1e152..d77ddb6f 100644 --- a/src/test/java/com/skyflow/vault/detect/FileEntityInfoTest.java +++ b/src/test/java/com/skyflow/vault/detect/FileEntityInfoTest.java @@ -1,6 +1,7 @@ package com.skyflow.vault.detect; -import com.skyflow.generated.rest.types.DeidentifyFileOutputProcessedFileType; +import com.skyflow.generated.rest.types.DeidentifiedFileOutputProcessedFileExtension; +import com.skyflow.generated.rest.types.DeidentifiedFileOutputProcessedFileType; import org.junit.Assert; import org.junit.Test; @@ -9,10 +10,10 @@ public class FileEntityInfoTest { @Test public void testConstructorAndGetters() { String file = "entity.pdf"; - DeidentifyFileOutputProcessedFileType type = DeidentifyFileOutputProcessedFileType.ENTITIES; - String extension = ".pdf"; + DeidentifiedFileOutputProcessedFileType type = DeidentifiedFileOutputProcessedFileType.ENTITIES; + String extension = "pdf"; - FileEntityInfo info = new FileEntityInfo(file, type, extension); + FileEntityInfo info = new FileEntityInfo(file, type, DeidentifiedFileOutputProcessedFileExtension.PDF); Assert.assertEquals(file, info.getFile()); Assert.assertEquals(type.toString(), info.getType());