From 80089caf60ab55563ed8aaebc4f17801dc65158c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 23 Jan 2025 13:29:33 +0100 Subject: [PATCH 01/34] Initial --- grounding/pom.xml | 176 ++ .../sap/ai/sdk/grounding/GroundingClient.java | 317 ++++ .../grounding/GroundingClientException.java | 8 + .../ai/sdk/grounding/api/PipelinesApi.java | 410 +++++ .../ai/sdk/grounding/api/RetrievalApi.java | 287 +++ .../sap/ai/sdk/grounding/api/VectorApi.java | 1052 +++++++++++ .../sap/ai/sdk/grounding/model/ApiError.java | 342 ++++ .../ai/sdk/grounding/model/BaseDocument.java | 275 +++ .../com/sap/ai/sdk/grounding/model/Chunk.java | 270 +++ .../ai/sdk/grounding/model/Collection.java | 309 ++++ .../model/CollectionCreatedResponse.java | 221 +++ .../model/CollectionDeletedResponse.java | 221 +++ .../model/CollectionPendingResponse.java | 223 +++ .../grounding/model/CollectionRequest.java | 267 +++ .../model/CollectionsListResponse.java | 236 +++ .../sdk/grounding/model/DataRepositories.java | 234 +++ .../sdk/grounding/model/DataRepository.java | 321 ++++ .../grounding/model/DataRepositoryType.java | 63 + .../model/DataRepositoryWithDocuments.java | 357 ++++ .../grounding/model/DetailsErrorResponse.java | 193 ++ .../model/DocumentCreateRequest.java | 204 +++ .../ai/sdk/grounding/model/DocumentInput.java | 324 ++++ .../model/DocumentKeyValueListPair.java | 347 ++++ .../sdk/grounding/model/DocumentOutput.java | 297 +++ .../sdk/grounding/model/DocumentResponse.java | 319 ++++ .../model/DocumentUpdateRequest.java | 207 +++ .../model/DocumentWithoutChunks.java | 248 +++ .../sap/ai/sdk/grounding/model/Documents.java | 234 +++ .../sdk/grounding/model/DocumentsChunk.java | 345 ++++ .../model/DocumentsListResponse.java | 200 ++ .../sdk/grounding/model/EmbeddingConfig.java | 161 ++ .../ai/sdk/grounding/model/InlineObject.java | 156 ++ .../sdk/grounding/model/KeyValueListPair.java | 250 +++ .../model/PerFilterSearchResult.java | 247 +++ .../sap/ai/sdk/grounding/model/Pipeline.java | 228 +++ .../model/PipelineConfiguration.java | 195 ++ .../PipelineConfigurationSharePoint.java | 163 ++ .../PipelineConfigurationSharePointSite.java | 259 +++ .../ai/sdk/grounding/model/PipelineId.java | 156 ++ .../grounding/model/PipelinePostRequst.java | 226 +++ .../PipelinePostRequstConfiguration.java | 219 +++ ...linePostRequstConfigurationSharePoint.java | 173 ++ ...PostRequstConfigurationSharePointSite.java | 233 +++ .../sdk/grounding/model/PipelineStatus.java | 157 ++ .../sap/ai/sdk/grounding/model/Pipelines.java | 234 +++ .../ai/sdk/grounding/model/ResultsInner.java | 245 +++ .../ai/sdk/grounding/model/ResultsInner1.java | 271 +++ .../RetievalDataRepositorySearchResult.java | 181 ++ .../model/RetievalPerFilterSearchResult.java | 232 +++ ...etievalPerFilterSearchResultWithError.java | 177 ++ .../model/RetievalSearchResults.java | 199 ++ .../grounding/model/RetrievalDocument.java | 296 +++ .../model/RetrievalSearchFilter.java | 509 ++++++ .../grounding/model/RetrievalSearchInput.java | 251 +++ .../grounding/model/SearchConfiguration.java | 209 +++ .../model/SearchDocumentKeyValueListPair.java | 311 ++++ .../ai/sdk/grounding/model/SearchFilter.java | 474 +++++ .../ai/sdk/grounding/model/SearchResults.java | 198 ++ .../model/SearchSelectOptionEnum.java | 63 + .../grounding/model/TextOnlyBaseChunk.java | 250 +++ .../grounding/model/TextSearchRequest.java | 250 +++ ...etCollectionCreationStatus200Response.java | 24 + ...etCollectionDeletionStatus200Response.java | 24 + .../openapi/grounding/api/PipelinesApi.java | 413 +++++ .../openapi/grounding/api/RetrievalApi.java | 290 +++ .../openapi/grounding/api/VectorApi.java | 1055 +++++++++++ .../openapi/grounding/model/ApiError.java | 356 ++++ .../openapi/grounding/model/BaseDocument.java | 285 +++ .../openapi/grounding/model/Chunk.java | 284 +++ .../openapi/grounding/model/Collection.java | 325 ++++ .../model/CollectionCreatedResponse.java | 234 +++ .../model/CollectionDeletedResponse.java | 234 +++ .../model/CollectionPendingResponse.java | 234 +++ .../grounding/model/CollectionRequest.java | 277 +++ .../model/CollectionsListResponse.java | 250 +++ .../grounding/model/DataRepositories.java | 248 +++ .../grounding/model/DataRepository.java | 336 ++++ .../grounding/model/DataRepositoryType.java | 65 + .../model/DataRepositoryWithDocuments.java | 372 ++++ .../grounding/model/DetailsErrorResponse.java | 196 ++ .../model/DocumentCreateRequest.java | 213 +++ .../grounding/model/DocumentInput.java | 334 ++++ .../model/DocumentKeyValueListPair.java | 352 ++++ .../grounding/model/DocumentOutput.java | 312 ++++ .../grounding/model/DocumentResponse.java | 334 ++++ .../model/DocumentUpdateRequest.java | 216 +++ .../model/DocumentWithoutChunks.java | 262 +++ .../openapi/grounding/model/Documents.java | 248 +++ .../grounding/model/DocumentsChunk.java | 361 ++++ .../model/DocumentsListResponse.java | 214 +++ .../grounding/model/EmbeddingConfig.java | 159 ++ .../openapi/grounding/model/InlineObject.java | 160 ++ .../grounding/model/KeyValueListPair.java | 258 +++ .../model/PerFilterSearchResult.java | 261 +++ .../openapi/grounding/model/Pipeline.java | 232 +++ .../model/PipelineConfiguration.java | 199 ++ .../PipelineConfigurationSharePoint.java | 167 ++ .../PipelineConfigurationSharePointSite.java | 262 +++ .../openapi/grounding/model/PipelineId.java | 159 ++ .../grounding/model/PipelinePostRequst.java | 235 +++ .../PipelinePostRequstConfiguration.java | 228 +++ ...linePostRequstConfigurationSharePoint.java | 172 ++ ...PostRequstConfigurationSharePointSite.java | 231 +++ .../grounding/model/PipelineStatus.java | 160 ++ .../openapi/grounding/model/Pipelines.java | 248 +++ .../openapi/grounding/model/ResultsInner.java | 259 +++ .../grounding/model/ResultsInner1.java | 285 +++ .../RetievalDataRepositorySearchResult.java | 194 ++ .../model/RetievalPerFilterSearchResult.java | 246 +++ ...etievalPerFilterSearchResultWithError.java | 190 ++ .../model/RetievalSearchResults.java | 213 +++ .../grounding/model/RetrievalDocument.java | 311 ++++ .../model/RetrievalSearchFilter.java | 520 ++++++ .../grounding/model/RetrievalSearchInput.java | 260 +++ .../grounding/model/SearchConfiguration.java | 207 +++ .../model/SearchDocumentKeyValueListPair.java | 320 ++++ .../openapi/grounding/model/SearchFilter.java | 485 +++++ .../grounding/model/SearchResults.java | 212 +++ .../model/SearchSelectOptionEnum.java | 65 + .../grounding/model/TextOnlyBaseChunk.java | 260 +++ .../grounding/model/TextSearchRequest.java | 259 +++ ...etCollectionCreationStatus200Response.java | 329 ++++ ...etCollectionDeletionStatus200Response.java | 329 ++++ .../openapi/sample/api/OrdersApi.java | 99 + .../openapi/sample/api/SodasApi.java | 210 +++ .../resources/openapi/sample/model/AllOf.java | 231 +++ .../resources/openapi/sample/model/AnyOf.java | 231 +++ .../resources/openapi/sample/model/Cola.java | 195 ++ .../resources/openapi/sample/model/Fanta.java | 195 ++ .../resources/openapi/sample/model/OneOf.java | 28 + .../sample/model/OneOfWithDiscriminator.java | 30 + .../OneOfWithDiscriminatorAndMapping.java | 32 + .../resources/openapi/sample/model/Order.java | 331 ++++ .../sample/model/OrderWithTimestamp.java | 377 ++++ .../resources/openapi/sample/model/Soda.java | 415 +++++ .../openapi/sample/model/SodaWithId.java | 451 +++++ .../src/main/resources/spec/grounding.yaml | 1602 +++++++++++++++++ .../test/resources/__files/errorResponse.json | 7 + .../__files/filteringLooseResponse.json | 86 + .../resources/__files/groundingResponse.json | 62 + .../resources/__files/maskingResponse.json | 75 + .../__files/multiChatMessageResponse.json | 67 + .../streamChatCompletionInputFilter.json | 22 + .../resources/__files/templatingResponse.json | 65 + .../test/resources/filteringLooseRequest.json | 58 + .../src/test/resources/maskingRequest.json | 43 + .../resources/messagesHistoryRequest.json | 38 + .../resources/multiChatMessageRequest.json | 33 + .../test/resources/streamChatCompletion.txt | 4 + .../streamChatCompletionOutputFilter.txt | 2 + .../src/test/resources/templatingRequest.json | 31 + pom.xml | 3 + 152 files changed, 37126 insertions(+) create mode 100644 grounding/pom.xml create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java create mode 100644 grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java create mode 100644 grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java create mode 100644 grounding/src/main/resources/openapi/grounding/api/VectorApi.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/ApiError.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/BaseDocument.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/Chunk.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/Collection.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepositories.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepository.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentInput.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/Documents.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/InlineObject.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/Pipeline.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineId.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/Pipelines.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/ResultsInner.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchFilter.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchResults.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java create mode 100644 grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java create mode 100644 grounding/src/main/resources/openapi/sample/api/OrdersApi.java create mode 100644 grounding/src/main/resources/openapi/sample/api/SodasApi.java create mode 100644 grounding/src/main/resources/openapi/sample/model/AllOf.java create mode 100644 grounding/src/main/resources/openapi/sample/model/AnyOf.java create mode 100644 grounding/src/main/resources/openapi/sample/model/Cola.java create mode 100644 grounding/src/main/resources/openapi/sample/model/Fanta.java create mode 100644 grounding/src/main/resources/openapi/sample/model/OneOf.java create mode 100644 grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java create mode 100644 grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java create mode 100644 grounding/src/main/resources/openapi/sample/model/Order.java create mode 100644 grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java create mode 100644 grounding/src/main/resources/openapi/sample/model/Soda.java create mode 100644 grounding/src/main/resources/openapi/sample/model/SodaWithId.java create mode 100644 grounding/src/main/resources/spec/grounding.yaml create mode 100644 grounding/src/test/resources/__files/errorResponse.json create mode 100644 grounding/src/test/resources/__files/filteringLooseResponse.json create mode 100644 grounding/src/test/resources/__files/groundingResponse.json create mode 100644 grounding/src/test/resources/__files/maskingResponse.json create mode 100644 grounding/src/test/resources/__files/multiChatMessageResponse.json create mode 100644 grounding/src/test/resources/__files/streamChatCompletionInputFilter.json create mode 100644 grounding/src/test/resources/__files/templatingResponse.json create mode 100644 grounding/src/test/resources/filteringLooseRequest.json create mode 100644 grounding/src/test/resources/maskingRequest.json create mode 100644 grounding/src/test/resources/messagesHistoryRequest.json create mode 100644 grounding/src/test/resources/multiChatMessageRequest.json create mode 100644 grounding/src/test/resources/streamChatCompletion.txt create mode 100644 grounding/src/test/resources/streamChatCompletionOutputFilter.txt create mode 100644 grounding/src/test/resources/templatingRequest.json diff --git a/grounding/pom.xml b/grounding/pom.xml new file mode 100644 index 000000000..f602ba7dd --- /dev/null +++ b/grounding/pom.xml @@ -0,0 +1,176 @@ + + + 4.0.0 + + com.sap.ai.sdk + sdk-parent + 1.2.0-SNAPSHOT + + grounding + Grounding client + SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for the Orchestration Service. + + https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation + + SAP SE + https://www.sap.com + + + + The Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + SAP + cloudsdk@sap.com + SAP SE + https://www.sap.com + + + + ${project.basedir}/../ + 76% + 90% + 91% + 69% + 70% + 100% + + + + + + com.sap.ai.sdk + core + + + + com.sap.cloud.sdk.cloudplatform + cloudplatform-connectivity + + + com.sap.cloud.sdk.cloudplatform + connectivity-apache-httpclient5 + + + org.apache.httpcomponents.core5 + httpcore5 + + + org.apache.httpcomponents.client5 + httpclient5 + + + com.google.code.findbugs + jsr305 + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + io.vavr + vavr + + + org.slf4j + slf4j-api + + + com.google.guava + guava + + + + org.projectlombok + lombok + provided + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.wiremock + wiremock + test + + + org.assertj + assertj-core + test + + + org.mockito + mockito-core + test + + + org.junit.jupiter + junit-jupiter-params + test + + + + + + generate + + true + + generate + + + + + + com.sap.cloud.sdk.datamodel + openapi-generator-maven-plugin + + ${project.basedir}/src/main/java + beta + true + COMPILE + true + + + + orchestration + + generate + + generate-sources + + ${project.basedir}/src/main/resources/spec/grounding.yaml + com.sap.ai.sdk.grounding.api + true + + com.sap.ai.sdk.grounding.model + + create + + protected + true + true + + + + + + + + + + diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java new file mode 100644 index 000000000..97ae883f5 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -0,0 +1,317 @@ +package com.sap.ai.sdk.grounding; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.annotations.Beta; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.core.DeploymentResolutionException; +import com.sap.ai.sdk.core.common.ClientResponseHandler; +import com.sap.ai.sdk.core.common.ClientStreamingHandler; +import com.sap.ai.sdk.core.common.StreamedDelta; +import com.sap.ai.sdk.foundationmodels.openai.OpenAiClientException; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionDelta; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionOutput; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionParameters; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatMessage.OpenAiChatSystemMessage; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatMessage.OpenAiChatUserMessage; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiEmbeddingOutput; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiEmbeddingParameters; +import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiError; +import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.hc.client5.http.classic.methods.HttpPost; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.apache.hc.core5.http.message.BasicClassicHttpRequest; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.io.IOException; +import java.util.stream.Stream; + +import static com.sap.ai.sdk.core.JacksonConfiguration.getDefaultObjectMapper; + +/** Client for interacting with OpenAI models. */ +@Slf4j +@RequiredArgsConstructor(access = AccessLevel.PRIVATE) +public final class GroundingClient { + private static final String DEFAULT_API_VERSION = "2024-02-01"; + static final ObjectMapper JACKSON = getDefaultObjectMapper(); + @Nullable private String systemPrompt = null; + + @Nonnull private final Destination destination; + + /** + * Create a new OpenAI client for the given foundation model, using the default resource group. + * + * @param foundationModel the OpenAI model which is deployed. + * @return a new OpenAI client. + * @throws DeploymentResolutionException if no deployment for the given model was found in the + * default resource group. + */ + @Nonnull + public static GroundingClient forModel(@Nonnull final OpenAiModel foundationModel) + throws DeploymentResolutionException { + + ApiClient apiClient = new AiCoreService().getApiClient(); + apiClient.setBasePath(apiClient.getBasePath()+"lm/document-grounding/"); + VectorApi vectorApi = new VectorApi(apiClient); + + final var destination = new AiCoreService().getInferenceDestination().forModel(foundationModel); + + final var client = new GroundingClient(destination); + return client.withApiVersion(DEFAULT_API_VERSION); + } + + /** + * Create a new OpenAI client targeting the specified API version. + * + * @param apiVersion the API version to target. + * @return a new client. + */ + @Beta + @Nonnull + public GroundingClient withApiVersion(@Nonnull final String apiVersion) { + final var newDestination = + DefaultHttpDestination.fromDestination(this.destination) + // set the API version as URL query parameter + .property("URL.queries.api-version", apiVersion) + .build(); + return new GroundingClient(newDestination); + } + + /** + * Create a new OpenAI client with a custom destination, allowing for a custom resource group or + * otherwise custom destination. The destination needs to be configured with a URL pointing to an + * OpenAI model deployment. Typically, such a destination should be obtained using {@link + * AiCoreService#getInferenceDestination(String)}. + * + *

Example: + * + *

{@code
+   * var destination = new AiCoreService().getInferenceDestination("custom-rg").forModel(GPT_4O);
+   * OpenAiClient.withCustomDestination(destination);
+   * }
+ * + * @param destination The specific {@link HttpDestination} to use. + * @see AiCoreService#getInferenceDestination(String) + */ + @Beta + @Nonnull + public static GroundingClient withCustomDestination(@Nonnull final Destination destination) { + final GroundingClient client = new GroundingClient(destination); + + if (destination.get("URL.queries.api-version").isDefined()) { + return client; + } + + return client.withApiVersion(DEFAULT_API_VERSION); + } + + /** + * Add a system prompt before user prompts. + * + * @param systemPrompt the system prompt + * @return the client + */ + @Nonnull + public GroundingClient withSystemPrompt(@Nonnull final String systemPrompt) { + this.systemPrompt = systemPrompt; + return this; + } + + /** + * Generate a completion for the given user prompt. + * + * @param prompt a text message. + * @return the completion output + * @throws OpenAiClientException if the request fails + */ + @Nonnull + public OpenAiChatCompletionOutput chatCompletion(@Nonnull final String prompt) + throws OpenAiClientException { + final OpenAiChatCompletionParameters parameters = new OpenAiChatCompletionParameters(); + if (systemPrompt != null) { + parameters.addMessages(new OpenAiChatSystemMessage().setContent(systemPrompt)); + } + parameters.addMessages(new OpenAiChatUserMessage().addText(prompt)); + return chatCompletion(parameters); + } + + /** + * Generate a completion for the given prompt. + * + * @param parameters the prompt, including messages and other parameters. + * @return the completion output + * @throws OpenAiClientException if the request fails + */ + @Nonnull + public OpenAiChatCompletionOutput chatCompletion( + @Nonnull final OpenAiChatCompletionParameters parameters) throws OpenAiClientException { + warnIfUnsupportedUsage(); + return execute("/chat/completions", parameters, OpenAiChatCompletionOutput.class); + } + + /** + * Stream a completion for the given prompt. Returns a lazily populated stream of text + * chunks. To access more details about the individual chunks, use {@link + * #streamChatCompletionDeltas(OpenAiChatCompletionParameters)}. + * + *

The stream should be consumed using a try-with-resources block to ensure that the underlying + * HTTP connection is closed. + * + *

Example: + * + *

{@code
+   * try (var stream = client.streamChatCompletion("...")) {
+   *       stream.forEach(System.out::println);
+   * }
+   * }
+ * + *

Please keep in mind that using a terminal stream operation like {@link Stream#forEach} will + * block until all chunks are consumed. Also, for obvious reasons, invoking {@link + * Stream#parallel()} on this stream is not supported. + * + * @param prompt a text message. + * @return A stream of message deltas + * @throws OpenAiClientException if the request fails or if the finish reason is content_filter + * @see #streamChatCompletionDeltas(OpenAiChatCompletionParameters) + */ + @Nonnull + public Stream streamChatCompletion(@Nonnull final String prompt) + throws OpenAiClientException { + final OpenAiChatCompletionParameters parameters = new OpenAiChatCompletionParameters(); + if (systemPrompt != null) { + parameters.addMessages(new OpenAiChatSystemMessage().setContent(systemPrompt)); + } + parameters.addMessages(new OpenAiChatUserMessage().addText(prompt)); + return streamChatCompletionDeltas(parameters) + .peek(GroundingClient::throwOnContentFilter) + .map(OpenAiChatCompletionDelta::getDeltaContent); + } + + private static void throwOnContentFilter(@Nonnull final OpenAiChatCompletionDelta delta) { + final String finishReason = delta.getFinishReason(); + if (finishReason != null && finishReason.equals("content_filter")) { + throw new OpenAiClientException("Content filter filtered the output."); + } + } + + /** + * Stream a completion for the given prompt. Returns a lazily populated stream of delta + * objects. To simply stream the text chunks use {@link #streamChatCompletion(String)} + * + *

The stream should be consumed using a try-with-resources block to ensure that the underlying + * HTTP connection is closed. + * + *

Example: + * + *

{@code
+   * try (var stream = client.streamChatCompletionDeltas(params)) {
+   *       stream
+   *           .peek(delta -> System.out.println(delta.getUsage()))
+   *           .map(OpenAiChatCompletionDelta::getDeltaContent)
+   *           .forEach(System.out::println);
+   * }
+   * }
+ * + *

Please keep in mind that using a terminal stream operation like {@link Stream#forEach} will + * block until all chunks are consumed. Also, for obvious reasons, invoking {@link + * Stream#parallel()} on this stream is not supported. + * + * @param parameters The prompt, including messages and other parameters. + * @return A stream of message deltas + * @throws OpenAiClientException if the request fails or if the finish reason is content_filter + * @see #streamChatCompletion(String) + */ + @Nonnull + public Stream streamChatCompletionDeltas( + @Nonnull final OpenAiChatCompletionParameters parameters) throws OpenAiClientException { + warnIfUnsupportedUsage(); + parameters.enableStreaming(); + return executeStream("/chat/completions", parameters, OpenAiChatCompletionDelta.class); + } + + private void warnIfUnsupportedUsage() { + if (systemPrompt != null) { + log.warn( + "Previously set messages will be ignored, set it as an argument of this method instead."); + } + } + + /** + * Get a vector representation of a given input that can be easily consumed by machine learning + * models and algorithms. + * + * @param parameters the input text. + * @return the embedding output + * @throws OpenAiClientException if the request fails + */ + @Nonnull + public OpenAiEmbeddingOutput embedding(@Nonnull final OpenAiEmbeddingParameters parameters) + throws OpenAiClientException { + return execute("/embeddings", parameters, OpenAiEmbeddingOutput.class); + } + + @Nonnull + private T execute( + @Nonnull final String path, + @Nonnull final Object payload, + @Nonnull final Class responseType) { + final var request = new HttpPost(path); + serializeAndSetHttpEntity(request, payload); + return executeRequest(request, responseType); + } + + @Nonnull + private Stream executeStream( + @Nonnull final String path, + @Nonnull final Object payload, + @Nonnull final Class deltaType) { + final var request = new HttpPost(path); + serializeAndSetHttpEntity(request, payload); + return streamRequest(request, deltaType); + } + + private static void serializeAndSetHttpEntity( + @Nonnull final BasicClassicHttpRequest request, @Nonnull final Object payload) { + try { + final var json = JACKSON.writeValueAsString(payload); + request.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); + } catch (final JsonProcessingException e) { + throw new OpenAiClientException("Failed to serialize request parameters", e); + } + } + + @Nonnull + private T executeRequest( + final BasicClassicHttpRequest request, @Nonnull final Class responseType) { + try { + final var client = ApacheHttpClient5Accessor.getHttpClient(destination); + return client.execute( + request, + new ClientResponseHandler<>(responseType, OpenAiError.class, OpenAiClientException::new)); + } catch (final IOException e) { + throw new OpenAiClientException("Request to OpenAI model failed", e); + } + } + + @Nonnull + private Stream streamRequest( + final BasicClassicHttpRequest request, @Nonnull final Class deltaType) { + try { + final var client = ApacheHttpClient5Accessor.getHttpClient(destination); + return new ClientStreamingHandler<>(deltaType, OpenAiError.class, OpenAiClientException::new) + .handleStreamingResponse(client.executeOpen(null, request, null)); + } catch (final IOException e) { + throw new OpenAiClientException("Request to OpenAI model failed", e); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java new file mode 100644 index 000000000..ae92aa11d --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java @@ -0,0 +1,8 @@ +package com.sap.ai.sdk.grounding; + +import com.sap.ai.sdk.core.common.ClientException; +import lombok.experimental.StandardException; + +/** Generic exception for errors occurring when using OpenAI foundation models. */ +@StandardException +public class GroundingClientException extends ClientException {} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java new file mode 100644 index 000000000..db40fa4cb --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java @@ -0,0 +1,410 @@ +package com.sap.ai.sdk.grounding.api; + +import com.google.common.annotations.Beta; +import com.sap.ai.sdk.grounding.model.Pipeline; +import com.sap.ai.sdk.grounding.model.PipelineId; +import com.sap.ai.sdk.grounding.model.PipelinePostRequst; +import com.sap.ai.sdk.grounding.model.PipelineStatus; +import com.sap.ai.sdk.grounding.model.Pipelines; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Document Grounding Pipeline API in version 0.1.0. + * + *

SAP AI Core - API Specification AI Data Management api's + */ +@Beta +public class PipelinesApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * + * @param httpDestination The destination that API should be used with + */ + public PipelinesApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public PipelinesApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Create a pipeline + * + *

201 - Returns pipelineId on successful creation. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelinePostRequst The value for the parameter pipelinePostRequst + * @return PipelineId + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PipelineId createPipeline( + @Nonnull final String aiResourceGroup, @Nonnull final PipelinePostRequst pipelinePostRequst) + throws OpenApiRequestException { + final Object localVarPostBody = pipelinePostRequst; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createPipeline"); + } + + // verify the required parameter 'pipelinePostRequst' is set + if (pipelinePostRequst == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelinePostRequst' when calling pipelineV1PipelineEndpointsCreatePipeline"); + } + + final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Delete a pipeline by pipeline id + * + *

204 - No Content + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelineId The ID of the pipeline to delete. + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse deletePipelineById( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deletePipelineById"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling deletePipelineById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.DELETE, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Get all pipelines + * + *

200 - Returns all pipelines for the tenant. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return Pipelines + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Pipelines getAllPipelines( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllPipelines"); + } + + final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get all pipelines + * + *

200 - Returns all pipelines for the tenant. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @return Pipelines + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Pipelines getAllPipelines(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getAllPipelines(aiResourceGroup, null, null, null); + } + + /** + * Get details of a pipeline by pipeline id + * + *

200 - Returns the pipeline for an pipelineId + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelineId The ID of the pipeline to get. + * @return Pipeline + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Pipeline getPipelineById( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getPipelineById"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getPipelineById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get pipeline status by pipeline id + * + *

200 - Returns the pipeline status for an pipelineId. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelineId The ID of the pipeline to get status. + * @return PipelineStatus + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PipelineStatus getPipelineStatus( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatus"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getPipelineStatus"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/status") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java new file mode 100644 index 000000000..40f040089 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java @@ -0,0 +1,287 @@ +package com.sap.ai.sdk.grounding.api; + +import com.google.common.annotations.Beta; +import com.sap.ai.sdk.grounding.model.DataRepositories; +import com.sap.ai.sdk.grounding.model.DataRepository; +import com.sap.ai.sdk.grounding.model.RetievalSearchResults; +import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Document Grounding Pipeline API in version 0.1.0. + * + *

SAP AI Core - API Specification AI Data Management api's + */ +@Beta +public class RetrievalApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * + * @param httpDestination The destination that API should be used with + */ + public RetrievalApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public RetrievalApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * List all DataRepository objects. + * + *

List all DataRepository objects. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return DataRepositories + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DataRepositories getDataRepositories( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDataRepositories"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/retrieval/dataRepositories").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * List all DataRepository objects. + * + *

List all DataRepository objects. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @return DataRepositories + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DataRepositories getDataRepositories(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getDataRepositories(aiResourceGroup, null, null, null); + } + + /** + * List single DataRepository object. + * + *

List single DataRepository object. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + *

404 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param repositoryId The value for the parameter repositoryId + * @return DataRepository + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DataRepository getDataRepositoryById( + @Nonnull final String aiResourceGroup, @Nonnull final UUID repositoryId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDataRepositoryById"); + } + + // verify the required parameter 'repositoryId' is set + if (repositoryId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'repositoryId' when calling getDataRepositoryById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("repositoryId", repositoryId); + final String localVarPath = + UriComponentsBuilder.fromPath("/retrieval/dataRepositories/{repositoryId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Retrieve relevant content given a query string. + * + *

Retrieve relevant content given a query string. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param retrievalSearchInput The value for the parameter retrievalSearchInput + * @return RetievalSearchResults + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public RetievalSearchResults search( + @Nonnull final String aiResourceGroup, + @Nonnull final RetrievalSearchInput retrievalSearchInput) + throws OpenApiRequestException { + final Object localVarPostBody = retrievalSearchInput; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling search"); + } + + // verify the required parameter 'retrievalSearchInput' is set + if (retrievalSearchInput == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'retrievalSearchInput' when calling retrievalV1RetrievalEndpointsSearch"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/retrieval/search").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java new file mode 100644 index 000000000..6f03b3b8a --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java @@ -0,0 +1,1052 @@ +package com.sap.ai.sdk.grounding.api; + +import com.google.common.annotations.Beta; +import com.sap.ai.sdk.grounding.model.Collection; +import com.sap.ai.sdk.grounding.model.CollectionRequest; +import com.sap.ai.sdk.grounding.model.CollectionsListResponse; +import com.sap.ai.sdk.grounding.model.DocumentCreateRequest; +import com.sap.ai.sdk.grounding.model.DocumentResponse; +import com.sap.ai.sdk.grounding.model.DocumentUpdateRequest; +import com.sap.ai.sdk.grounding.model.Documents; +import com.sap.ai.sdk.grounding.model.DocumentsListResponse; +import com.sap.ai.sdk.grounding.model.SearchResults; +import com.sap.ai.sdk.grounding.model.TextSearchRequest; +import com.sap.ai.sdk.grounding.model.VectorV1VectorEndpointsGetCollectionCreationStatus200Response; +import com.sap.ai.sdk.grounding.model.VectorV1VectorEndpointsGetCollectionDeletionStatus200Response; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Document Grounding Pipeline API in version 0.1.0. + * + *

SAP AI Core - API Specification AI Data Management api's + */ +@Beta +public class VectorApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * + * @param httpDestination The destination that API should be used with + */ + public VectorApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public VectorApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Create collection + * + *

Creates a collection. This operation is asynchronous. Poll the collection resource and check + * the status field to understand creation status. + * + *

202 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionRequest The value for the parameter collectionRequest + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse createCollection( + @Nonnull final String aiResourceGroup, @Nonnull final CollectionRequest collectionRequest) + throws OpenApiRequestException { + final Object localVarPostBody = collectionRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createCollection"); + } + + // verify the required parameter 'collectionRequest' is set + if (collectionRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionRequest' when calling vectorV1VectorEndpointsCreateCollection"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Create documents in collection + * + *

Create and stores one or multiple documents into a collection. If omitted, 'id' will + * be auto-generated. + * + *

201 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentCreateRequest The value for the parameter documentCreateRequest + * @return DocumentsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsListResponse createDocuments( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final DocumentCreateRequest documentCreateRequest) + throws OpenApiRequestException { + final Object localVarPostBody = documentCreateRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createDocuments"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling createDocuments"); + } + + // verify the required parameter 'documentCreateRequest' is set + if (documentCreateRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentCreateRequest' when calling vectorV1VectorEndpointsCreateDocuments"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Delete collection by ID + * + *

Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for + * a 404 status code. + * + *

202 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse deleteCollectionById( + @Nonnull final String aiResourceGroup, @Nonnull final String collectionId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteCollectionById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling deleteCollectionById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.DELETE, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Delete a document + * + *

Deletes a specific document of a collection. + * + *

204 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentId The value for the parameter documentId + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse deleteDocumentById( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final UUID documentId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteDocumentById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling deleteDocumentById"); + } + + // verify the required parameter 'documentId' is set + if (documentId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentId' when calling deleteDocumentById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + localVarPathParams.put("documentId", documentId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents/{documentId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.DELETE, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Get collections + * + *

Gets a list of collections. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return CollectionsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CollectionsListResponse getAllCollections( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllCollections"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get collections + * + *

Gets a list of collections. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @return CollectionsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CollectionsListResponse getAllCollections(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getAllCollections(aiResourceGroup, null, null, null); + } + + /** + * Get documents + * + *

Gets a list of documents of a collection. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param collectionId (required) The value for the parameter collectionId + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return Documents + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Documents getAllDocuments( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllDocuments"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling getAllDocuments"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get documents + * + *

Gets a list of documents of a collection. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @return Documents + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Documents getAllDocuments( + @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) + throws OpenApiRequestException { + return getAllDocuments(aiResourceGroup, collectionId, null, null, null); + } + + /** + * Get collection by ID + * + *

Gets a specific collection by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @return Collection + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Collection getCollectionById( + @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getCollectionById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling getCollectionById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get collection status by ID + * + *

Gets a specific collection status from monitor by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param id The value for the parameter id + * @return VectorV1VectorEndpointsGetCollectionCreationStatus200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionCreationStatus( + @Nonnull final String aiResourceGroup, @Nonnull final UUID id) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getCollectionCreationStatus"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'id' when calling getCollectionCreationStatus"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("id", id); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{id}/creationStatus") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference + localVarReturnType = + new ParameterizedTypeReference< + VectorV1VectorEndpointsGetCollectionCreationStatus200Response>() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get collection status by ID + * + *

Gets a specific collection status from monitor by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param id The value for the parameter id + * @return VectorV1VectorEndpointsGetCollectionDeletionStatus200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response getCollectionDeletionStatus( + @Nonnull final String aiResourceGroup, @Nonnull final UUID id) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getCollectionDeletionStatus"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'id' when calling getCollectionDeletionStatus"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("id", id); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{id}/deletionStatus") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference + localVarReturnType = + new ParameterizedTypeReference< + VectorV1VectorEndpointsGetCollectionDeletionStatus200Response>() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get document by ID + * + *

Gets a specific document in a collection by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentId The value for the parameter documentId + * @return DocumentResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentResponse getDocumentById( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final UUID documentId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDocumentById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling getDocumentById"); + } + + // verify the required parameter 'documentId' is set + if (documentId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentId' when calling getDocumentById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + localVarPathParams.put("documentId", documentId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents/{documentId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Search chunk by vector + * + *

Search chunk by vector + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param textSearchRequest The value for the parameter textSearchRequest + * @return SearchResults + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public SearchResults search( + @Nonnull final String aiResourceGroup, @Nonnull final TextSearchRequest textSearchRequest) + throws OpenApiRequestException { + final Object localVarPostBody = textSearchRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling search"); + } + + // verify the required parameter 'textSearchRequest' is set + if (textSearchRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'textSearchRequest' when calling vectorV1VectorEndpointsSearch"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/search").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Upsert documents in collection + * + *

Upserts the data of multiple documents into a collection. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentUpdateRequest The value for the parameter documentUpdateRequest + * @return DocumentsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsListResponse updateDocuments( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final DocumentUpdateRequest documentUpdateRequest) + throws OpenApiRequestException { + final Object localVarPostBody = documentUpdateRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling updateDocuments"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling updateDocuments"); + } + + // verify the required parameter 'documentUpdateRequest' is set + if (documentUpdateRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentUpdateRequest' when calling vectorV1VectorEndpointsUpdateDocuments"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.PATCH, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java new file mode 100644 index 000000000..f9ff2453f --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java @@ -0,0 +1,342 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ApiError */ +@Beta // CHECKSTYLE:OFF +public class ApiError +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonProperty("requestId") + private String requestId; + + @JsonProperty("target") + private String target; + + @JsonProperty("details") + private List details = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ApiError. */ + protected ApiError() {} + + /** + * Set the code of this {@link ApiError} instance and return the same instance. + * + * @param code Descriptive error code (not http status code). + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError code(@Nonnull final String code) { + this.code = code; + return this; + } + + /** + * Descriptive error code (not http status code). + * + * @return code The code of this {@link ApiError} instance. + */ + @Nonnull + public String getCode() { + return code; + } + + /** + * Set the code of this {@link ApiError} instance. + * + * @param code Descriptive error code (not http status code). + */ + public void setCode(@Nonnull final String code) { + this.code = code; + } + + /** + * Set the message of this {@link ApiError} instance and return the same instance. + * + * @param message plaintext error description + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * plaintext error description + * + * @return message The message of this {@link ApiError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link ApiError} instance. + * + * @param message plaintext error description + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Set the requestId of this {@link ApiError} instance and return the same instance. + * + * @param requestId id of individual request + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError requestId(@Nullable final String requestId) { + this.requestId = requestId; + return this; + } + + /** + * id of individual request + * + * @return requestId The requestId of this {@link ApiError} instance. + */ + @Nonnull + public String getRequestId() { + return requestId; + } + + /** + * Set the requestId of this {@link ApiError} instance. + * + * @param requestId id of individual request + */ + public void setRequestId(@Nullable final String requestId) { + this.requestId = requestId; + } + + /** + * Set the target of this {@link ApiError} instance and return the same instance. + * + * @param target url that has been called + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError target(@Nullable final String target) { + this.target = target; + return this; + } + + /** + * url that has been called + * + * @return target The target of this {@link ApiError} instance. + */ + @Nonnull + public String getTarget() { + return target; + } + + /** + * Set the target of this {@link ApiError} instance. + * + * @param target url that has been called + */ + public void setTarget(@Nullable final String target) { + this.target = target; + } + + /** + * Set the details of this {@link ApiError} instance and return the same instance. + * + * @param details The details of this {@link ApiError} + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError details(@Nullable final List details) { + this.details = details; + return this; + } + + /** + * Add one details instance to this {@link ApiError}. + * + * @param detailsItem The details that should be added + * @return The same instance of type {@link ApiError} + */ + @Nonnull + public ApiError addDetailsItem(@Nonnull final DetailsErrorResponse detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * Get details + * + * @return details The details of this {@link ApiError} instance. + */ + @Nonnull + public List getDetails() { + return details; + } + + /** + * Set the details of this {@link ApiError} instance. + * + * @param details The details of this {@link ApiError} + */ + public void setDetails(@Nullable final List details) { + this.details = details; + } + + /** + * Get the names of the unrecognizable properties of the {@link ApiError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ApiError} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ApiError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ApiError} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ApiError apiError = (ApiError) o; + return Objects.equals(this.cloudSdkCustomFields, apiError.cloudSdkCustomFields) + && Objects.equals(this.code, apiError.code) + && Objects.equals(this.message, apiError.message) + && Objects.equals(this.requestId, apiError.requestId) + && Objects.equals(this.target, apiError.target) + && Objects.equals(this.details, apiError.details); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, requestId, target, details, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ApiError {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ApiError} instance with + * all required arguments. + */ + public static Builder create() { + return (code) -> (message) -> new ApiError().code(code).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link ApiError} instance. + * + * @param code Descriptive error code (not http status code). + * @return The ApiError builder. + */ + Builder1 code(@Nonnull final String code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link ApiError} instance. + * + * @param message plaintext error description + * @return The ApiError instance. + */ + ApiError message(@Nonnull final String message); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java new file mode 100644 index 000000000..3afa483e0 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java @@ -0,0 +1,275 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Base class for documents, document requests and responses. */ +@Beta // CHECKSTYLE:OFF +public class BaseDocument extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for BaseDocument. */ + protected BaseDocument() { + super(); + } + + /** + * Set the chunks of this {@link BaseDocument} instance and return the same instance. + * + * @param chunks The chunks of this {@link BaseDocument} + * @return The same instance of this {@link BaseDocument} class + */ + @Nonnull + public BaseDocument chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link BaseDocument}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link BaseDocument} + */ + @Nonnull + public BaseDocument addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link BaseDocument} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link BaseDocument} instance. + * + * @param chunks The chunks of this {@link BaseDocument} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Set the metadata of this {@link BaseDocument} instance and return the same instance. + * + * @param metadata The metadata of this {@link BaseDocument} + * @return The same instance of this {@link BaseDocument} class + */ + @Nonnull + public BaseDocument metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link BaseDocument}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link BaseDocument} + */ + @Nonnull + public BaseDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link BaseDocument} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link BaseDocument} instance. + * + * @param metadata The metadata of this {@link BaseDocument} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link BaseDocument}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link BaseDocument} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("BaseDocument has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link BaseDocument} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final BaseDocument baseDocument = (BaseDocument) o; + return Objects.equals(this.cloudSdkCustomFields, baseDocument.cloudSdkCustomFields) + && Objects.equals(this.chunks, baseDocument.chunks) + && Objects.equals(this.metadata, baseDocument.metadata) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(chunks, metadata, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class BaseDocument {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link BaseDocument} instance + * with all required arguments. + */ + public static Builder create() { + return (chunks) -> (metadata) -> new BaseDocument().chunks(chunks).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the chunks of this {@link BaseDocument} instance. + * + * @param chunks The chunks of this {@link BaseDocument} + * @return The BaseDocument builder. + */ + Builder1 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link BaseDocument} instance. + * + * @param chunks The chunks of this {@link BaseDocument} + * @return The BaseDocument builder. + */ + default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link BaseDocument} instance. + * + * @param metadata The metadata of this {@link BaseDocument} + * @return The BaseDocument instance. + */ + BaseDocument metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link BaseDocument} instance. + * + * @param metadata The metadata of this {@link BaseDocument} + * @return The BaseDocument instance. + */ + default BaseDocument metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java new file mode 100644 index 000000000..ea29dedd8 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java @@ -0,0 +1,270 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Chunk */ +@Beta // CHECKSTYLE:OFF +public class Chunk +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("content") + private String content; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Chunk. */ + protected Chunk() {} + + /** + * Set the id of this {@link Chunk} instance and return the same instance. + * + * @param id The id of this {@link Chunk} + * @return The same instance of this {@link Chunk} class + */ + @Nonnull + public Chunk id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link Chunk} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link Chunk} instance. + * + * @param id The id of this {@link Chunk} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the content of this {@link Chunk} instance and return the same instance. + * + * @param content The content of this {@link Chunk} + * @return The same instance of this {@link Chunk} class + */ + @Nonnull + public Chunk content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link Chunk} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link Chunk} instance. + * + * @param content The content of this {@link Chunk} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the metadata of this {@link Chunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link Chunk} + * @return The same instance of this {@link Chunk} class + */ + @Nonnull + public Chunk metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link Chunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link Chunk} + */ + @Nonnull + public Chunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link Chunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link Chunk} instance. + * + * @param metadata The metadata of this {@link Chunk} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link Chunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Chunk} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Chunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Chunk} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Chunk chunk = (Chunk) o; + return Objects.equals(this.cloudSdkCustomFields, chunk.cloudSdkCustomFields) + && Objects.equals(this.id, chunk.id) + && Objects.equals(this.content, chunk.content) + && Objects.equals(this.metadata, chunk.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(id, content, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Chunk {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Chunk} instance with + * all required arguments. + */ + public static Builder create() { + return (id) -> (content) -> new Chunk().id(id).content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link Chunk} instance. + * + * @param id The id of this {@link Chunk} + * @return The Chunk builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the content of this {@link Chunk} instance. + * + * @param content The content of this {@link Chunk} + * @return The Chunk instance. + */ + Chunk content(@Nonnull final String content); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java new file mode 100644 index 000000000..a5026e3c3 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java @@ -0,0 +1,309 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A logical grouping of content. */ +@Beta // CHECKSTYLE:OFF +public class Collection +// CHECKSTYLE:ON +{ + @JsonProperty("title") + private String title; + + @JsonProperty("embeddingConfig") + private EmbeddingConfig embeddingConfig; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Collection. */ + protected Collection() {} + + /** + * Set the title of this {@link Collection} instance and return the same instance. + * + * @param title The title of this {@link Collection} + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection title(@Nullable final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link Collection} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link Collection} instance. + * + * @param title The title of this {@link Collection} + */ + public void setTitle(@Nullable final String title) { + this.title = title; + } + + /** + * Set the embeddingConfig of this {@link Collection} instance and return the same instance. + * + * @param embeddingConfig The embeddingConfig of this {@link Collection} + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + return this; + } + + /** + * Get embeddingConfig + * + * @return embeddingConfig The embeddingConfig of this {@link Collection} instance. + */ + @Nonnull + public EmbeddingConfig getEmbeddingConfig() { + return embeddingConfig; + } + + /** + * Set the embeddingConfig of this {@link Collection} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link Collection} + */ + public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + } + + /** + * Set the metadata of this {@link Collection} instance and return the same instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link Collection}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link Collection} + */ + @Nonnull + public Collection addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to collection. Useful to restrict search to a subset of collections. + * + * @return metadata The metadata of this {@link Collection} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link Collection} instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link Collection} instance and return the same instance. + * + * @param id Unique identifier of a collection. + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a collection. + * + * @return id The id of this {@link Collection} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link Collection} instance. + * + * @param id Unique identifier of a collection. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link Collection}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Collection} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Collection has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Collection} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Collection collection = (Collection) o; + return Objects.equals(this.cloudSdkCustomFields, collection.cloudSdkCustomFields) + && Objects.equals(this.title, collection.title) + && Objects.equals(this.embeddingConfig, collection.embeddingConfig) + && Objects.equals(this.metadata, collection.metadata) + && Objects.equals(this.id, collection.id); + } + + @Override + public int hashCode() { + return Objects.hash(title, embeddingConfig, metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Collection {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Collection} instance + * with all required arguments. + */ + public static Builder create() { + return (embeddingConfig) -> (id) -> new Collection().embeddingConfig(embeddingConfig).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the embeddingConfig of this {@link Collection} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link Collection} + * @return The Collection builder. + */ + Builder1 embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link Collection} instance. + * + * @param id Unique identifier of a collection. + * @return The Collection instance. + */ + Collection id(@Nonnull final UUID id); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java new file mode 100644 index 000000000..1915a6c2c --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java @@ -0,0 +1,221 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CollectionCreatedResponse */ +@Beta // CHECKSTYLE:OFF +public class CollectionCreatedResponse + implements VectorV1VectorEndpointsGetCollectionCreationStatus200Response +// CHECKSTYLE:ON +{ + @JsonProperty("collectionURL") + private String collectionURL; + + @JsonProperty("status") + private String status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionCreatedResponse. */ + protected CollectionCreatedResponse() {} + + /** + * Set the collectionURL of this {@link CollectionCreatedResponse} instance and return the same + * instance. + * + * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} + * @return The same instance of this {@link CollectionCreatedResponse} class + */ + @Nonnull + public CollectionCreatedResponse collectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + return this; + } + + /** + * Get collectionURL + * + * @return collectionURL The collectionURL of this {@link CollectionCreatedResponse} instance. + */ + @Nonnull + public String getCollectionURL() { + return collectionURL; + } + + /** + * Set the collectionURL of this {@link CollectionCreatedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} + */ + public void setCollectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + } + + /** + * Set the status of this {@link CollectionCreatedResponse} instance and return the same instance. + * + * @param status The status of this {@link CollectionCreatedResponse} + * @return The same instance of this {@link CollectionCreatedResponse} class + */ + @Nonnull + public CollectionCreatedResponse status(@Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link CollectionCreatedResponse} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link CollectionCreatedResponse} instance. + * + * @param status The status of this {@link CollectionCreatedResponse} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionCreatedResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionCreatedResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionCreatedResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionCreatedResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionCreatedResponse collectionCreatedResponse = (CollectionCreatedResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionCreatedResponse.cloudSdkCustomFields) + && Objects.equals(this.collectionURL, collectionCreatedResponse.collectionURL) + && Objects.equals(this.status, collectionCreatedResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(collectionURL, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionCreatedResponse {\n"); + sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionCreatedResponse} instance with all required arguments. + */ + public static Builder create() { + return (collectionURL) -> + (status) -> new CollectionCreatedResponse().collectionURL(collectionURL).status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the collectionURL of this {@link CollectionCreatedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} + * @return The CollectionCreatedResponse builder. + */ + Builder1 collectionURL(@Nonnull final String collectionURL); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link CollectionCreatedResponse} instance. + * + * @param status The status of this {@link CollectionCreatedResponse} + * @return The CollectionCreatedResponse instance. + */ + CollectionCreatedResponse status(@Nonnull final String status); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java new file mode 100644 index 000000000..03e3b2db2 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java @@ -0,0 +1,221 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CollectionDeletedResponse */ +@Beta // CHECKSTYLE:OFF +public class CollectionDeletedResponse + implements VectorV1VectorEndpointsGetCollectionDeletionStatus200Response +// CHECKSTYLE:ON +{ + @JsonProperty("collectionURL") + private String collectionURL; + + @JsonProperty("status") + private String status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionDeletedResponse. */ + protected CollectionDeletedResponse() {} + + /** + * Set the collectionURL of this {@link CollectionDeletedResponse} instance and return the same + * instance. + * + * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} + * @return The same instance of this {@link CollectionDeletedResponse} class + */ + @Nonnull + public CollectionDeletedResponse collectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + return this; + } + + /** + * Get collectionURL + * + * @return collectionURL The collectionURL of this {@link CollectionDeletedResponse} instance. + */ + @Nonnull + public String getCollectionURL() { + return collectionURL; + } + + /** + * Set the collectionURL of this {@link CollectionDeletedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} + */ + public void setCollectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + } + + /** + * Set the status of this {@link CollectionDeletedResponse} instance and return the same instance. + * + * @param status The status of this {@link CollectionDeletedResponse} + * @return The same instance of this {@link CollectionDeletedResponse} class + */ + @Nonnull + public CollectionDeletedResponse status(@Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link CollectionDeletedResponse} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link CollectionDeletedResponse} instance. + * + * @param status The status of this {@link CollectionDeletedResponse} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionDeletedResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionDeletedResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionDeletedResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionDeletedResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionDeletedResponse collectionDeletedResponse = (CollectionDeletedResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionDeletedResponse.cloudSdkCustomFields) + && Objects.equals(this.collectionURL, collectionDeletedResponse.collectionURL) + && Objects.equals(this.status, collectionDeletedResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(collectionURL, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionDeletedResponse {\n"); + sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionDeletedResponse} instance with all required arguments. + */ + public static Builder create() { + return (collectionURL) -> + (status) -> new CollectionDeletedResponse().collectionURL(collectionURL).status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the collectionURL of this {@link CollectionDeletedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} + * @return The CollectionDeletedResponse builder. + */ + Builder1 collectionURL(@Nonnull final String collectionURL); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link CollectionDeletedResponse} instance. + * + * @param status The status of this {@link CollectionDeletedResponse} + * @return The CollectionDeletedResponse instance. + */ + CollectionDeletedResponse status(@Nonnull final String status); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java new file mode 100644 index 000000000..4f7a09a85 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java @@ -0,0 +1,223 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CollectionPendingResponse */ +@Beta // CHECKSTYLE:OFF +public class CollectionPendingResponse + implements VectorV1VectorEndpointsGetCollectionCreationStatus200Response, + VectorV1VectorEndpointsGetCollectionDeletionStatus200Response +// CHECKSTYLE:ON +{ + @JsonProperty("Location") + private URI location; + + @JsonProperty("status") + private String status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionPendingResponse. */ + protected CollectionPendingResponse() {} + + /** + * Set the location of this {@link CollectionPendingResponse} instance and return the same + * instance. + * + * @param location The location of this {@link CollectionPendingResponse} + * @return The same instance of this {@link CollectionPendingResponse} class + */ + @Nonnull + public CollectionPendingResponse location(@Nonnull final URI location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location The location of this {@link CollectionPendingResponse} instance. + */ + @Nonnull + public URI getLocation() { + return location; + } + + /** + * Set the location of this {@link CollectionPendingResponse} instance. + * + * @param location The location of this {@link CollectionPendingResponse} + */ + public void setLocation(@Nonnull final URI location) { + this.location = location; + } + + /** + * Set the status of this {@link CollectionPendingResponse} instance and return the same instance. + * + * @param status The status of this {@link CollectionPendingResponse} + * @return The same instance of this {@link CollectionPendingResponse} class + */ + @Nonnull + public CollectionPendingResponse status(@Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link CollectionPendingResponse} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link CollectionPendingResponse} instance. + * + * @param status The status of this {@link CollectionPendingResponse} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionPendingResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionPendingResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionPendingResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionPendingResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionPendingResponse collectionPendingResponse = (CollectionPendingResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionPendingResponse.cloudSdkCustomFields) + && Objects.equals(this.location, collectionPendingResponse.location) + && Objects.equals(this.status, collectionPendingResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(location, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionPendingResponse {\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionPendingResponse} instance with all required arguments. + */ + public static Builder create() { + return (location) -> + (status) -> new CollectionPendingResponse().location(location).status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the location of this {@link CollectionPendingResponse} instance. + * + * @param location The location of this {@link CollectionPendingResponse} + * @return The CollectionPendingResponse builder. + */ + Builder1 location(@Nonnull final URI location); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link CollectionPendingResponse} instance. + * + * @param status The status of this {@link CollectionPendingResponse} + * @return The CollectionPendingResponse instance. + */ + CollectionPendingResponse status(@Nonnull final String status); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java new file mode 100644 index 000000000..c3ae27559 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java @@ -0,0 +1,267 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A request for creating a new, single collection. */ +@Beta // CHECKSTYLE:OFF +public class CollectionRequest extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("title") + private String title; + + @JsonProperty("embeddingConfig") + private EmbeddingConfig embeddingConfig; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionRequest. */ + protected CollectionRequest() { + super(); + } + + /** + * Set the title of this {@link CollectionRequest} instance and return the same instance. + * + * @param title The title of this {@link CollectionRequest} + * @return The same instance of this {@link CollectionRequest} class + */ + @Nonnull + public CollectionRequest title(@Nullable final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link CollectionRequest} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link CollectionRequest} instance. + * + * @param title The title of this {@link CollectionRequest} + */ + public void setTitle(@Nullable final String title) { + this.title = title; + } + + /** + * Set the embeddingConfig of this {@link CollectionRequest} instance and return the same + * instance. + * + * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} + * @return The same instance of this {@link CollectionRequest} class + */ + @Nonnull + public CollectionRequest embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + return this; + } + + /** + * Get embeddingConfig + * + * @return embeddingConfig The embeddingConfig of this {@link CollectionRequest} instance. + */ + @Nonnull + public EmbeddingConfig getEmbeddingConfig() { + return embeddingConfig; + } + + /** + * Set the embeddingConfig of this {@link CollectionRequest} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} + */ + public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + } + + /** + * Set the metadata of this {@link CollectionRequest} instance and return the same instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + * @return The same instance of this {@link CollectionRequest} class + */ + @Nonnull + public CollectionRequest metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link CollectionRequest}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link CollectionRequest} + */ + @Nonnull + public CollectionRequest addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to collection. Useful to restrict search to a subset of collections. + * + * @return metadata The metadata of this {@link CollectionRequest} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link CollectionRequest} instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("CollectionRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionRequest collectionRequest = (CollectionRequest) o; + return Objects.equals(this.cloudSdkCustomFields, collectionRequest.cloudSdkCustomFields) + && Objects.equals(this.title, collectionRequest.title) + && Objects.equals(this.embeddingConfig, collectionRequest.embeddingConfig) + && Objects.equals(this.metadata, collectionRequest.metadata) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(title, embeddingConfig, metadata, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link CollectionRequest} + * instance with all required arguments. + */ + public static Builder create() { + return (embeddingConfig) -> new CollectionRequest().embeddingConfig(embeddingConfig); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the embeddingConfig of this {@link CollectionRequest} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} + * @return The CollectionRequest instance. + */ + CollectionRequest embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java new file mode 100644 index 000000000..e84cfb96c --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java @@ -0,0 +1,236 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing collections retrieved from the server. */ +@Beta // CHECKSTYLE:OFF +public class CollectionsListResponse +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionsListResponse. */ + protected CollectionsListResponse() {} + + /** + * Set the resources of this {@link CollectionsListResponse} instance and return the same + * instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + * @return The same instance of this {@link CollectionsListResponse} class + */ + @Nonnull + public CollectionsListResponse resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link CollectionsListResponse}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link CollectionsListResponse} + */ + @Nonnull + public CollectionsListResponse addResourcesItem(@Nonnull final Collection resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link CollectionsListResponse} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link CollectionsListResponse} instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link CollectionsListResponse} instance and return the same instance. + * + * @param count The count of this {@link CollectionsListResponse} + * @return The same instance of this {@link CollectionsListResponse} class + */ + @Nonnull + public CollectionsListResponse count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link CollectionsListResponse} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link CollectionsListResponse} instance. + * + * @param count The count of this {@link CollectionsListResponse} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionsListResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionsListResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionsListResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionsListResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionsListResponse collectionsListResponse = (CollectionsListResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionsListResponse.cloudSdkCustomFields) + && Objects.equals(this.resources, collectionsListResponse.resources) + && Objects.equals(this.count, collectionsListResponse.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionsListResponse {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionsListResponse} instance with all required arguments. + */ + public static Builder create() { + return (resources) -> new CollectionsListResponse().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link CollectionsListResponse} instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + * @return The CollectionsListResponse instance. + */ + CollectionsListResponse resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link CollectionsListResponse} instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + * @return The CollectionsListResponse instance. + */ + default CollectionsListResponse resources(@Nonnull final Collection... resources) { + return resources(Arrays.asList(resources)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java new file mode 100644 index 000000000..b3588223a --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java @@ -0,0 +1,234 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DataRepositories */ +@Beta // CHECKSTYLE:OFF +public class DataRepositories +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DataRepositories. */ + protected DataRepositories() {} + + /** + * Set the resources of this {@link DataRepositories} instance and return the same instance. + * + * @param resources The resources of this {@link DataRepositories} + * @return The same instance of this {@link DataRepositories} class + */ + @Nonnull + public DataRepositories resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link DataRepositories}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link DataRepositories} + */ + @Nonnull + public DataRepositories addResourcesItem(@Nonnull final DataRepository resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link DataRepositories} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link DataRepositories} instance. + * + * @param resources The resources of this {@link DataRepositories} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link DataRepositories} instance and return the same instance. + * + * @param count The count of this {@link DataRepositories} + * @return The same instance of this {@link DataRepositories} class + */ + @Nonnull + public DataRepositories count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link DataRepositories} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link DataRepositories} instance. + * + * @param count The count of this {@link DataRepositories} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link DataRepositories}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DataRepositories} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DataRepositories has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DataRepositories} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DataRepositories dataRepositories = (DataRepositories) o; + return Objects.equals(this.cloudSdkCustomFields, dataRepositories.cloudSdkCustomFields) + && Objects.equals(this.resources, dataRepositories.resources) + && Objects.equals(this.count, dataRepositories.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DataRepositories {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DataRepositories} + * instance with all required arguments. + */ + public static Builder create() { + return (resources) -> new DataRepositories().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link DataRepositories} instance. + * + * @param resources The resources of this {@link DataRepositories} + * @return The DataRepositories instance. + */ + DataRepositories resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link DataRepositories} instance. + * + * @param resources The resources of this {@link DataRepositories} + * @return The DataRepositories instance. + */ + default DataRepositories resources(@Nonnull final DataRepository... resources) { + return resources(Arrays.asList(resources)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java new file mode 100644 index 000000000..d33ed21f3 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java @@ -0,0 +1,321 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DataRepository schema expected by Retrieval. */ +@Beta // CHECKSTYLE:OFF +public class DataRepository +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("type") + private DataRepositoryType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DataRepository. */ + protected DataRepository() {} + + /** + * Set the id of this {@link DataRepository} instance and return the same instance. + * + * @param id Unique identifier of this DataRepository. + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of this DataRepository. + * + * @return id The id of this {@link DataRepository} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DataRepository} instance. + * + * @param id Unique identifier of this DataRepository. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the title of this {@link DataRepository} instance and return the same instance. + * + * @param title The title of this {@link DataRepository} + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository title(@Nonnull final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DataRepository} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DataRepository} instance. + * + * @param title The title of this {@link DataRepository} + */ + public void setTitle(@Nonnull final String title) { + this.title = title; + } + + /** + * Set the metadata of this {@link DataRepository} instance and return the same instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DataRepository}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DataRepository} + */ + @Nonnull + public DataRepository addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to DataRepository. Useful to later limit search to a subset of + * DataRepositories. + * + * @return metadata The metadata of this {@link DataRepository} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DataRepository} instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the type of this {@link DataRepository} instance and return the same instance. + * + * @param type The type of this {@link DataRepository} + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository type(@Nullable final DataRepositoryType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link DataRepository} instance. + */ + @Nullable + public DataRepositoryType getType() { + return type; + } + + /** + * Set the type of this {@link DataRepository} instance. + * + * @param type The type of this {@link DataRepository} + */ + public void setType(@Nullable final DataRepositoryType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link DataRepository}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DataRepository} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DataRepository has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DataRepository} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DataRepository dataRepository = (DataRepository) o; + return Objects.equals(this.cloudSdkCustomFields, dataRepository.cloudSdkCustomFields) + && Objects.equals(this.id, dataRepository.id) + && Objects.equals(this.title, dataRepository.title) + && Objects.equals(this.metadata, dataRepository.metadata) + && Objects.equals(this.type, dataRepository.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, metadata, type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DataRepository {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DataRepository} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> (title) -> (type) -> new DataRepository().id(id).title(title).type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DataRepository} instance. + * + * @param id Unique identifier of this DataRepository. + * @return The DataRepository builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the title of this {@link DataRepository} instance. + * + * @param title The title of this {@link DataRepository} + * @return The DataRepository builder. + */ + Builder2 title(@Nonnull final String title); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the type of this {@link DataRepository} instance. + * + * @param type The type of this {@link DataRepository} + * @return The DataRepository instance. + */ + DataRepository type(@Nullable final DataRepositoryType type); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java new file mode 100644 index 000000000..1599d4fbd --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java @@ -0,0 +1,63 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets DataRepositoryType */ +public enum DataRepositoryType { + VECTOR("vector"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + DataRepositoryType(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static DataRepositoryType fromValue(@Nonnull final String value) { + for (final DataRepositoryType b : DataRepositoryType.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java new file mode 100644 index 000000000..60320cb72 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java @@ -0,0 +1,357 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DataRepository schema returned by the Vector search endpoint */ +@Beta // CHECKSTYLE:OFF +public class DataRepositoryWithDocuments +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DataRepositoryWithDocuments. */ + protected DataRepositoryWithDocuments() {} + + /** + * Set the id of this {@link DataRepositoryWithDocuments} instance and return the same instance. + * + * @param id Unique identifier of this DataRepository. + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of this DataRepository. + * + * @return id The id of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DataRepositoryWithDocuments} instance. + * + * @param id Unique identifier of this DataRepository. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the title of this {@link DataRepositoryWithDocuments} instance and return the same + * instance. + * + * @param title The title of this {@link DataRepositoryWithDocuments} + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments title(@Nonnull final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DataRepositoryWithDocuments} instance. + * + * @param title The title of this {@link DataRepositoryWithDocuments} + */ + public void setTitle(@Nonnull final String title) { + this.title = title; + } + + /** + * Set the metadata of this {@link DataRepositoryWithDocuments} instance and return the same + * instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DataRepositoryWithDocuments}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DataRepositoryWithDocuments} + */ + @Nonnull + public DataRepositoryWithDocuments addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to DataRepository. Useful to later limit search to a subset of + * DataRepositories. + * + * @return metadata The metadata of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DataRepositoryWithDocuments} instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance and return the same + * instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DataRepositoryWithDocuments}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DataRepositoryWithDocuments} + */ + @Nonnull + public DataRepositoryWithDocuments addDocumentsItem( + @Nonnull final RetrievalDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DataRepositoryWithDocuments}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DataRepositoryWithDocuments} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DataRepositoryWithDocuments has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DataRepositoryWithDocuments} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DataRepositoryWithDocuments dataRepositoryWithDocuments = (DataRepositoryWithDocuments) o; + return Objects.equals( + this.cloudSdkCustomFields, dataRepositoryWithDocuments.cloudSdkCustomFields) + && Objects.equals(this.id, dataRepositoryWithDocuments.id) + && Objects.equals(this.title, dataRepositoryWithDocuments.title) + && Objects.equals(this.metadata, dataRepositoryWithDocuments.metadata) + && Objects.equals(this.documents, dataRepositoryWithDocuments.documents); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, metadata, documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DataRepositoryWithDocuments {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * DataRepositoryWithDocuments} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (title) -> + (documents) -> + new DataRepositoryWithDocuments().id(id).title(title).documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DataRepositoryWithDocuments} instance. + * + * @param id Unique identifier of this DataRepository. + * @return The DataRepositoryWithDocuments builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the title of this {@link DataRepositoryWithDocuments} instance. + * + * @param title The title of this {@link DataRepositoryWithDocuments} + * @return The DataRepositoryWithDocuments builder. + */ + Builder2 title(@Nonnull final String title); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + * @return The DataRepositoryWithDocuments instance. + */ + DataRepositoryWithDocuments documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + * @return The DataRepositoryWithDocuments instance. + */ + default DataRepositoryWithDocuments documents(@Nonnull final RetrievalDocument... documents) { + return documents(Arrays.asList(documents)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java new file mode 100644 index 000000000..1814eb110 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java @@ -0,0 +1,193 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DetailsErrorResponse */ +@Beta // CHECKSTYLE:OFF +public class DetailsErrorResponse +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DetailsErrorResponse. */ + protected DetailsErrorResponse() {} + + /** + * Set the code of this {@link DetailsErrorResponse} instance and return the same instance. + * + * @param code Descriptive error code (not http status code) + * @return The same instance of this {@link DetailsErrorResponse} class + */ + @Nonnull + public DetailsErrorResponse code(@Nullable final String code) { + this.code = code; + return this; + } + + /** + * Descriptive error code (not http status code) + * + * @return code The code of this {@link DetailsErrorResponse} instance. + */ + @Nonnull + public String getCode() { + return code; + } + + /** + * Set the code of this {@link DetailsErrorResponse} instance. + * + * @param code Descriptive error code (not http status code) + */ + public void setCode(@Nullable final String code) { + this.code = code; + } + + /** + * Set the message of this {@link DetailsErrorResponse} instance and return the same instance. + * + * @param message Plaintext error description + * @return The same instance of this {@link DetailsErrorResponse} class + */ + @Nonnull + public DetailsErrorResponse message(@Nullable final String message) { + this.message = message; + return this; + } + + /** + * Plaintext error description + * + * @return message The message of this {@link DetailsErrorResponse} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link DetailsErrorResponse} instance. + * + * @param message Plaintext error description + */ + public void setMessage(@Nullable final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link DetailsErrorResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DetailsErrorResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DetailsErrorResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DetailsErrorResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DetailsErrorResponse detailsErrorResponse = (DetailsErrorResponse) o; + return Objects.equals(this.cloudSdkCustomFields, detailsErrorResponse.cloudSdkCustomFields) + && Objects.equals(this.code, detailsErrorResponse.code) + && Objects.equals(this.message, detailsErrorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DetailsErrorResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link DetailsErrorResponse} instance. No arguments are required. */ + public static DetailsErrorResponse create() { + return new DetailsErrorResponse(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java new file mode 100644 index 000000000..d76b4a3c9 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java @@ -0,0 +1,204 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A create request containing one or more new documents to create and store in a collection. */ +@Beta // CHECKSTYLE:OFF +public class DocumentCreateRequest extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentCreateRequest. */ + protected DocumentCreateRequest() { + super(); + } + + /** + * Set the documents of this {@link DocumentCreateRequest} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + * @return The same instance of this {@link DocumentCreateRequest} class + */ + @Nonnull + public DocumentCreateRequest documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentCreateRequest}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentCreateRequest} + */ + @Nonnull + public DocumentCreateRequest addDocumentsItem(@Nonnull final BaseDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentCreateRequest} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentCreateRequest} instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentCreateRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentCreateRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentCreateRequest documentCreateRequest = (DocumentCreateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, documentCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.documents, documentCreateRequest.documents) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(documents, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentCreateRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentCreateRequest} + * instance with all required arguments. + */ + public static Builder create() { + return (documents) -> new DocumentCreateRequest().documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the documents of this {@link DocumentCreateRequest} instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + * @return The DocumentCreateRequest instance. + */ + DocumentCreateRequest documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentCreateRequest} instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + * @return The DocumentCreateRequest instance. + */ + default DocumentCreateRequest documents(@Nonnull final BaseDocument... documents) { + return documents(Arrays.asList(documents)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java new file mode 100644 index 000000000..6070549ff --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java @@ -0,0 +1,324 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A single document stored in a collection by ID. */ +@Beta // CHECKSTYLE:OFF +public class DocumentInput extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentInput. */ + protected DocumentInput() { + super(); + } + + /** + * Set the chunks of this {@link DocumentInput} instance and return the same instance. + * + * @param chunks The chunks of this {@link DocumentInput} + * @return The same instance of this {@link DocumentInput} class + */ + @Nonnull + public DocumentInput chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link DocumentInput}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link DocumentInput} + */ + @Nonnull + public DocumentInput addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link DocumentInput} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link DocumentInput} instance. + * + * @param chunks The chunks of this {@link DocumentInput} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Set the metadata of this {@link DocumentInput} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentInput} + * @return The same instance of this {@link DocumentInput} class + */ + @Nonnull + public DocumentInput metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentInput}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentInput} + */ + @Nonnull + public DocumentInput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentInput} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentInput} instance. + * + * @param metadata The metadata of this {@link DocumentInput} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link DocumentInput} instance and return the same instance. + * + * @param id Unique identifier of a document. + * @return The same instance of this {@link DocumentInput} class + */ + @Nonnull + public DocumentInput id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a document. + * + * @return id The id of this {@link DocumentInput} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentInput} instance. + * + * @param id Unique identifier of a document. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentInput} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentInput} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentInput documentInput = (DocumentInput) o; + return Objects.equals(this.cloudSdkCustomFields, documentInput.cloudSdkCustomFields) + && Objects.equals(this.chunks, documentInput.chunks) + && Objects.equals(this.metadata, documentInput.metadata) + && Objects.equals(this.id, documentInput.id) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(chunks, metadata, id, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentInput {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentInput} instance + * with all required arguments. + */ + public static Builder create() { + return (chunks) -> + (metadata) -> (id) -> new DocumentInput().chunks(chunks).metadata(metadata).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the chunks of this {@link DocumentInput} instance. + * + * @param chunks The chunks of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + Builder1 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link DocumentInput} instance. + * + * @param chunks The chunks of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link DocumentInput} instance. + * + * @param metadata The metadata of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + Builder2 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link DocumentInput} instance. + * + * @param metadata The metadata of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the id of this {@link DocumentInput} instance. + * + * @param id Unique identifier of a document. + * @return The DocumentInput instance. + */ + DocumentInput id(@Nonnull final UUID id); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java new file mode 100644 index 000000000..2b36ebc09 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java @@ -0,0 +1,347 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentKeyValueListPair */ +@Beta // CHECKSTYLE:OFF +public class DocumentKeyValueListPair extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + /** Gets or Sets matchMode */ + public enum MatchModeEnum { + /** The ANY option of this DocumentKeyValueListPair */ + ANY("ANY"), + + /** The ALL option of this DocumentKeyValueListPair */ + ALL("ALL"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this DocumentKeyValueListPair */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MatchModeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type DocumentKeyValueListPair + */ + @JsonCreator + @Nonnull + public static MatchModeEnum fromValue(@Nonnull final String value) { + for (MatchModeEnum b : MatchModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("matchMode") + private MatchModeEnum matchMode; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentKeyValueListPair. */ + protected DocumentKeyValueListPair() { + super(); + } + + /** + * Set the key of this {@link DocumentKeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link DocumentKeyValueListPair} + * @return The same instance of this {@link DocumentKeyValueListPair} class + */ + @Nonnull + public DocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link DocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link DocumentKeyValueListPair} instance. + * + * @param key The key of this {@link DocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link DocumentKeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + * @return The same instance of this {@link DocumentKeyValueListPair} class + */ + @Nonnull + public DocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link DocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link DocumentKeyValueListPair} + */ + @Nonnull + public DocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link DocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link DocumentKeyValueListPair} instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the matchMode of this {@link DocumentKeyValueListPair} instance and return the same + * instance. + * + * @param matchMode The matchMode of this {@link DocumentKeyValueListPair} + * @return The same instance of this {@link DocumentKeyValueListPair} class + */ + @Nonnull + public DocumentKeyValueListPair matchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + return this; + } + + /** + * Get matchMode + * + * @return matchMode The matchMode of this {@link DocumentKeyValueListPair} instance. + */ + @Nullable + public MatchModeEnum getMatchMode() { + return matchMode; + } + + /** + * Set the matchMode of this {@link DocumentKeyValueListPair} instance. + * + * @param matchMode The matchMode of this {@link DocumentKeyValueListPair} + */ + public void setMatchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentKeyValueListPair} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentKeyValueListPair} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentKeyValueListPair documentKeyValueListPair = (DocumentKeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, documentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, documentKeyValueListPair.key) + && Objects.equals(this.value, documentKeyValueListPair.value) + && Objects.equals(this.matchMode, documentKeyValueListPair.matchMode) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, matchMode, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentKeyValueListPair {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" matchMode: ").append(toIndentedString(matchMode)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * DocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new DocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link DocumentKeyValueListPair} instance. + * + * @param key The key of this {@link DocumentKeyValueListPair} + * @return The DocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link DocumentKeyValueListPair} instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + * @return The DocumentKeyValueListPair instance. + */ + DocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link DocumentKeyValueListPair} instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + * @return The DocumentKeyValueListPair instance. + */ + default DocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java new file mode 100644 index 000000000..eb5ea2cb1 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java @@ -0,0 +1,297 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentOutput */ +@Beta // CHECKSTYLE:OFF +public class DocumentOutput +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentOutput. */ + protected DocumentOutput() {} + + /** + * Set the id of this {@link DocumentOutput} instance and return the same instance. + * + * @param id The id of this {@link DocumentOutput} + * @return The same instance of this {@link DocumentOutput} class + */ + @Nonnull + public DocumentOutput id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link DocumentOutput} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentOutput} instance. + * + * @param id The id of this {@link DocumentOutput} + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the metadata of this {@link DocumentOutput} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentOutput} + * @return The same instance of this {@link DocumentOutput} class + */ + @Nonnull + public DocumentOutput metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentOutput}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentOutput} + */ + @Nonnull + public DocumentOutput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentOutput} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentOutput} instance. + * + * @param metadata The metadata of this {@link DocumentOutput} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the chunks of this {@link DocumentOutput} instance and return the same instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + * @return The same instance of this {@link DocumentOutput} class + */ + @Nonnull + public DocumentOutput chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link DocumentOutput}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link DocumentOutput} + */ + @Nonnull + public DocumentOutput addChunksItem(@Nonnull final Chunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link DocumentOutput} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link DocumentOutput} instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentOutput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentOutput} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentOutput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentOutput} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentOutput documentOutput = (DocumentOutput) o; + return Objects.equals(this.cloudSdkCustomFields, documentOutput.cloudSdkCustomFields) + && Objects.equals(this.id, documentOutput.id) + && Objects.equals(this.metadata, documentOutput.metadata) + && Objects.equals(this.chunks, documentOutput.chunks); + } + + @Override + public int hashCode() { + return Objects.hash(id, metadata, chunks, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentOutput {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentOutput} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> (chunks) -> new DocumentOutput().id(id).chunks(chunks); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DocumentOutput} instance. + * + * @param id The id of this {@link DocumentOutput} + * @return The DocumentOutput builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the chunks of this {@link DocumentOutput} instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + * @return The DocumentOutput instance. + */ + DocumentOutput chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link DocumentOutput} instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + * @return The DocumentOutput instance. + */ + default DocumentOutput chunks(@Nonnull final Chunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java new file mode 100644 index 000000000..a25b580fa --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java @@ -0,0 +1,319 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing information about a newly created, single document. */ +@Beta // CHECKSTYLE:OFF +public class DocumentResponse +// CHECKSTYLE:ON +{ + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentResponse. */ + protected DocumentResponse() {} + + /** + * Set the chunks of this {@link DocumentResponse} instance and return the same instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + * @return The same instance of this {@link DocumentResponse} class + */ + @Nonnull + public DocumentResponse chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link DocumentResponse}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link DocumentResponse} + */ + @Nonnull + public DocumentResponse addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link DocumentResponse} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link DocumentResponse} instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Set the metadata of this {@link DocumentResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + * @return The same instance of this {@link DocumentResponse} class + */ + @Nonnull + public DocumentResponse metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentResponse}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentResponse} + */ + @Nonnull + public DocumentResponse addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentResponse} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentResponse} instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link DocumentResponse} instance and return the same instance. + * + * @param id Unique identifier of a document. + * @return The same instance of this {@link DocumentResponse} class + */ + @Nonnull + public DocumentResponse id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a document. + * + * @return id The id of this {@link DocumentResponse} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentResponse} instance. + * + * @param id Unique identifier of a document. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentResponse} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentResponse documentResponse = (DocumentResponse) o; + return Objects.equals(this.cloudSdkCustomFields, documentResponse.cloudSdkCustomFields) + && Objects.equals(this.chunks, documentResponse.chunks) + && Objects.equals(this.metadata, documentResponse.metadata) + && Objects.equals(this.id, documentResponse.id); + } + + @Override + public int hashCode() { + return Objects.hash(chunks, metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentResponse {\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (chunks) -> + (metadata) -> (id) -> new DocumentResponse().chunks(chunks).metadata(metadata).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the chunks of this {@link DocumentResponse} instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + Builder1 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link DocumentResponse} instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link DocumentResponse} instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + Builder2 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link DocumentResponse} instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the id of this {@link DocumentResponse} instance. + * + * @param id Unique identifier of a document. + * @return The DocumentResponse instance. + */ + DocumentResponse id(@Nonnull final UUID id); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java new file mode 100644 index 000000000..b67c5b831 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java @@ -0,0 +1,207 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * An update request containing one or more documents to update existing documents in a collection + * by ID. + */ +@Beta // CHECKSTYLE:OFF +public class DocumentUpdateRequest extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentUpdateRequest. */ + protected DocumentUpdateRequest() { + super(); + } + + /** + * Set the documents of this {@link DocumentUpdateRequest} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + * @return The same instance of this {@link DocumentUpdateRequest} class + */ + @Nonnull + public DocumentUpdateRequest documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentUpdateRequest}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentUpdateRequest} + */ + @Nonnull + public DocumentUpdateRequest addDocumentsItem(@Nonnull final DocumentInput documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentUpdateRequest} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentUpdateRequest} instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentUpdateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentUpdateRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentUpdateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentUpdateRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentUpdateRequest documentUpdateRequest = (DocumentUpdateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, documentUpdateRequest.cloudSdkCustomFields) + && Objects.equals(this.documents, documentUpdateRequest.documents) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(documents, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentUpdateRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentUpdateRequest} + * instance with all required arguments. + */ + public static Builder create() { + return (documents) -> new DocumentUpdateRequest().documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the documents of this {@link DocumentUpdateRequest} instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + * @return The DocumentUpdateRequest instance. + */ + DocumentUpdateRequest documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentUpdateRequest} instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + * @return The DocumentUpdateRequest instance. + */ + default DocumentUpdateRequest documents(@Nonnull final DocumentInput... documents) { + return documents(Arrays.asList(documents)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java new file mode 100644 index 000000000..116fda08a --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java @@ -0,0 +1,248 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A single document stored in a collection by ID without exposing its chunks. */ +@Beta // CHECKSTYLE:OFF +public class DocumentWithoutChunks +// CHECKSTYLE:ON +{ + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentWithoutChunks. */ + protected DocumentWithoutChunks() {} + + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + * @return The same instance of this {@link DocumentWithoutChunks} class + */ + @Nonnull + public DocumentWithoutChunks metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentWithoutChunks}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentWithoutChunks} + */ + @Nonnull + public DocumentWithoutChunks addMetadataItem( + @Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentWithoutChunks} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link DocumentWithoutChunks} instance and return the same instance. + * + * @param id Unique identifier of a document. + * @return The same instance of this {@link DocumentWithoutChunks} class + */ + @Nonnull + public DocumentWithoutChunks id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a document. + * + * @return id The id of this {@link DocumentWithoutChunks} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentWithoutChunks} instance. + * + * @param id Unique identifier of a document. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentWithoutChunks}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentWithoutChunks} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentWithoutChunks has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentWithoutChunks} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentWithoutChunks documentWithoutChunks = (DocumentWithoutChunks) o; + return Objects.equals(this.cloudSdkCustomFields, documentWithoutChunks.cloudSdkCustomFields) + && Objects.equals(this.metadata, documentWithoutChunks.metadata) + && Objects.equals(this.id, documentWithoutChunks.id); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentWithoutChunks {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentWithoutChunks} + * instance with all required arguments. + */ + public static Builder create() { + return (metadata) -> (id) -> new DocumentWithoutChunks().metadata(metadata).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + * @return The DocumentWithoutChunks builder. + */ + Builder1 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + * @return The DocumentWithoutChunks builder. + */ + default Builder1 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link DocumentWithoutChunks} instance. + * + * @param id Unique identifier of a document. + * @return The DocumentWithoutChunks instance. + */ + DocumentWithoutChunks id(@Nonnull final UUID id); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java new file mode 100644 index 000000000..5ba765d77 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java @@ -0,0 +1,234 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing documents retrieved from the server. */ +@Beta // CHECKSTYLE:OFF +public class Documents +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Documents. */ + protected Documents() {} + + /** + * Set the resources of this {@link Documents} instance and return the same instance. + * + * @param resources The resources of this {@link Documents} + * @return The same instance of this {@link Documents} class + */ + @Nonnull + public Documents resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link Documents}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link Documents} + */ + @Nonnull + public Documents addResourcesItem(@Nonnull final DocumentWithoutChunks resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link Documents} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link Documents} instance. + * + * @param resources The resources of this {@link Documents} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link Documents} instance and return the same instance. + * + * @param count The count of this {@link Documents} + * @return The same instance of this {@link Documents} class + */ + @Nonnull + public Documents count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link Documents} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link Documents} instance. + * + * @param count The count of this {@link Documents} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link Documents}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Documents} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Documents has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Documents} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Documents documents = (Documents) o; + return Objects.equals(this.cloudSdkCustomFields, documents.cloudSdkCustomFields) + && Objects.equals(this.resources, documents.resources) + && Objects.equals(this.count, documents.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Documents {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Documents} instance + * with all required arguments. + */ + public static Builder create() { + return (resources) -> new Documents().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link Documents} instance. + * + * @param resources The resources of this {@link Documents} + * @return The Documents instance. + */ + Documents resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link Documents} instance. + * + * @param resources The resources of this {@link Documents} + * @return The Documents instance. + */ + default Documents resources(@Nonnull final DocumentWithoutChunks... resources) { + return resources(Arrays.asList(resources)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java new file mode 100644 index 000000000..506a12b41 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java @@ -0,0 +1,345 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentsChunk */ +@Beta // CHECKSTYLE:OFF +public class DocumentsChunk +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentsChunk. */ + protected DocumentsChunk() {} + + /** + * Set the id of this {@link DocumentsChunk} instance and return the same instance. + * + * @param id The id of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link DocumentsChunk} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentsChunk} instance. + * + * @param id The id of this {@link DocumentsChunk} + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the title of this {@link DocumentsChunk} instance and return the same instance. + * + * @param title The title of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk title(@Nonnull final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DocumentsChunk} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DocumentsChunk} instance. + * + * @param title The title of this {@link DocumentsChunk} + */ + public void setTitle(@Nonnull final String title) { + this.title = title; + } + + /** + * Set the metadata of this {@link DocumentsChunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentsChunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentsChunk} + */ + @Nonnull + public DocumentsChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentsChunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentsChunk} instance. + * + * @param metadata The metadata of this {@link DocumentsChunk} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the documents of this {@link DocumentsChunk} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentsChunk}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentsChunk} + */ + @Nonnull + public DocumentsChunk addDocumentsItem(@Nonnull final DocumentOutput documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentsChunk} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentsChunk} instance. + * + * @param documents The documents of this {@link DocumentsChunk} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentsChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentsChunk} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentsChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentsChunk} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentsChunk documentsChunk = (DocumentsChunk) o; + return Objects.equals(this.cloudSdkCustomFields, documentsChunk.cloudSdkCustomFields) + && Objects.equals(this.id, documentsChunk.id) + && Objects.equals(this.title, documentsChunk.title) + && Objects.equals(this.metadata, documentsChunk.metadata) + && Objects.equals(this.documents, documentsChunk.documents); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, metadata, documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentsChunk {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentsChunk} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (title) -> (documents) -> new DocumentsChunk().id(id).title(title).documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DocumentsChunk} instance. + * + * @param id The id of this {@link DocumentsChunk} + * @return The DocumentsChunk builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the title of this {@link DocumentsChunk} instance. + * + * @param title The title of this {@link DocumentsChunk} + * @return The DocumentsChunk builder. + */ + Builder2 title(@Nonnull final String title); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the documents of this {@link DocumentsChunk} instance. + * + * @param documents The documents of this {@link DocumentsChunk} + * @return The DocumentsChunk instance. + */ + DocumentsChunk documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentsChunk} instance. + * + * @param documents The documents of this {@link DocumentsChunk} + * @return The DocumentsChunk instance. + */ + default DocumentsChunk documents(@Nonnull final DocumentOutput... documents) { + return documents(Arrays.asList(documents)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java new file mode 100644 index 000000000..d20633a61 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java @@ -0,0 +1,200 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing documents created or updated, retrieved from the server. */ +@Beta // CHECKSTYLE:OFF +public class DocumentsListResponse +// CHECKSTYLE:ON +{ + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentsListResponse. */ + protected DocumentsListResponse() {} + + /** + * Set the documents of this {@link DocumentsListResponse} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + * @return The same instance of this {@link DocumentsListResponse} class + */ + @Nonnull + public DocumentsListResponse documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentsListResponse}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentsListResponse} + */ + @Nonnull + public DocumentsListResponse addDocumentsItem( + @Nonnull final DocumentWithoutChunks documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentsListResponse} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentsListResponse} instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentsListResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentsListResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentsListResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentsListResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentsListResponse documentsListResponse = (DocumentsListResponse) o; + return Objects.equals(this.cloudSdkCustomFields, documentsListResponse.cloudSdkCustomFields) + && Objects.equals(this.documents, documentsListResponse.documents); + } + + @Override + public int hashCode() { + return Objects.hash(documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentsListResponse {\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentsListResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (documents) -> new DocumentsListResponse().documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the documents of this {@link DocumentsListResponse} instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + * @return The DocumentsListResponse instance. + */ + DocumentsListResponse documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentsListResponse} instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + * @return The DocumentsListResponse instance. + */ + default DocumentsListResponse documents(@Nonnull final DocumentWithoutChunks... documents) { + return documents(Arrays.asList(documents)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java new file mode 100644 index 000000000..42e0910c2 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java @@ -0,0 +1,161 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** EmbeddingConfig */ +@Beta // CHECKSTYLE:OFF +public class EmbeddingConfig extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("modelName") + private String modelName = "text-embedding-ada-002"; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for EmbeddingConfig. */ + protected EmbeddingConfig() { + super(); + } + + /** + * Set the modelName of this {@link EmbeddingConfig} instance and return the same instance. + * + * @param modelName The modelName of this {@link EmbeddingConfig} + * @return The same instance of this {@link EmbeddingConfig} class + */ + @Nonnull + public EmbeddingConfig modelName(@Nullable final String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get modelName + * + * @return modelName The modelName of this {@link EmbeddingConfig} instance. + */ + @Nonnull + public String getModelName() { + return modelName; + } + + /** + * Set the modelName of this {@link EmbeddingConfig} instance. + * + * @param modelName The modelName of this {@link EmbeddingConfig} + */ + public void setModelName(@Nullable final String modelName) { + this.modelName = modelName; + } + + /** + * Get the names of the unrecognizable properties of the {@link EmbeddingConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link EmbeddingConfig} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("EmbeddingConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link EmbeddingConfig} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final EmbeddingConfig embeddingConfig = (EmbeddingConfig) o; + return Objects.equals(this.cloudSdkCustomFields, embeddingConfig.cloudSdkCustomFields) + && Objects.equals(this.modelName, embeddingConfig.modelName) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(modelName, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddingConfig {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link EmbeddingConfig} instance. No arguments are required. */ + public static EmbeddingConfig create() { + return new EmbeddingConfig(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java new file mode 100644 index 000000000..a8b3e9af8 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java @@ -0,0 +1,156 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** InlineObject */ +@Beta // CHECKSTYLE:OFF +public class InlineObject +// CHECKSTYLE:ON +{ + @JsonProperty("error") + private ApiError error; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for InlineObject. */ + protected InlineObject() {} + + /** + * Set the error of this {@link InlineObject} instance and return the same instance. + * + * @param error The error of this {@link InlineObject} + * @return The same instance of this {@link InlineObject} class + */ + @Nonnull + public InlineObject error(@Nullable final ApiError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link InlineObject} instance. + */ + @Nonnull + public ApiError getError() { + return error; + } + + /** + * Set the error of this {@link InlineObject} instance. + * + * @param error The error of this {@link InlineObject} + */ + public void setError(@Nullable final ApiError error) { + this.error = error; + } + + /** + * Get the names of the unrecognizable properties of the {@link InlineObject}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link InlineObject} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("InlineObject has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link InlineObject} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final InlineObject inlineObject = (InlineObject) o; + return Objects.equals(this.cloudSdkCustomFields, inlineObject.cloudSdkCustomFields) + && Objects.equals(this.error, inlineObject.error); + } + + @Override + public int hashCode() { + return Objects.hash(error, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link InlineObject} instance. No arguments are required. */ + public static InlineObject create() { + return new InlineObject(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java new file mode 100644 index 000000000..5332cfd5b --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java @@ -0,0 +1,250 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** KeyValueListPair */ +@Beta // CHECKSTYLE:OFF +public class KeyValueListPair extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for KeyValueListPair. */ + protected KeyValueListPair() { + super(); + } + + /** + * Set the key of this {@link KeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link KeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key The key of this {@link KeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link KeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link KeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link KeyValueListPair} + */ + @Nonnull + public KeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link KeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link KeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link KeyValueListPair} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("KeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link KeyValueListPair} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final KeyValueListPair keyValueListPair = (KeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, keyValueListPair.key) + && Objects.equals(this.value, keyValueListPair.value) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class KeyValueListPair {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link KeyValueListPair} + * instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new KeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key The key of this {@link KeyValueListPair} + * @return The KeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The KeyValueListPair instance. + */ + KeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The KeyValueListPair instance. + */ + default KeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java new file mode 100644 index 000000000..d41a55171 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java @@ -0,0 +1,247 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PerFilterSearchResult */ +@Beta // CHECKSTYLE:OFF +public class PerFilterSearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PerFilterSearchResult. */ + protected PerFilterSearchResult() {} + + /** + * Set the filterId of this {@link PerFilterSearchResult} instance and return the same instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResult} + * @return The same instance of this {@link PerFilterSearchResult} class + */ + @Nonnull + public PerFilterSearchResult filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link PerFilterSearchResult} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link PerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResult} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link PerFilterSearchResult} instance and return the same instance. + * + * @param results The results of this {@link PerFilterSearchResult} + * @return The same instance of this {@link PerFilterSearchResult} class + */ + @Nonnull + public PerFilterSearchResult results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link PerFilterSearchResult}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link PerFilterSearchResult} + */ + @Nonnull + public PerFilterSearchResult addResultsItem(@Nonnull final DocumentsChunk resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * + * @return results The results of this {@link PerFilterSearchResult} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link PerFilterSearchResult} instance. + * + * @param results The results of this {@link PerFilterSearchResult} + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link PerFilterSearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PerFilterSearchResult} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PerFilterSearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PerFilterSearchResult} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PerFilterSearchResult perFilterSearchResult = (PerFilterSearchResult) o; + return Objects.equals(this.cloudSdkCustomFields, perFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, perFilterSearchResult.filterId) + && Objects.equals(this.results, perFilterSearchResult.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PerFilterSearchResult {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link PerFilterSearchResult} + * instance with all required arguments. + */ + public static Builder create() { + return (filterId) -> + (results) -> new PerFilterSearchResult().filterId(filterId).results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link PerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResult} + * @return The PerFilterSearchResult builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the results of this {@link PerFilterSearchResult} instance. + * + * @param results The results of this {@link PerFilterSearchResult} + * @return The PerFilterSearchResult instance. + */ + PerFilterSearchResult results(@Nonnull final List results); + + /** + * Set the results of this {@link PerFilterSearchResult} instance. + * + * @param results The results of this {@link PerFilterSearchResult} + * @return The PerFilterSearchResult instance. + */ + default PerFilterSearchResult results(@Nonnull final DocumentsChunk... results) { + return results(Arrays.asList(results)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java new file mode 100644 index 000000000..c71a1fe15 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java @@ -0,0 +1,228 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Pipeline */ +@Beta // CHECKSTYLE:OFF +public class Pipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; + + @JsonProperty("configuration") + private PipelineConfiguration _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Pipeline. */ + protected Pipeline() {} + + /** + * Set the id of this {@link Pipeline} instance and return the same instance. + * + * @param id The id of this {@link Pipeline} + * @return The same instance of this {@link Pipeline} class + */ + @Nonnull + public Pipeline id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link Pipeline} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link Pipeline} instance. + * + * @param id The id of this {@link Pipeline} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the type of this {@link Pipeline} instance and return the same instance. + * + * @param type The type of this {@link Pipeline} + * @return The same instance of this {@link Pipeline} class + */ + @Nonnull + public Pipeline type(@Nullable final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link Pipeline} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link Pipeline} instance. + * + * @param type The type of this {@link Pipeline} + */ + public void setType(@Nullable final String type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link Pipeline} instance and return the same instance. + * + * @param _configuration The _configuration of this {@link Pipeline} + * @return The same instance of this {@link Pipeline} class + */ + @Nonnull + public Pipeline _configuration(@Nullable final PipelineConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link Pipeline} instance. + */ + @Nonnull + public PipelineConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link Pipeline} instance. + * + * @param _configuration The _configuration of this {@link Pipeline} + */ + public void setConfiguration(@Nullable final PipelineConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link Pipeline}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Pipeline} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Pipeline has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Pipeline} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Pipeline pipeline = (Pipeline) o; + return Objects.equals(this.cloudSdkCustomFields, pipeline.cloudSdkCustomFields) + && Objects.equals(this.id, pipeline.id) + && Objects.equals(this.type, pipeline.type) + && Objects.equals(this._configuration, pipeline._configuration); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, _configuration, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Pipeline {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link Pipeline} instance. No arguments are required. */ + public static Pipeline create() { + return new Pipeline(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java new file mode 100644 index 000000000..43295b6a9 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java @@ -0,0 +1,195 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineConfiguration */ +@Beta // CHECKSTYLE:OFF +public class PipelineConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("destination") + private String destination; + + @JsonProperty("sharePoint") + private PipelineConfigurationSharePoint sharePoint; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineConfiguration. */ + protected PipelineConfiguration() {} + + /** + * Set the destination of this {@link PipelineConfiguration} instance and return the same + * instance. + * + * @param destination The destination of this {@link PipelineConfiguration} + * @return The same instance of this {@link PipelineConfiguration} class + */ + @Nonnull + public PipelineConfiguration destination(@Nullable final String destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination The destination of this {@link PipelineConfiguration} instance. + */ + @Nonnull + public String getDestination() { + return destination; + } + + /** + * Set the destination of this {@link PipelineConfiguration} instance. + * + * @param destination The destination of this {@link PipelineConfiguration} + */ + public void setDestination(@Nullable final String destination) { + this.destination = destination; + } + + /** + * Set the sharePoint of this {@link PipelineConfiguration} instance and return the same instance. + * + * @param sharePoint The sharePoint of this {@link PipelineConfiguration} + * @return The same instance of this {@link PipelineConfiguration} class + */ + @Nonnull + public PipelineConfiguration sharePoint( + @Nullable final PipelineConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + return this; + } + + /** + * Get sharePoint + * + * @return sharePoint The sharePoint of this {@link PipelineConfiguration} instance. + */ + @Nonnull + public PipelineConfigurationSharePoint getSharePoint() { + return sharePoint; + } + + /** + * Set the sharePoint of this {@link PipelineConfiguration} instance. + * + * @param sharePoint The sharePoint of this {@link PipelineConfiguration} + */ + public void setSharePoint(@Nullable final PipelineConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineConfiguration} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineConfiguration} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineConfiguration pipelineConfiguration = (PipelineConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, pipelineConfiguration.destination) + && Objects.equals(this.sharePoint, pipelineConfiguration.sharePoint); + } + + @Override + public int hashCode() { + return Objects.hash(destination, sharePoint, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineConfiguration {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineConfiguration} instance. No arguments are required. */ + public static PipelineConfiguration create() { + return new PipelineConfiguration(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java new file mode 100644 index 000000000..4f760ea0e --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java @@ -0,0 +1,163 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineConfigurationSharePoint */ +@Beta // CHECKSTYLE:OFF +public class PipelineConfigurationSharePoint +// CHECKSTYLE:ON +{ + @JsonProperty("site") + private PipelineConfigurationSharePointSite site; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineConfigurationSharePoint. */ + protected PipelineConfigurationSharePoint() {} + + /** + * Set the site of this {@link PipelineConfigurationSharePoint} instance and return the same + * instance. + * + * @param site The site of this {@link PipelineConfigurationSharePoint} + * @return The same instance of this {@link PipelineConfigurationSharePoint} class + */ + @Nonnull + public PipelineConfigurationSharePoint site( + @Nullable final PipelineConfigurationSharePointSite site) { + this.site = site; + return this; + } + + /** + * Get site + * + * @return site The site of this {@link PipelineConfigurationSharePoint} instance. + */ + @Nonnull + public PipelineConfigurationSharePointSite getSite() { + return site; + } + + /** + * Set the site of this {@link PipelineConfigurationSharePoint} instance. + * + * @param site The site of this {@link PipelineConfigurationSharePoint} + */ + public void setSite(@Nullable final PipelineConfigurationSharePointSite site) { + this.site = site; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineConfigurationSharePoint}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePoint} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineConfigurationSharePoint has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineConfigurationSharePoint} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineConfigurationSharePoint pipelineConfigurationSharePoint = + (PipelineConfigurationSharePoint) o; + return Objects.equals( + this.cloudSdkCustomFields, pipelineConfigurationSharePoint.cloudSdkCustomFields) + && Objects.equals(this.site, pipelineConfigurationSharePoint.site); + } + + @Override + public int hashCode() { + return Objects.hash(site, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineConfigurationSharePoint {\n"); + sb.append(" site: ").append(toIndentedString(site)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineConfigurationSharePoint} instance. No arguments are required. */ + public static PipelineConfigurationSharePoint create() { + return new PipelineConfigurationSharePoint(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java new file mode 100644 index 000000000..057997bba --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java @@ -0,0 +1,259 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineConfigurationSharePointSite */ +@Beta // CHECKSTYLE:OFF +public class PipelineConfigurationSharePointSite +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("includePaths") + private List includePaths = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineConfigurationSharePointSite. */ + protected PipelineConfigurationSharePointSite() {} + + /** + * Set the id of this {@link PipelineConfigurationSharePointSite} instance and return the same + * instance. + * + * @param id The id of this {@link PipelineConfigurationSharePointSite} + * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + */ + @Nonnull + public PipelineConfigurationSharePointSite id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PipelineConfigurationSharePointSite} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link PipelineConfigurationSharePointSite} instance. + * + * @param id The id of this {@link PipelineConfigurationSharePointSite} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the name of this {@link PipelineConfigurationSharePointSite} instance and return the same + * instance. + * + * @param name The name of this {@link PipelineConfigurationSharePointSite} + * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + */ + @Nonnull + public PipelineConfigurationSharePointSite name(@Nullable final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PipelineConfigurationSharePointSite} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link PipelineConfigurationSharePointSite} instance. + * + * @param name The name of this {@link PipelineConfigurationSharePointSite} + */ + public void setName(@Nullable final String name) { + this.name = name; + } + + /** + * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance and return + * the same instance. + * + * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + */ + @Nonnull + public PipelineConfigurationSharePointSite includePaths( + @Nullable final List includePaths) { + this.includePaths = includePaths; + return this; + } + + /** + * Add one includePaths instance to this {@link PipelineConfigurationSharePointSite}. + * + * @param includePathsItem The includePaths that should be added + * @return The same instance of type {@link PipelineConfigurationSharePointSite} + */ + @Nonnull + public PipelineConfigurationSharePointSite addIncludePathsItem( + @Nonnull final String includePathsItem) { + if (this.includePaths == null) { + this.includePaths = new ArrayList<>(); + } + this.includePaths.add(includePathsItem); + return this; + } + + /** + * Get includePaths + * + * @return includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + * instance. + */ + @Nonnull + public List getIncludePaths() { + return includePaths; + } + + /** + * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance. + * + * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + */ + public void setIncludePaths(@Nullable final List includePaths) { + this.includePaths = includePaths; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * PipelineConfigurationSharePointSite}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePointSite} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineConfigurationSharePointSite has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineConfigurationSharePointSite} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineConfigurationSharePointSite pipelineConfigurationSharePointSite = + (PipelineConfigurationSharePointSite) o; + return Objects.equals( + this.cloudSdkCustomFields, pipelineConfigurationSharePointSite.cloudSdkCustomFields) + && Objects.equals(this.id, pipelineConfigurationSharePointSite.id) + && Objects.equals(this.name, pipelineConfigurationSharePointSite.name) + && Objects.equals(this.includePaths, pipelineConfigurationSharePointSite.includePaths); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, includePaths, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineConfigurationSharePointSite {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link PipelineConfigurationSharePointSite} instance. No arguments are required. + */ + public static PipelineConfigurationSharePointSite create() { + return new PipelineConfigurationSharePointSite(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java new file mode 100644 index 000000000..404f2a654 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java @@ -0,0 +1,156 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineId */ +@Beta // CHECKSTYLE:OFF +public class PipelineId +// CHECKSTYLE:ON +{ + @JsonProperty("pipelineId") + private String pipelineId; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineId. */ + protected PipelineId() {} + + /** + * Set the pipelineId of this {@link PipelineId} instance and return the same instance. + * + * @param pipelineId The pipelineId of this {@link PipelineId} + * @return The same instance of this {@link PipelineId} class + */ + @Nonnull + public PipelineId pipelineId(@Nullable final String pipelineId) { + this.pipelineId = pipelineId; + return this; + } + + /** + * Get pipelineId + * + * @return pipelineId The pipelineId of this {@link PipelineId} instance. + */ + @Nonnull + public String getPipelineId() { + return pipelineId; + } + + /** + * Set the pipelineId of this {@link PipelineId} instance. + * + * @param pipelineId The pipelineId of this {@link PipelineId} + */ + public void setPipelineId(@Nullable final String pipelineId) { + this.pipelineId = pipelineId; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineId}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineId} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("PipelineId has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineId} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineId pipelineId = (PipelineId) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineId.cloudSdkCustomFields) + && Objects.equals(this.pipelineId, pipelineId.pipelineId); + } + + @Override + public int hashCode() { + return Objects.hash(pipelineId, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineId {\n"); + sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineId} instance. No arguments are required. */ + public static PipelineId create() { + return new PipelineId(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java new file mode 100644 index 000000000..df3bacad0 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java @@ -0,0 +1,226 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequst */ +@Beta // CHECKSTYLE:OFF +public class PipelinePostRequst extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private String type; + + @JsonProperty("configuration") + private PipelinePostRequstConfiguration _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequst. */ + protected PipelinePostRequst() { + super(); + } + + /** + * Set the type of this {@link PipelinePostRequst} instance and return the same instance. + * + * @param type The type of this {@link PipelinePostRequst} + * @return The same instance of this {@link PipelinePostRequst} class + */ + @Nonnull + public PipelinePostRequst type(@Nonnull final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link PipelinePostRequst} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link PipelinePostRequst} instance. + * + * @param type The type of this {@link PipelinePostRequst} + */ + public void setType(@Nonnull final String type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link PipelinePostRequst} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link PipelinePostRequst} + * @return The same instance of this {@link PipelinePostRequst} class + */ + @Nonnull + public PipelinePostRequst _configuration( + @Nonnull final PipelinePostRequstConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link PipelinePostRequst} instance. + */ + @Nonnull + public PipelinePostRequstConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link PipelinePostRequst} instance. + * + * @param _configuration The _configuration of this {@link PipelinePostRequst} + */ + public void setConfiguration(@Nonnull final PipelinePostRequstConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelinePostRequst}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelinePostRequst} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("PipelinePostRequst has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequst} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequst pipelinePostRequst = (PipelinePostRequst) o; + return Objects.equals(this.cloudSdkCustomFields, pipelinePostRequst.cloudSdkCustomFields) + && Objects.equals(this.type, pipelinePostRequst.type) + && Objects.equals(this._configuration, pipelinePostRequst._configuration) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, _configuration, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequst {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link PipelinePostRequst} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (_configuration) -> new PipelinePostRequst().type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link PipelinePostRequst} instance. + * + * @param type The type of this {@link PipelinePostRequst} + * @return The PipelinePostRequst builder. + */ + Builder1 type(@Nonnull final String type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _configuration of this {@link PipelinePostRequst} instance. + * + * @param _configuration The _configuration of this {@link PipelinePostRequst} + * @return The PipelinePostRequst instance. + */ + PipelinePostRequst _configuration( + @Nonnull final PipelinePostRequstConfiguration _configuration); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java new file mode 100644 index 000000000..08a5640c2 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java @@ -0,0 +1,219 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequstConfiguration */ +@Beta // CHECKSTYLE:OFF +public class PipelinePostRequstConfiguration extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("destination") + private String destination; + + @JsonProperty("sharePoint") + private PipelinePostRequstConfigurationSharePoint sharePoint; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequstConfiguration. */ + protected PipelinePostRequstConfiguration() { + super(); + } + + /** + * Set the destination of this {@link PipelinePostRequstConfiguration} instance and return the + * same instance. + * + * @param destination The destination of this {@link PipelinePostRequstConfiguration} + * @return The same instance of this {@link PipelinePostRequstConfiguration} class + */ + @Nonnull + public PipelinePostRequstConfiguration destination(@Nonnull final String destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination The destination of this {@link PipelinePostRequstConfiguration} instance. + */ + @Nonnull + public String getDestination() { + return destination; + } + + /** + * Set the destination of this {@link PipelinePostRequstConfiguration} instance. + * + * @param destination The destination of this {@link PipelinePostRequstConfiguration} + */ + public void setDestination(@Nonnull final String destination) { + this.destination = destination; + } + + /** + * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance and return the same + * instance. + * + * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} + * @return The same instance of this {@link PipelinePostRequstConfiguration} class + */ + @Nonnull + public PipelinePostRequstConfiguration sharePoint( + @Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + return this; + } + + /** + * Get sharePoint + * + * @return sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} instance. + */ + @Nonnull + public PipelinePostRequstConfigurationSharePoint getSharePoint() { + return sharePoint; + } + + /** + * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance. + * + * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} + */ + public void setSharePoint(@Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelinePostRequstConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelinePostRequstConfiguration} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelinePostRequstConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequstConfiguration} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequstConfiguration pipelinePostRequstConfiguration = + (PipelinePostRequstConfiguration) o; + return Objects.equals( + this.cloudSdkCustomFields, pipelinePostRequstConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, pipelinePostRequstConfiguration.destination) + && Objects.equals(this.sharePoint, pipelinePostRequstConfiguration.sharePoint) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(destination, sharePoint, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequstConfiguration {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * PipelinePostRequstConfiguration} instance with all required arguments. + */ + public static Builder create() { + return (destination) -> new PipelinePostRequstConfiguration().destination(destination); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the destination of this {@link PipelinePostRequstConfiguration} instance. + * + * @param destination The destination of this {@link PipelinePostRequstConfiguration} + * @return The PipelinePostRequstConfiguration instance. + */ + PipelinePostRequstConfiguration destination(@Nonnull final String destination); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java new file mode 100644 index 000000000..1833bd7e8 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java @@ -0,0 +1,173 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequstConfigurationSharePoint */ +@Beta // CHECKSTYLE:OFF +public class PipelinePostRequstConfigurationSharePoint extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("site") + private PipelinePostRequstConfigurationSharePointSite site; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequstConfigurationSharePoint. */ + protected PipelinePostRequstConfigurationSharePoint() { + super(); + } + + /** + * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance and return the + * same instance. + * + * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} + * @return The same instance of this {@link PipelinePostRequstConfigurationSharePoint} class + */ + @Nonnull + public PipelinePostRequstConfigurationSharePoint site( + @Nullable final PipelinePostRequstConfigurationSharePointSite site) { + this.site = site; + return this; + } + + /** + * Get site + * + * @return site The site of this {@link PipelinePostRequstConfigurationSharePoint} instance. + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite getSite() { + return site; + } + + /** + * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance. + * + * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} + */ + public void setSite(@Nullable final PipelinePostRequstConfigurationSharePointSite site) { + this.site = site; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * PipelinePostRequstConfigurationSharePoint}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * PipelinePostRequstConfigurationSharePoint} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelinePostRequstConfigurationSharePoint has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePoint} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequstConfigurationSharePoint pipelinePostRequstConfigurationSharePoint = + (PipelinePostRequstConfigurationSharePoint) o; + return Objects.equals( + this.cloudSdkCustomFields, + pipelinePostRequstConfigurationSharePoint.cloudSdkCustomFields) + && Objects.equals(this.site, pipelinePostRequstConfigurationSharePoint.site) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(site, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequstConfigurationSharePoint {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" site: ").append(toIndentedString(site)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link PipelinePostRequstConfigurationSharePoint} instance. No arguments are + * required. + */ + public static PipelinePostRequstConfigurationSharePoint create() { + return new PipelinePostRequstConfigurationSharePoint(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java new file mode 100644 index 000000000..57d041c03 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java @@ -0,0 +1,233 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequstConfigurationSharePointSite */ +@Beta // CHECKSTYLE:OFF +public class PipelinePostRequstConfigurationSharePointSite extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("includePaths") + private List includePaths = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequstConfigurationSharePointSite. */ + protected PipelinePostRequstConfigurationSharePointSite() { + super(); + } + + /** + * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance and return + * the same instance. + * + * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} + * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite name(@Nullable final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * + * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} + */ + public void setName(@Nullable final String name) { + this.name = name; + } + + /** + * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance and + * return the same instance. + * + * @param includePaths The includePaths of this {@link + * PipelinePostRequstConfigurationSharePointSite} + * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite includePaths( + @Nullable final List includePaths) { + this.includePaths = includePaths; + return this; + } + + /** + * Add one includePaths instance to this {@link PipelinePostRequstConfigurationSharePointSite}. + * + * @param includePathsItem The includePaths that should be added + * @return The same instance of type {@link PipelinePostRequstConfigurationSharePointSite} + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite addIncludePathsItem( + @Nonnull final String includePathsItem) { + if (this.includePaths == null) { + this.includePaths = new ArrayList<>(); + } + this.includePaths.add(includePathsItem); + return this; + } + + /** + * Get includePaths + * + * @return includePaths The includePaths of this {@link + * PipelinePostRequstConfigurationSharePointSite} instance. + */ + @Nonnull + public List getIncludePaths() { + return includePaths; + } + + /** + * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * + * @param includePaths The includePaths of this {@link + * PipelinePostRequstConfigurationSharePointSite} + */ + public void setIncludePaths(@Nullable final List includePaths) { + this.includePaths = includePaths; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * PipelinePostRequstConfigurationSharePointSite}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * PipelinePostRequstConfigurationSharePointSite} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelinePostRequstConfigurationSharePointSite has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePointSite} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequstConfigurationSharePointSite + pipelinePostRequstConfigurationSharePointSite = + (PipelinePostRequstConfigurationSharePointSite) o; + return Objects.equals( + this.cloudSdkCustomFields, + pipelinePostRequstConfigurationSharePointSite.cloudSdkCustomFields) + && Objects.equals(this.name, pipelinePostRequstConfigurationSharePointSite.name) + && Objects.equals( + this.includePaths, pipelinePostRequstConfigurationSharePointSite.includePaths) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, includePaths, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequstConfigurationSharePointSite {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link PipelinePostRequstConfigurationSharePointSite} instance. No arguments are + * required. + */ + public static PipelinePostRequstConfigurationSharePointSite create() { + return new PipelinePostRequstConfigurationSharePointSite(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java new file mode 100644 index 000000000..ea2bea330 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java @@ -0,0 +1,157 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.time.OffsetDateTime; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineStatus */ +@Beta // CHECKSTYLE:OFF +public class PipelineStatus +// CHECKSTYLE:ON +{ + @JsonProperty("lastStarted") + private OffsetDateTime lastStarted; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineStatus. */ + protected PipelineStatus() {} + + /** + * Set the lastStarted of this {@link PipelineStatus} instance and return the same instance. + * + * @param lastStarted The lastStarted of this {@link PipelineStatus} + * @return The same instance of this {@link PipelineStatus} class + */ + @Nonnull + public PipelineStatus lastStarted(@Nullable final OffsetDateTime lastStarted) { + this.lastStarted = lastStarted; + return this; + } + + /** + * Get lastStarted + * + * @return lastStarted The lastStarted of this {@link PipelineStatus} instance. + */ + @Nonnull + public OffsetDateTime getLastStarted() { + return lastStarted; + } + + /** + * Set the lastStarted of this {@link PipelineStatus} instance. + * + * @param lastStarted The lastStarted of this {@link PipelineStatus} + */ + public void setLastStarted(@Nullable final OffsetDateTime lastStarted) { + this.lastStarted = lastStarted; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineStatus}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineStatus} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("PipelineStatus has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineStatus} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineStatus pipelineStatus = (PipelineStatus) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineStatus.cloudSdkCustomFields) + && Objects.equals(this.lastStarted, pipelineStatus.lastStarted); + } + + @Override + public int hashCode() { + return Objects.hash(lastStarted, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineStatus {\n"); + sb.append(" lastStarted: ").append(toIndentedString(lastStarted)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineStatus} instance. No arguments are required. */ + public static PipelineStatus create() { + return new PipelineStatus(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java new file mode 100644 index 000000000..54f199f03 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java @@ -0,0 +1,234 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Pipelines */ +@Beta // CHECKSTYLE:OFF +public class Pipelines +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Pipelines. */ + protected Pipelines() {} + + /** + * Set the resources of this {@link Pipelines} instance and return the same instance. + * + * @param resources The resources of this {@link Pipelines} + * @return The same instance of this {@link Pipelines} class + */ + @Nonnull + public Pipelines resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link Pipelines}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link Pipelines} + */ + @Nonnull + public Pipelines addResourcesItem(@Nonnull final Pipeline resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link Pipelines} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link Pipelines} instance. + * + * @param resources The resources of this {@link Pipelines} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link Pipelines} instance and return the same instance. + * + * @param count The count of this {@link Pipelines} + * @return The same instance of this {@link Pipelines} class + */ + @Nonnull + public Pipelines count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link Pipelines} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link Pipelines} instance. + * + * @param count The count of this {@link Pipelines} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link Pipelines}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Pipelines} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Pipelines has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Pipelines} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Pipelines pipelines = (Pipelines) o; + return Objects.equals(this.cloudSdkCustomFields, pipelines.cloudSdkCustomFields) + && Objects.equals(this.resources, pipelines.resources) + && Objects.equals(this.count, pipelines.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Pipelines {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Pipelines} instance + * with all required arguments. + */ + public static Builder create() { + return (resources) -> new Pipelines().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link Pipelines} instance. + * + * @param resources The resources of this {@link Pipelines} + * @return The Pipelines instance. + */ + Pipelines resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link Pipelines} instance. + * + * @param resources The resources of this {@link Pipelines} + * @return The Pipelines instance. + */ + default Pipelines resources(@Nonnull final Pipeline... resources) { + return resources(Arrays.asList(resources)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java new file mode 100644 index 000000000..90ad6f02a --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java @@ -0,0 +1,245 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ResultsInner */ +@Beta // CHECKSTYLE:OFF +public class ResultsInner +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResultsInner. */ + protected ResultsInner() {} + + /** + * Set the filterId of this {@link ResultsInner} instance and return the same instance. + * + * @param filterId The filterId of this {@link ResultsInner} + * @return The same instance of this {@link ResultsInner} class + */ + @Nonnull + public ResultsInner filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link ResultsInner} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link ResultsInner} instance. + * + * @param filterId The filterId of this {@link ResultsInner} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link ResultsInner} instance and return the same instance. + * + * @param results The results of this {@link ResultsInner} + * @return The same instance of this {@link ResultsInner} class + */ + @Nonnull + public ResultsInner results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link ResultsInner}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link ResultsInner} + */ + @Nonnull + public ResultsInner addResultsItem(@Nonnull final DocumentsChunk resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * + * @return results The results of this {@link ResultsInner} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link ResultsInner} instance. + * + * @param results The results of this {@link ResultsInner} + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResultsInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResultsInner} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ResultsInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResultsInner} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ResultsInner resultsInner = (ResultsInner) o; + return Objects.equals(this.cloudSdkCustomFields, resultsInner.cloudSdkCustomFields) + && Objects.equals(this.filterId, resultsInner.filterId) + && Objects.equals(this.results, resultsInner.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResultsInner {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner} instance + * with all required arguments. + */ + public static Builder create() { + return (filterId) -> (results) -> new ResultsInner().filterId(filterId).results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link ResultsInner} instance. + * + * @param filterId The filterId of this {@link ResultsInner} + * @return The ResultsInner builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the results of this {@link ResultsInner} instance. + * + * @param results The results of this {@link ResultsInner} + * @return The ResultsInner instance. + */ + ResultsInner results(@Nonnull final List results); + + /** + * Set the results of this {@link ResultsInner} instance. + * + * @param results The results of this {@link ResultsInner} + * @return The ResultsInner instance. + */ + default ResultsInner results(@Nonnull final DocumentsChunk... results) { + return results(Arrays.asList(results)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java new file mode 100644 index 000000000..87eed29c8 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java @@ -0,0 +1,271 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ResultsInner1 */ +@Beta // CHECKSTYLE:OFF +public class ResultsInner1 +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResultsInner1. */ + protected ResultsInner1() {} + + /** + * Set the filterId of this {@link ResultsInner1} instance and return the same instance. + * + * @param filterId The filterId of this {@link ResultsInner1} + * @return The same instance of this {@link ResultsInner1} class + */ + @Nonnull + public ResultsInner1 filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link ResultsInner1} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link ResultsInner1} instance. + * + * @param filterId The filterId of this {@link ResultsInner1} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link ResultsInner1} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link ResultsInner1} class + */ + @Nonnull + public ResultsInner1 results(@Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link ResultsInner1}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link ResultsInner1} + */ + @Nonnull + public ResultsInner1 addResultsItem( + @Nonnull final RetievalDataRepositorySearchResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link ResultsInner1} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link ResultsInner1} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Set the message of this {@link ResultsInner1} instance and return the same instance. + * + * @param message The message of this {@link ResultsInner1} + * @return The same instance of this {@link ResultsInner1} class + */ + @Nonnull + public ResultsInner1 message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link ResultsInner1} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link ResultsInner1} instance. + * + * @param message The message of this {@link ResultsInner1} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResultsInner1}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResultsInner1} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ResultsInner1 has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResultsInner1} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ResultsInner1 resultsInner1 = (ResultsInner1) o; + return Objects.equals(this.cloudSdkCustomFields, resultsInner1.cloudSdkCustomFields) + && Objects.equals(this.filterId, resultsInner1.filterId) + && Objects.equals(this.results, resultsInner1.results) + && Objects.equals(this.message, resultsInner1.message); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResultsInner1 {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner1} instance + * with all required arguments. + */ + public static Builder create() { + return (filterId) -> (message) -> new ResultsInner1().filterId(filterId).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link ResultsInner1} instance. + * + * @param filterId The filterId of this {@link ResultsInner1} + * @return The ResultsInner1 builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link ResultsInner1} instance. + * + * @param message The message of this {@link ResultsInner1} + * @return The ResultsInner1 instance. + */ + ResultsInner1 message(@Nonnull final String message); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java new file mode 100644 index 000000000..efb4a6d1b --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java @@ -0,0 +1,181 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalDataRepositorySearchResult */ +@Beta // CHECKSTYLE:OFF +public class RetievalDataRepositorySearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("dataRepository") + private DataRepositoryWithDocuments dataRepository; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalDataRepositorySearchResult. */ + protected RetievalDataRepositorySearchResult() {} + + /** + * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance and return + * the same instance. + * + * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * @return The same instance of this {@link RetievalDataRepositorySearchResult} class + */ + @Nonnull + public RetievalDataRepositorySearchResult dataRepository( + @Nonnull final DataRepositoryWithDocuments dataRepository) { + this.dataRepository = dataRepository; + return this; + } + + /** + * Get dataRepository + * + * @return dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * instance. + */ + @Nonnull + public DataRepositoryWithDocuments getDataRepository() { + return dataRepository; + } + + /** + * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. + * + * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + */ + public void setDataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository) { + this.dataRepository = dataRepository; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetievalDataRepositorySearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetievalDataRepositorySearchResult} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalDataRepositorySearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalDataRepositorySearchResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalDataRepositorySearchResult retievalDataRepositorySearchResult = + (RetievalDataRepositorySearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, retievalDataRepositorySearchResult.cloudSdkCustomFields) + && Objects.equals(this.dataRepository, retievalDataRepositorySearchResult.dataRepository); + } + + @Override + public int hashCode() { + return Objects.hash(dataRepository, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalDataRepositorySearchResult {\n"); + sb.append(" dataRepository: ").append(toIndentedString(dataRepository)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetievalDataRepositorySearchResult} instance with all required arguments. + */ + public static Builder create() { + return (dataRepository) -> + new RetievalDataRepositorySearchResult().dataRepository(dataRepository); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. + * + * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * @return The RetievalDataRepositorySearchResult instance. + */ + RetievalDataRepositorySearchResult dataRepository( + @Nonnull final DataRepositoryWithDocuments dataRepository); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java new file mode 100644 index 000000000..e0e49a37f --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java @@ -0,0 +1,232 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalPerFilterSearchResult */ +@Beta // CHECKSTYLE:OFF +public class RetievalPerFilterSearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalPerFilterSearchResult. */ + protected RetievalPerFilterSearchResult() {} + + /** + * Set the filterId of this {@link RetievalPerFilterSearchResult} instance and return the same + * instance. + * + * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + * @return The same instance of this {@link RetievalPerFilterSearchResult} class + */ + @Nonnull + public RetievalPerFilterSearchResult filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link RetievalPerFilterSearchResult} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link RetievalPerFilterSearchResult} instance and return the same + * instance. + * + * @param results List of returned results. + * @return The same instance of this {@link RetievalPerFilterSearchResult} class + */ + @Nonnull + public RetievalPerFilterSearchResult results( + @Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link RetievalPerFilterSearchResult}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link RetievalPerFilterSearchResult} + */ + @Nonnull + public RetievalPerFilterSearchResult addResultsItem( + @Nonnull final RetievalDataRepositorySearchResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link RetievalPerFilterSearchResult} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link RetievalPerFilterSearchResult} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetievalPerFilterSearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetievalPerFilterSearchResult} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalPerFilterSearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalPerFilterSearchResult} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalPerFilterSearchResult retievalPerFilterSearchResult = + (RetievalPerFilterSearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, retievalPerFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, retievalPerFilterSearchResult.filterId) + && Objects.equals(this.results, retievalPerFilterSearchResult.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalPerFilterSearchResult {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetievalPerFilterSearchResult} instance with all required arguments. + */ + public static Builder create() { + return (filterId) -> new RetievalPerFilterSearchResult().filterId(filterId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + * @return The RetievalPerFilterSearchResult instance. + */ + RetievalPerFilterSearchResult filterId(@Nonnull final String filterId); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java new file mode 100644 index 000000000..d1585a4b1 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java @@ -0,0 +1,177 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalPerFilterSearchResultWithError */ +@Beta // CHECKSTYLE:OFF +public class RetievalPerFilterSearchResultWithError +// CHECKSTYLE:ON +{ + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalPerFilterSearchResultWithError. */ + protected RetievalPerFilterSearchResultWithError() {} + + /** + * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance and return the + * same instance. + * + * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + * @return The same instance of this {@link RetievalPerFilterSearchResultWithError} class + */ + @Nonnull + public RetievalPerFilterSearchResultWithError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link RetievalPerFilterSearchResultWithError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. + * + * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetievalPerFilterSearchResultWithError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * RetievalPerFilterSearchResultWithError} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalPerFilterSearchResultWithError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalPerFilterSearchResultWithError} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalPerFilterSearchResultWithError retievalPerFilterSearchResultWithError = + (RetievalPerFilterSearchResultWithError) o; + return Objects.equals( + this.cloudSdkCustomFields, retievalPerFilterSearchResultWithError.cloudSdkCustomFields) + && Objects.equals(this.message, retievalPerFilterSearchResultWithError.message); + } + + @Override + public int hashCode() { + return Objects.hash(message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalPerFilterSearchResultWithError {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetievalPerFilterSearchResultWithError} instance with all required arguments. + */ + public static Builder create() { + return (message) -> new RetievalPerFilterSearchResultWithError().message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. + * + * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + * @return The RetievalPerFilterSearchResultWithError instance. + */ + RetievalPerFilterSearchResultWithError message(@Nonnull final String message); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java new file mode 100644 index 000000000..101ca3db6 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java @@ -0,0 +1,199 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalSearchResults */ +@Beta // CHECKSTYLE:OFF +public class RetievalSearchResults +// CHECKSTYLE:ON +{ + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalSearchResults. */ + protected RetievalSearchResults() {} + + /** + * Set the results of this {@link RetievalSearchResults} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link RetievalSearchResults} class + */ + @Nonnull + public RetievalSearchResults results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link RetievalSearchResults}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link RetievalSearchResults} + */ + @Nonnull + public RetievalSearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link RetievalSearchResults} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link RetievalSearchResults} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetievalSearchResults}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetievalSearchResults} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalSearchResults has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalSearchResults} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalSearchResults retievalSearchResults = (RetievalSearchResults) o; + return Objects.equals(this.cloudSdkCustomFields, retievalSearchResults.cloudSdkCustomFields) + && Objects.equals(this.results, retievalSearchResults.results); + } + + @Override + public int hashCode() { + return Objects.hash(results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalSearchResults {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetievalSearchResults} + * instance with all required arguments. + */ + public static Builder create() { + return (results) -> new RetievalSearchResults().results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the results of this {@link RetievalSearchResults} instance. + * + * @param results List of returned results. + * @return The RetievalSearchResults instance. + */ + RetievalSearchResults results(@Nonnull final List results); + + /** + * Set the results of this {@link RetievalSearchResults} instance. + * + * @param results List of returned results. + * @return The RetievalSearchResults instance. + */ + default RetievalSearchResults results(@Nonnull final ResultsInner1... results) { + return results(Arrays.asList(results)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java new file mode 100644 index 000000000..c6f10666f --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java @@ -0,0 +1,296 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalDocument */ +@Beta // CHECKSTYLE:OFF +public class RetrievalDocument +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalDocument. */ + protected RetrievalDocument() {} + + /** + * Set the id of this {@link RetrievalDocument} instance and return the same instance. + * + * @param id The id of this {@link RetrievalDocument} + * @return The same instance of this {@link RetrievalDocument} class + */ + @Nonnull + public RetrievalDocument id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link RetrievalDocument} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link RetrievalDocument} instance. + * + * @param id The id of this {@link RetrievalDocument} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the metadata of this {@link RetrievalDocument} instance and return the same instance. + * + * @param metadata The metadata of this {@link RetrievalDocument} + * @return The same instance of this {@link RetrievalDocument} class + */ + @Nonnull + public RetrievalDocument metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link RetrievalDocument}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link RetrievalDocument} + */ + @Nonnull + public RetrievalDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link RetrievalDocument} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link RetrievalDocument} instance. + * + * @param metadata The metadata of this {@link RetrievalDocument} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the chunks of this {@link RetrievalDocument} instance and return the same instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + * @return The same instance of this {@link RetrievalDocument} class + */ + @Nonnull + public RetrievalDocument chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link RetrievalDocument}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link RetrievalDocument} + */ + @Nonnull + public RetrievalDocument addChunksItem(@Nonnull final Chunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link RetrievalDocument} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link RetrievalDocument} instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalDocument}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalDocument} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("RetrievalDocument has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetrievalDocument} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalDocument retrievalDocument = (RetrievalDocument) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalDocument.cloudSdkCustomFields) + && Objects.equals(this.id, retrievalDocument.id) + && Objects.equals(this.metadata, retrievalDocument.metadata) + && Objects.equals(this.chunks, retrievalDocument.chunks); + } + + @Override + public int hashCode() { + return Objects.hash(id, metadata, chunks, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalDocument {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalDocument} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> (chunks) -> new RetrievalDocument().id(id).chunks(chunks); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link RetrievalDocument} instance. + * + * @param id The id of this {@link RetrievalDocument} + * @return The RetrievalDocument builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the chunks of this {@link RetrievalDocument} instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + * @return The RetrievalDocument instance. + */ + RetrievalDocument chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link RetrievalDocument} instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + * @return The RetrievalDocument instance. + */ + default RetrievalDocument chunks(@Nonnull final Chunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java new file mode 100644 index 000000000..3d914fb55 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -0,0 +1,509 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Limit scope of search to certain DataRepositories, Documents or Chunks. */ +@Beta // CHECKSTYLE:OFF +public class RetrievalSearchFilter extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("searchConfiguration") + private SearchConfiguration searchConfiguration; + + @JsonProperty("dataRepositories") + private List dataRepositories = new ArrayList<>(Arrays.asList("*")); + + @JsonProperty("dataRepositoryType") + private DataRepositoryType dataRepositoryType; + + @JsonProperty("dataRepositoryMetadata") + private List dataRepositoryMetadata = new ArrayList<>(); + + @JsonProperty("documentMetadata") + private List documentMetadata = new ArrayList<>(); + + @JsonProperty("chunkMetadata") + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchFilter. */ + protected RetrievalSearchFilter() { + super(); + } + + /** + * Set the id of this {@link RetrievalSearchFilter} instance and return the same instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link RetrievalSearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the searchConfiguration of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter searchConfiguration( + @Nullable final SearchConfiguration searchConfiguration) { + this.searchConfiguration = searchConfiguration; + return this; + } + + /** + * Get searchConfiguration + * + * @return searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} + * instance. + */ + @Nonnull + public SearchConfiguration getSearchConfiguration() { + return searchConfiguration; + } + + /** + * Set the searchConfiguration of this {@link RetrievalSearchFilter} instance. + * + * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} + */ + public void setSearchConfiguration(@Nullable final SearchConfiguration searchConfiguration) { + this.searchConfiguration = searchConfiguration; + } + + /** + * Set the dataRepositories of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a + * specific list of DataRepository ids. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter dataRepositories(@Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + return this; + } + + /** + * Add one dataRepositories instance to this {@link RetrievalSearchFilter}. + * + * @param dataRepositoriesItem The dataRepositories that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addDataRepositoriesItem(@Nonnull final String dataRepositoriesItem) { + if (this.dataRepositories == null) { + this.dataRepositories = new ArrayList<>(Arrays.asList("*")); + } + this.dataRepositories.add(dataRepositoriesItem); + return this; + } + + /** + * Specify ['*'] to search across all DataRepositories or give a specific list of + * DataRepository ids. + * + * @return dataRepositories The dataRepositories of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public List getDataRepositories() { + return dataRepositories; + } + + /** + * Set the dataRepositories of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a + * specific list of DataRepository ids. + */ + public void setDataRepositories(@Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + } + + /** + * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter dataRepositoryType( + @Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + return this; + } + + /** + * Get dataRepositoryType + * + * @return dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + * instance. + */ + @Nullable + public DataRepositoryType getDataRepositoryType() { + return dataRepositoryType; + } + + /** + * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + */ + public void setDataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + } + + /** + * Set the dataRepositoryMetadata of this {@link RetrievalSearchFilter} instance and return the + * same instance. + * + * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those + * annotated with the given metadata. Useful when combined with + * dataRepositories=['*'] + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter dataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + return this; + } + + /** + * Add one dataRepositoryMetadata instance to this {@link RetrievalSearchFilter}. + * + * @param dataRepositoryMetadataItem The dataRepositoryMetadata that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addDataRepositoryMetadataItem( + @Nonnull final KeyValueListPair dataRepositoryMetadataItem) { + if (this.dataRepositoryMetadata == null) { + this.dataRepositoryMetadata = new ArrayList<>(); + } + this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); + return this; + } + + /** + * Restrict DataRepositories considered during search to those annotated with the given metadata. + * Useful when combined with dataRepositories=['*'] + * + * @return dataRepositoryMetadata The dataRepositoryMetadata of this {@link RetrievalSearchFilter} + * instance. + */ + @Nonnull + public List getDataRepositoryMetadata() { + return dataRepositoryMetadata; + } + + /** + * Set the dataRepositoryMetadata of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those + * annotated with the given metadata. Useful when combined with + * dataRepositories=['*'] + */ + public void setDataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + } + + /** + * Set the documentMetadata of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link RetrievalSearchFilter}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addDocumentMetadataItem( + @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { + if (this.documentMetadata == null) { + this.documentMetadata = new ArrayList<>(); + } + this.documentMetadata.add(documentMetadataItem); + return this; + } + + /** + * Restrict documents considered during search to those annotated with the given metadata. + * + * @return documentMetadata The documentMetadata of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link RetrievalSearchFilter} instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + */ + public void setDocumentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter chunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link RetrievalSearchFilter}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addChunkMetadataItem( + @Nonnull final KeyValueListPair chunkMetadataItem) { + if (this.chunkMetadata == null) { + this.chunkMetadata = new ArrayList<>(); + } + this.chunkMetadata.add(chunkMetadataItem); + return this; + } + + /** + * Restrict chunks considered during search to those with the given metadata. + * + * @return chunkMetadata The chunkMetadata of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link RetrievalSearchFilter} instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalSearchFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalSearchFilter} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalSearchFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchFilter} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalSearchFilter retrievalSearchFilter = (RetrievalSearchFilter) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalSearchFilter.cloudSdkCustomFields) + && Objects.equals(this.id, retrievalSearchFilter.id) + && Objects.equals(this.searchConfiguration, retrievalSearchFilter.searchConfiguration) + && Objects.equals(this.dataRepositories, retrievalSearchFilter.dataRepositories) + && Objects.equals(this.dataRepositoryType, retrievalSearchFilter.dataRepositoryType) + && Objects.equals(this.dataRepositoryMetadata, retrievalSearchFilter.dataRepositoryMetadata) + && Objects.equals(this.documentMetadata, retrievalSearchFilter.documentMetadata) + && Objects.equals(this.chunkMetadata, retrievalSearchFilter.chunkMetadata) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + searchConfiguration, + dataRepositories, + dataRepositoryType, + dataRepositoryMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields, + super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchFilter {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" searchConfiguration: ") + .append(toIndentedString(searchConfiguration)) + .append("\n"); + sb.append(" dataRepositories: ").append(toIndentedString(dataRepositories)).append("\n"); + sb.append(" dataRepositoryType: ").append(toIndentedString(dataRepositoryType)).append("\n"); + sb.append(" dataRepositoryMetadata: ") + .append(toIndentedString(dataRepositoryMetadata)) + .append("\n"); + sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); + sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchFilter} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (dataRepositoryType) -> + new RetrievalSearchFilter().id(id).dataRepositoryType(dataRepositoryType); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link RetrievalSearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The RetrievalSearchFilter builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + * @return The RetrievalSearchFilter instance. + */ + RetrievalSearchFilter dataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java new file mode 100644 index 000000000..eea77d1f4 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java @@ -0,0 +1,251 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalSearchInput */ +@Beta // CHECKSTYLE:OFF +public class RetrievalSearchInput extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("query") + private String query; + + @JsonProperty("filters") + private List filters = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchInput. */ + protected RetrievalSearchInput() { + super(); + } + + /** + * Set the query of this {@link RetrievalSearchInput} instance and return the same instance. + * + * @param query Query string + * @return The same instance of this {@link RetrievalSearchInput} class + */ + @Nonnull + public RetrievalSearchInput query(@Nonnull final String query) { + this.query = query; + return this; + } + + /** + * Query string + * + * @return query The query of this {@link RetrievalSearchInput} instance. + */ + @Nonnull + public String getQuery() { + return query; + } + + /** + * Set the query of this {@link RetrievalSearchInput} instance. + * + * @param query Query string + */ + public void setQuery(@Nonnull final String query) { + this.query = query; + } + + /** + * Set the filters of this {@link RetrievalSearchInput} instance and return the same instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The same instance of this {@link RetrievalSearchInput} class + */ + @Nonnull + public RetrievalSearchInput filters(@Nonnull final List filters) { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link RetrievalSearchInput}. + * + * @param filtersItem The filters that should be added + * @return The same instance of type {@link RetrievalSearchInput} + */ + @Nonnull + public RetrievalSearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Get filters + * + * @return filters The filters of this {@link RetrievalSearchInput} instance. + */ + @Nonnull + public List getFilters() { + return filters; + } + + /** + * Set the filters of this {@link RetrievalSearchInput} instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + */ + public void setFilters(@Nonnull final List filters) { + this.filters = filters; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalSearchInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalSearchInput} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalSearchInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchInput} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalSearchInput retrievalSearchInput = (RetrievalSearchInput) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalSearchInput.cloudSdkCustomFields) + && Objects.equals(this.query, retrievalSearchInput.query) + && Objects.equals(this.filters, retrievalSearchInput.filters) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(query, filters, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchInput {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchInput} + * instance with all required arguments. + */ + public static Builder create() { + return (query) -> (filters) -> new RetrievalSearchInput().query(query).filters(filters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the query of this {@link RetrievalSearchInput} instance. + * + * @param query Query string + * @return The RetrievalSearchInput builder. + */ + Builder1 query(@Nonnull final String query); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the filters of this {@link RetrievalSearchInput} instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The RetrievalSearchInput instance. + */ + RetrievalSearchInput filters(@Nonnull final List filters); + + /** + * Set the filters of this {@link RetrievalSearchInput} instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The RetrievalSearchInput instance. + */ + default RetrievalSearchInput filters(@Nonnull final RetrievalSearchFilter... filters) { + return filters(Arrays.asList(filters)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java new file mode 100644 index 000000000..884394f4c --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java @@ -0,0 +1,209 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchConfiguration */ +@Beta // CHECKSTYLE:OFF +public class SearchConfiguration extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("maxChunkCount") + private Integer maxChunkCount; + + @JsonProperty("maxDocumentCount") + private Integer maxDocumentCount; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchConfiguration. */ + protected SearchConfiguration() { + super(); + } + + /** + * Set the maxChunkCount of this {@link SearchConfiguration} instance and return the same + * instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 Maximum: 0 + * @return The same instance of this {@link SearchConfiguration} class + */ + @Nonnull + public SearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + return this; + } + + /** + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + * minimum: 0 maximum: 0 + * + * @return maxChunkCount The maxChunkCount of this {@link SearchConfiguration} instance. + */ + @Nonnull + public Integer getMaxChunkCount() { + return maxChunkCount; + } + + /** + * Set the maxChunkCount of this {@link SearchConfiguration} instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 Maximum: 0 + */ + public void setMaxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + } + + /** + * Set the maxDocumentCount of this {@link SearchConfiguration} instance and return the same + * instance. + * + * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of + * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount + * is given, then only one chunk per document is returned. Minimum: 0 Maximum: 0 + * @return The same instance of this {@link SearchConfiguration} class + */ + @Nonnull + public SearchConfiguration maxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + return this; + } + + /** + * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be + * returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only + * one chunk per document is returned. minimum: 0 maximum: 0 + * + * @return maxDocumentCount The maxDocumentCount of this {@link SearchConfiguration} instance. + */ + @Nonnull + public Integer getMaxDocumentCount() { + return maxDocumentCount; + } + + /** + * Set the maxDocumentCount of this {@link SearchConfiguration} instance. + * + * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of + * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount + * is given, then only one chunk per document is returned. Minimum: 0 Maximum: 0 + */ + public void setMaxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchConfiguration} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "SearchConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchConfiguration} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchConfiguration searchConfiguration = (SearchConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, searchConfiguration.cloudSdkCustomFields) + && Objects.equals(this.maxChunkCount, searchConfiguration.maxChunkCount) + && Objects.equals(this.maxDocumentCount, searchConfiguration.maxDocumentCount) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchConfiguration {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); + sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link SearchConfiguration} instance. No arguments are required. */ + public static SearchConfiguration create() { + return new SearchConfiguration(); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java new file mode 100644 index 000000000..6c6b13a3b --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java @@ -0,0 +1,311 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchDocumentKeyValueListPair */ +@Beta // CHECKSTYLE:OFF +public class SearchDocumentKeyValueListPair extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonProperty("selectMode") + private List selectMode = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchDocumentKeyValueListPair. */ + protected SearchDocumentKeyValueListPair() { + super(); + } + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param selectMode Select mode for search filters + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair selectMode( + @Nullable final List selectMode) { + this.selectMode = selectMode; + return this; + } + + /** + * Add one selectMode instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param selectModeItem The selectMode that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addSelectModeItem( + @Nonnull final SearchSelectOptionEnum selectModeItem) { + if (this.selectMode == null) { + this.selectMode = new ArrayList<>(); + } + this.selectMode.add(selectModeItem); + return this; + } + + /** + * Select mode for search filters + * + * @return selectMode The selectMode of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getSelectMode() { + return selectMode; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param selectMode Select mode for search filters + */ + public void setSelectMode(@Nullable final List selectMode) { + this.selectMode = selectMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "SearchDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = + (SearchDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, searchDocumentKeyValueListPair.key) + && Objects.equals(this.value, searchDocumentKeyValueListPair.value) + && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, selectMode, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchDocumentKeyValueListPair {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * SearchDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new SearchDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair instance. + */ + SearchDocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair instance. + */ + default SearchDocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java new file mode 100644 index 000000000..d76d971cf --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java @@ -0,0 +1,474 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchFilter */ +@Beta // CHECKSTYLE:OFF +public class SearchFilter extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("collectionIds") + private List collectionIds = new ArrayList<>(); + + @JsonProperty("configuration") + private SearchConfiguration _configuration; + + @JsonProperty("collectionMetadata") + private List collectionMetadata = new ArrayList<>(); + + @JsonProperty("documentMetadata") + private List documentMetadata = new ArrayList<>(); + + @JsonProperty("chunkMetadata") + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchFilter. */ + protected SearchFilter() { + super(); + } + + /** + * Set the id of this {@link SearchFilter} instance and return the same instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link SearchFilter} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link SearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the collectionIds of this {@link SearchFilter} instance and return the same instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter collectionIds(@Nonnull final List collectionIds) { + this.collectionIds = collectionIds; + return this; + } + + /** + * Add one collectionIds instance to this {@link SearchFilter}. + * + * @param collectionIdsItem The collectionIds that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addCollectionIdsItem(@Nonnull final String collectionIdsItem) { + if (this.collectionIds == null) { + this.collectionIds = new ArrayList<>(); + } + this.collectionIds.add(collectionIdsItem); + return this; + } + + /** + * Get collectionIds + * + * @return collectionIds The collectionIds of this {@link SearchFilter} instance. + */ + @Nonnull + public List getCollectionIds() { + return collectionIds; + } + + /** + * Set the collectionIds of this {@link SearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + */ + public void setCollectionIds(@Nonnull final List collectionIds) { + this.collectionIds = collectionIds; + } + + /** + * Set the _configuration of this {@link SearchFilter} instance and return the same instance. + * + * @param _configuration The _configuration of this {@link SearchFilter} + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter _configuration(@Nonnull final SearchConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link SearchFilter} instance. + */ + @Nonnull + public SearchConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link SearchFilter} instance. + * + * @param _configuration The _configuration of this {@link SearchFilter} + */ + public void setConfiguration(@Nonnull final SearchConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Set the collectionMetadata of this {@link SearchFilter} instance and return the same instance. + * + * @param collectionMetadata Restrict collections considered during search to those annotated with + * the given metadata. Useful when combined with collections=['*'] + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter collectionMetadata( + @Nullable final List collectionMetadata) { + this.collectionMetadata = collectionMetadata; + return this; + } + + /** + * Add one collectionMetadata instance to this {@link SearchFilter}. + * + * @param collectionMetadataItem The collectionMetadata that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addCollectionMetadataItem( + @Nonnull final KeyValueListPair collectionMetadataItem) { + if (this.collectionMetadata == null) { + this.collectionMetadata = new ArrayList<>(); + } + this.collectionMetadata.add(collectionMetadataItem); + return this; + } + + /** + * Restrict collections considered during search to those annotated with the given metadata. + * Useful when combined with collections=['*'] + * + * @return collectionMetadata The collectionMetadata of this {@link SearchFilter} instance. + */ + @Nonnull + public List getCollectionMetadata() { + return collectionMetadata; + } + + /** + * Set the collectionMetadata of this {@link SearchFilter} instance. + * + * @param collectionMetadata Restrict collections considered during search to those annotated with + * the given metadata. Useful when combined with collections=['*'] + */ + public void setCollectionMetadata(@Nullable final List collectionMetadata) { + this.collectionMetadata = collectionMetadata; + } + + /** + * Set the documentMetadata of this {@link SearchFilter} instance and return the same instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link SearchFilter}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addDocumentMetadataItem( + @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { + if (this.documentMetadata == null) { + this.documentMetadata = new ArrayList<>(); + } + this.documentMetadata.add(documentMetadataItem); + return this; + } + + /** + * Restrict documents considered during search to those annotated with the given metadata. + * + * @return documentMetadata The documentMetadata of this {@link SearchFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link SearchFilter} instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + */ + public void setDocumentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link SearchFilter} instance and return the same instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter chunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link SearchFilter}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addChunkMetadataItem(@Nonnull final KeyValueListPair chunkMetadataItem) { + if (this.chunkMetadata == null) { + this.chunkMetadata = new ArrayList<>(); + } + this.chunkMetadata.add(chunkMetadataItem); + return this; + } + + /** + * Restrict chunks considered during search to those with the given metadata. + * + * @return chunkMetadata The chunkMetadata of this {@link SearchFilter} instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link SearchFilter} instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchFilter} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("SearchFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchFilter} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchFilter searchFilter = (SearchFilter) o; + return Objects.equals(this.cloudSdkCustomFields, searchFilter.cloudSdkCustomFields) + && Objects.equals(this.id, searchFilter.id) + && Objects.equals(this.collectionIds, searchFilter.collectionIds) + && Objects.equals(this._configuration, searchFilter._configuration) + && Objects.equals(this.collectionMetadata, searchFilter.collectionMetadata) + && Objects.equals(this.documentMetadata, searchFilter.documentMetadata) + && Objects.equals(this.chunkMetadata, searchFilter.chunkMetadata) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + collectionIds, + _configuration, + collectionMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields, + super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchFilter {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" collectionMetadata: ").append(toIndentedString(collectionMetadata)).append("\n"); + sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); + sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link SearchFilter} instance + * with all required arguments. + */ + public static Builder create() { + return (id) -> + (collectionIds) -> + (_configuration) -> + new SearchFilter() + .id(id) + .collectionIds(collectionIds) + ._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link SearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The SearchFilter builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the collectionIds of this {@link SearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + * @return The SearchFilter builder. + */ + Builder2 collectionIds(@Nonnull final List collectionIds); + + /** + * Set the collectionIds of this {@link SearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + * @return The SearchFilter builder. + */ + default Builder2 collectionIds(@Nonnull final String... collectionIds) { + return collectionIds(Arrays.asList(collectionIds)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the _configuration of this {@link SearchFilter} instance. + * + * @param _configuration The _configuration of this {@link SearchFilter} + * @return The SearchFilter instance. + */ + SearchFilter _configuration(@Nonnull final SearchConfiguration _configuration); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java new file mode 100644 index 000000000..837783ef5 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java @@ -0,0 +1,198 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchResults */ +@Beta // CHECKSTYLE:OFF +public class SearchResults +// CHECKSTYLE:ON +{ + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchResults. */ + protected SearchResults() {} + + /** + * Set the results of this {@link SearchResults} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link SearchResults} class + */ + @Nonnull + public SearchResults results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link SearchResults}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link SearchResults} + */ + @Nonnull + public SearchResults addResultsItem(@Nonnull final ResultsInner resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link SearchResults} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link SearchResults} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchResults}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchResults} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("SearchResults has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchResults} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchResults searchResults = (SearchResults) o; + return Objects.equals(this.cloudSdkCustomFields, searchResults.cloudSdkCustomFields) + && Objects.equals(this.results, searchResults.results); + } + + @Override + public int hashCode() { + return Objects.hash(results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchResults {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link SearchResults} instance + * with all required arguments. + */ + public static Builder create() { + return (results) -> new SearchResults().results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the results of this {@link SearchResults} instance. + * + * @param results List of returned results. + * @return The SearchResults instance. + */ + SearchResults results(@Nonnull final List results); + + /** + * Set the results of this {@link SearchResults} instance. + * + * @param results List of returned results. + * @return The SearchResults instance. + */ + default SearchResults results(@Nonnull final ResultsInner... results) { + return results(Arrays.asList(results)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java new file mode 100644 index 000000000..447083875 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java @@ -0,0 +1,63 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets SearchSelectOptionEnum */ +public enum SearchSelectOptionEnum { + IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + SearchSelectOptionEnum(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static SearchSelectOptionEnum fromValue(@Nonnull final String value) { + for (final SearchSelectOptionEnum b : SearchSelectOptionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java new file mode 100644 index 000000000..62a0b737e --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java @@ -0,0 +1,250 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TextOnlyBaseChunk */ +@Beta // CHECKSTYLE:OFF +public class TextOnlyBaseChunk extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("content") + private String content; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TextOnlyBaseChunk. */ + protected TextOnlyBaseChunk() { + super(); + } + + /** + * Set the content of this {@link TextOnlyBaseChunk} instance and return the same instance. + * + * @param content The content of this {@link TextOnlyBaseChunk} + * @return The same instance of this {@link TextOnlyBaseChunk} class + */ + @Nonnull + public TextOnlyBaseChunk content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link TextOnlyBaseChunk} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link TextOnlyBaseChunk} instance. + * + * @param content The content of this {@link TextOnlyBaseChunk} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + * @return The same instance of this {@link TextOnlyBaseChunk} class + */ + @Nonnull + public TextOnlyBaseChunk metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link TextOnlyBaseChunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link TextOnlyBaseChunk} + */ + @Nonnull + public TextOnlyBaseChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link TextOnlyBaseChunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link TextOnlyBaseChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TextOnlyBaseChunk} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("TextOnlyBaseChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TextOnlyBaseChunk} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final TextOnlyBaseChunk textOnlyBaseChunk = (TextOnlyBaseChunk) o; + return Objects.equals(this.cloudSdkCustomFields, textOnlyBaseChunk.cloudSdkCustomFields) + && Objects.equals(this.content, textOnlyBaseChunk.content) + && Objects.equals(this.metadata, textOnlyBaseChunk.metadata) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(content, metadata, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TextOnlyBaseChunk {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link TextOnlyBaseChunk} + * instance with all required arguments. + */ + public static Builder create() { + return (content) -> (metadata) -> new TextOnlyBaseChunk().content(content).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the content of this {@link TextOnlyBaseChunk} instance. + * + * @param content The content of this {@link TextOnlyBaseChunk} + * @return The TextOnlyBaseChunk builder. + */ + Builder1 content(@Nonnull final String content); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + * @return The TextOnlyBaseChunk instance. + */ + TextOnlyBaseChunk metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + * @return The TextOnlyBaseChunk instance. + */ + default TextOnlyBaseChunk metadata(@Nonnull final KeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java new file mode 100644 index 000000000..3ef11ec69 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java @@ -0,0 +1,250 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TextSearchRequest */ +@Beta // CHECKSTYLE:OFF +public class TextSearchRequest extends HashMap +// CHECKSTYLE:ON +{ + @JsonProperty("query") + private String query; + + @JsonProperty("filters") + private List filters = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TextSearchRequest. */ + protected TextSearchRequest() { + super(); + } + + /** + * Set the query of this {@link TextSearchRequest} instance and return the same instance. + * + * @param query Query string + * @return The same instance of this {@link TextSearchRequest} class + */ + @Nonnull + public TextSearchRequest query(@Nonnull final String query) { + this.query = query; + return this; + } + + /** + * Query string + * + * @return query The query of this {@link TextSearchRequest} instance. + */ + @Nonnull + public String getQuery() { + return query; + } + + /** + * Set the query of this {@link TextSearchRequest} instance. + * + * @param query Query string + */ + public void setQuery(@Nonnull final String query) { + this.query = query; + } + + /** + * Set the filters of this {@link TextSearchRequest} instance and return the same instance. + * + * @param filters The filters of this {@link TextSearchRequest} + * @return The same instance of this {@link TextSearchRequest} class + */ + @Nonnull + public TextSearchRequest filters(@Nonnull final List filters) { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link TextSearchRequest}. + * + * @param filtersItem The filters that should be added + * @return The same instance of type {@link TextSearchRequest} + */ + @Nonnull + public TextSearchRequest addFiltersItem(@Nonnull final SearchFilter filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Get filters + * + * @return filters The filters of this {@link TextSearchRequest} instance. + */ + @Nonnull + public List getFilters() { + return filters; + } + + /** + * Set the filters of this {@link TextSearchRequest} instance. + * + * @param filters The filters of this {@link TextSearchRequest} + */ + public void setFilters(@Nonnull final List filters) { + this.filters = filters; + } + + /** + * Get the names of the unrecognizable properties of the {@link TextSearchRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TextSearchRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("TextSearchRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TextSearchRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final TextSearchRequest textSearchRequest = (TextSearchRequest) o; + return Objects.equals(this.cloudSdkCustomFields, textSearchRequest.cloudSdkCustomFields) + && Objects.equals(this.query, textSearchRequest.query) + && Objects.equals(this.filters, textSearchRequest.filters) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(query, filters, cloudSdkCustomFields, super.hashCode()); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TextSearchRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link TextSearchRequest} + * instance with all required arguments. + */ + public static Builder create() { + return (query) -> (filters) -> new TextSearchRequest().query(query).filters(filters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the query of this {@link TextSearchRequest} instance. + * + * @param query Query string + * @return The TextSearchRequest builder. + */ + Builder1 query(@Nonnull final String query); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the filters of this {@link TextSearchRequest} instance. + * + * @param filters The filters of this {@link TextSearchRequest} + * @return The TextSearchRequest instance. + */ + TextSearchRequest filters(@Nonnull final List filters); + + /** + * Set the filters of this {@link TextSearchRequest} instance. + * + * @param filters The filters of this {@link TextSearchRequest} + * @return The TextSearchRequest instance. + */ + default TextSearchRequest filters(@Nonnull final SearchFilter... filters) { + return filters(Arrays.asList(filters)); + } + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java new file mode 100644 index 000000000..7a39e4e26 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java @@ -0,0 +1,24 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** VectorV1VectorEndpointsGetCollectionCreationStatus200Response */ +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = CollectionCreatedResponse.class), + @JsonSubTypes.Type(value = CollectionPendingResponse.class), +}) +public interface VectorV1VectorEndpointsGetCollectionCreationStatus200Response {} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java new file mode 100644 index 000000000..c9333ee46 --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java @@ -0,0 +1,24 @@ +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** VectorV1VectorEndpointsGetCollectionDeletionStatus200Response */ +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = CollectionDeletedResponse.class), + @JsonSubTypes.Type(value = CollectionPendingResponse.class), +}) +public interface VectorV1VectorEndpointsGetCollectionDeletionStatus200Response {} diff --git a/grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java b/grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java new file mode 100644 index 000000000..fcc92689a --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +package openapi.grounding.api; + +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Pipeline; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineId; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequst; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineStatus; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Pipelines; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Document Grounding Pipeline API in version 0.1.0. + * + *

SAP AI Core - API Specification AI Data Management api's + */ +public class PipelinesApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * + * @param httpDestination The destination that API should be used with + */ + public PipelinesApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public PipelinesApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Create a pipeline + * + *

201 - Returns pipelineId on successful creation. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelinePostRequst The value for the parameter pipelinePostRequst + * @return PipelineId + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PipelineId createPipeline( + @Nonnull final String aiResourceGroup, @Nonnull final PipelinePostRequst pipelinePostRequst) + throws OpenApiRequestException { + final Object localVarPostBody = pipelinePostRequst; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createPipeline"); + } + + // verify the required parameter 'pipelinePostRequst' is set + if (pipelinePostRequst == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelinePostRequst' when calling pipelineV1PipelineEndpointsCreatePipeline"); + } + + final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Delete a pipeline by pipeline id + * + *

204 - No Content + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelineId The ID of the pipeline to delete. + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse deletePipelineById( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deletePipelineById"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling deletePipelineById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.DELETE, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Get all pipelines + * + *

200 - Returns all pipelines for the tenant. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return Pipelines + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Pipelines getAllPipelines( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllPipelines"); + } + + final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get all pipelines + * + *

200 - Returns all pipelines for the tenant. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @return Pipelines + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Pipelines getAllPipelines(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getAllPipelines(aiResourceGroup, null, null, null); + } + + /** + * Get details of a pipeline by pipeline id + * + *

200 - Returns the pipeline for an pipelineId + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelineId The ID of the pipeline to get. + * @return Pipeline + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Pipeline getPipelineById( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getPipelineById"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getPipelineById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get pipeline status by pipeline id + * + *

200 - Returns the pipeline status for an pipelineId. + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param pipelineId The ID of the pipeline to get status. + * @return PipelineStatus + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PipelineStatus getPipelineStatus( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatus"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getPipelineStatus"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/status") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java b/grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java new file mode 100644 index 000000000..8a2a2e5f9 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +package openapi.grounding.api; + +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositories; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepository; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetievalSearchResults; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetrievalSearchInput; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Document Grounding Pipeline API in version 0.1.0. + * + *

SAP AI Core - API Specification AI Data Management api's + */ +public class RetrievalApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * + * @param httpDestination The destination that API should be used with + */ + public RetrievalApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public RetrievalApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * List all DataRepository objects. + * + *

List all DataRepository objects. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return DataRepositories + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DataRepositories getDataRepositories( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDataRepositories"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/retrieval/dataRepositories").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * List all DataRepository objects. + * + *

List all DataRepository objects. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @return DataRepositories + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DataRepositories getDataRepositories(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getDataRepositories(aiResourceGroup, null, null, null); + } + + /** + * List single DataRepository object. + * + *

List single DataRepository object. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + *

404 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param repositoryId The value for the parameter repositoryId + * @return DataRepository + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DataRepository getDataRepositoryById( + @Nonnull final String aiResourceGroup, @Nonnull final UUID repositoryId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDataRepositoryById"); + } + + // verify the required parameter 'repositoryId' is set + if (repositoryId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'repositoryId' when calling getDataRepositoryById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("repositoryId", repositoryId); + final String localVarPath = + UriComponentsBuilder.fromPath("/retrieval/dataRepositories/{repositoryId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Retrieve relevant content given a query string. + * + *

Retrieve relevant content given a query string. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param retrievalSearchInput The value for the parameter retrievalSearchInput + * @return RetievalSearchResults + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public RetievalSearchResults search( + @Nonnull final String aiResourceGroup, + @Nonnull final RetrievalSearchInput retrievalSearchInput) + throws OpenApiRequestException { + final Object localVarPostBody = retrievalSearchInput; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling search"); + } + + // verify the required parameter 'retrievalSearchInput' is set + if (retrievalSearchInput == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'retrievalSearchInput' when calling retrievalV1RetrievalEndpointsSearch"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/retrieval/search").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/api/VectorApi.java b/grounding/src/main/resources/openapi/grounding/api/VectorApi.java new file mode 100644 index 000000000..1909586a2 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/api/VectorApi.java @@ -0,0 +1,1055 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +package openapi.grounding.api; + +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Collection; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.CollectionRequest; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.CollectionsListResponse; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentCreateRequest; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentResponse; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentUpdateRequest; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Documents; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentsListResponse; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchResults; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextSearchRequest; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.VectorV1VectorEndpointsGetCollectionCreationStatus200Response; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.VectorV1VectorEndpointsGetCollectionDeletionStatus200Response; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Document Grounding Pipeline API in version 0.1.0. + * + *

SAP AI Core - API Specification AI Data Management api's + */ +public class VectorApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * + * @param httpDestination The destination that API should be used with + */ + public VectorApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public VectorApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Create collection + * + *

Creates a collection. This operation is asynchronous. Poll the collection resource and check + * the status field to understand creation status. + * + *

202 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionRequest The value for the parameter collectionRequest + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse createCollection( + @Nonnull final String aiResourceGroup, @Nonnull final CollectionRequest collectionRequest) + throws OpenApiRequestException { + final Object localVarPostBody = collectionRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createCollection"); + } + + // verify the required parameter 'collectionRequest' is set + if (collectionRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionRequest' when calling vectorV1VectorEndpointsCreateCollection"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Create documents in collection + * + *

Create and stores one or multiple documents into a collection. If omitted, 'id' will + * be auto-generated. + * + *

201 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentCreateRequest The value for the parameter documentCreateRequest + * @return DocumentsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsListResponse createDocuments( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final DocumentCreateRequest documentCreateRequest) + throws OpenApiRequestException { + final Object localVarPostBody = documentCreateRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createDocuments"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling createDocuments"); + } + + // verify the required parameter 'documentCreateRequest' is set + if (documentCreateRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentCreateRequest' when calling vectorV1VectorEndpointsCreateDocuments"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Delete collection by ID + * + *

Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for + * a 404 status code. + * + *

202 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse deleteCollectionById( + @Nonnull final String aiResourceGroup, @Nonnull final String collectionId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteCollectionById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling deleteCollectionById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.DELETE, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Delete a document + * + *

Deletes a specific document of a collection. + * + *

204 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentId The value for the parameter documentId + * @return An OpenApiResponse containing the status code of the HttpResponse. + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenApiResponse deleteDocumentById( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final UUID documentId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteDocumentById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling deleteDocumentById"); + } + + // verify the required parameter 'documentId' is set + if (documentId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentId' when calling deleteDocumentById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + localVarPathParams.put("documentId", documentId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents/{documentId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.DELETE, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } + + /** + * Get collections + * + *

Gets a list of collections. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return CollectionsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CollectionsListResponse getAllCollections( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllCollections"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get collections + * + *

Gets a list of collections. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @return CollectionsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CollectionsListResponse getAllCollections(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getAllCollections(aiResourceGroup, null, null, null); + } + + /** + * Get documents + * + *

Gets a list of documents of a collection. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param collectionId (required) The value for the parameter collectionId + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return Documents + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Documents getAllDocuments( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllDocuments"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling getAllDocuments"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get documents + * + *

Gets a list of documents of a collection. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @return Documents + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Documents getAllDocuments( + @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) + throws OpenApiRequestException { + return getAllDocuments(aiResourceGroup, collectionId, null, null, null); + } + + /** + * Get collection by ID + * + *

Gets a specific collection by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @return Collection + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Collection getCollectionById( + @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getCollectionById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling getCollectionById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get collection status by ID + * + *

Gets a specific collection status from monitor by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param id The value for the parameter id + * @return VectorV1VectorEndpointsGetCollectionCreationStatus200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionCreationStatus( + @Nonnull final String aiResourceGroup, @Nonnull final UUID id) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getCollectionCreationStatus"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'id' when calling getCollectionCreationStatus"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("id", id); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{id}/creationStatus") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference + localVarReturnType = + new ParameterizedTypeReference< + VectorV1VectorEndpointsGetCollectionCreationStatus200Response>() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get collection status by ID + * + *

Gets a specific collection status from monitor by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param id The value for the parameter id + * @return VectorV1VectorEndpointsGetCollectionDeletionStatus200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response getCollectionDeletionStatus( + @Nonnull final String aiResourceGroup, @Nonnull final UUID id) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getCollectionDeletionStatus"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'id' when calling getCollectionDeletionStatus"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("id", id); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{id}/deletionStatus") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference + localVarReturnType = + new ParameterizedTypeReference< + VectorV1VectorEndpointsGetCollectionDeletionStatus200Response>() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get document by ID + * + *

Gets a specific document in a collection by ID. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentId The value for the parameter documentId + * @return DocumentResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentResponse getDocumentById( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final UUID documentId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDocumentById"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling getDocumentById"); + } + + // verify the required parameter 'documentId' is set + if (documentId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentId' when calling getDocumentById"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + localVarPathParams.put("documentId", documentId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents/{documentId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Search chunk by vector + * + *

Search chunk by vector + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param textSearchRequest The value for the parameter textSearchRequest + * @return SearchResults + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public SearchResults search( + @Nonnull final String aiResourceGroup, @Nonnull final TextSearchRequest textSearchRequest) + throws OpenApiRequestException { + final Object localVarPostBody = textSearchRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling search"); + } + + // verify the required parameter 'textSearchRequest' is set + if (textSearchRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'textSearchRequest' when calling vectorV1VectorEndpointsSearch"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/search").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Upsert documents in collection + * + *

Upserts the data of multiple documents into a collection. + * + *

200 - Successful Response + * + *

400 - The specification of the resource was incorrect + * + *

404 - The specification of the resource was incorrect + * + *

422 - There are validation issues with the data. + * + * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param collectionId The value for the parameter collectionId + * @param documentUpdateRequest The value for the parameter documentUpdateRequest + * @return DocumentsListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsListResponse updateDocuments( + @Nonnull final String aiResourceGroup, + @Nonnull final UUID collectionId, + @Nonnull final DocumentUpdateRequest documentUpdateRequest) + throws OpenApiRequestException { + final Object localVarPostBody = documentUpdateRequest; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling updateDocuments"); + } + + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'collectionId' when calling updateDocuments"); + } + + // verify the required parameter 'documentUpdateRequest' is set + if (documentUpdateRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentUpdateRequest' when calling vectorV1VectorEndpointsUpdateDocuments"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("collectionId", collectionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.PATCH, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/ApiError.java b/grounding/src/main/resources/openapi/grounding/model/ApiError.java new file mode 100644 index 000000000..92441759f --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/ApiError.java @@ -0,0 +1,356 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DetailsErrorResponse; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ApiError */ +// CHECKSTYLE:OFF +public class ApiError +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonProperty("requestId") + private String requestId; + + @JsonProperty("target") + private String target; + + @JsonProperty("details") + private List details = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ApiError. */ + private ApiError() {} + + /** + * Set the code of this {@link ApiError} instance and return the same instance. + * + * @param code Descriptive error code (not http status code). + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError code(@Nonnull final String code) { + this.code = code; + return this; + } + + /** + * Descriptive error code (not http status code). + * + * @return code The code of this {@link ApiError} instance. + */ + @Nonnull + public String getCode() { + return code; + } + + /** + * Set the code of this {@link ApiError} instance. + * + * @param code Descriptive error code (not http status code). + */ + public void setCode(@Nonnull final String code) { + this.code = code; + } + + /** + * Set the message of this {@link ApiError} instance and return the same instance. + * + * @param message plaintext error description + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * plaintext error description + * + * @return message The message of this {@link ApiError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link ApiError} instance. + * + * @param message plaintext error description + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Set the requestId of this {@link ApiError} instance and return the same instance. + * + * @param requestId id of individual request + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError requestId(@Nullable final String requestId) { + this.requestId = requestId; + return this; + } + + /** + * id of individual request + * + * @return requestId The requestId of this {@link ApiError} instance. + */ + @Nonnull + public String getRequestId() { + return requestId; + } + + /** + * Set the requestId of this {@link ApiError} instance. + * + * @param requestId id of individual request + */ + public void setRequestId(@Nullable final String requestId) { + this.requestId = requestId; + } + + /** + * Set the target of this {@link ApiError} instance and return the same instance. + * + * @param target url that has been called + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError target(@Nullable final String target) { + this.target = target; + return this; + } + + /** + * url that has been called + * + * @return target The target of this {@link ApiError} instance. + */ + @Nonnull + public String getTarget() { + return target; + } + + /** + * Set the target of this {@link ApiError} instance. + * + * @param target url that has been called + */ + public void setTarget(@Nullable final String target) { + this.target = target; + } + + /** + * Set the details of this {@link ApiError} instance and return the same instance. + * + * @param details The details of this {@link ApiError} + * @return The same instance of this {@link ApiError} class + */ + @Nonnull + public ApiError details(@Nullable final List details) { + this.details = details; + return this; + } + + /** + * Add one details instance to this {@link ApiError}. + * + * @param detailsItem The details that should be added + * @return The same instance of type {@link ApiError} + */ + @Nonnull + public ApiError addDetailsItem(@Nonnull final DetailsErrorResponse detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * Get details + * + * @return details The details of this {@link ApiError} instance. + */ + @Nonnull + public List getDetails() { + return details; + } + + /** + * Set the details of this {@link ApiError} instance. + * + * @param details The details of this {@link ApiError} + */ + public void setDetails(@Nullable final List details) { + this.details = details; + } + + /** + * Get the names of the unrecognizable properties of the {@link ApiError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ApiError} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ApiError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ApiError} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ApiError apiError = (ApiError) o; + return Objects.equals(this.cloudSdkCustomFields, apiError.cloudSdkCustomFields) + && Objects.equals(this.code, apiError.code) + && Objects.equals(this.message, apiError.message) + && Objects.equals(this.requestId, apiError.requestId) + && Objects.equals(this.target, apiError.target) + && Objects.equals(this.details, apiError.details); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, requestId, target, details, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ApiError {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ApiError} instance with + * all required arguments. + */ + public static Builder builder() { + return (code) -> (message) -> () -> new ApiError().code(code).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link ApiError} instance. + * + * @param code Descriptive error code (not http status code). + * @return The ApiError builder. + */ + Builder1 code(@Nonnull final String code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link ApiError} instance. + * + * @param message plaintext error description + * @return The ApiError instance. + */ + Builder2 message(@Nonnull final String message); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link ApiError} instance. + * + * @return The ApiError instance. + */ + ApiError build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/BaseDocument.java b/grounding/src/main/resources/openapi/grounding/model/BaseDocument.java new file mode 100644 index 000000000..958a1d531 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/BaseDocument.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextOnlyBaseChunk; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Base class for documents, document requests and responses. */ +// CHECKSTYLE:OFF +public class BaseDocument +// CHECKSTYLE:ON +{ + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for BaseDocument. */ + private BaseDocument() {} + + /** + * Set the chunks of this {@link BaseDocument} instance and return the same instance. + * + * @param chunks The chunks of this {@link BaseDocument} + * @return The same instance of this {@link BaseDocument} class + */ + @Nonnull + public BaseDocument chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link BaseDocument}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link BaseDocument} + */ + @Nonnull + public BaseDocument addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link BaseDocument} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link BaseDocument} instance. + * + * @param chunks The chunks of this {@link BaseDocument} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Set the metadata of this {@link BaseDocument} instance and return the same instance. + * + * @param metadata The metadata of this {@link BaseDocument} + * @return The same instance of this {@link BaseDocument} class + */ + @Nonnull + public BaseDocument metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link BaseDocument}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link BaseDocument} + */ + @Nonnull + public BaseDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link BaseDocument} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link BaseDocument} instance. + * + * @param metadata The metadata of this {@link BaseDocument} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link BaseDocument}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link BaseDocument} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("BaseDocument has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link BaseDocument} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final BaseDocument baseDocument = (BaseDocument) o; + return Objects.equals(this.cloudSdkCustomFields, baseDocument.cloudSdkCustomFields) + && Objects.equals(this.chunks, baseDocument.chunks) + && Objects.equals(this.metadata, baseDocument.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(chunks, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class BaseDocument {\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link BaseDocument} instance + * with all required arguments. + */ + public static Builder builder() { + return (chunks) -> (metadata) -> () -> new BaseDocument().chunks(chunks).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the chunks of this {@link BaseDocument} instance. + * + * @param chunks The chunks of this {@link BaseDocument} + * @return The BaseDocument builder. + */ + Builder1 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link BaseDocument} instance. + * + * @param chunks The chunks of this {@link BaseDocument} + * @return The BaseDocument builder. + */ + default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link BaseDocument} instance. + * + * @param metadata The metadata of this {@link BaseDocument} + * @return The BaseDocument instance. + */ + Builder2 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link BaseDocument} instance. + * + * @param metadata The metadata of this {@link BaseDocument} + * @return The BaseDocument instance. + */ + default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link BaseDocument} instance. + * + * @return The BaseDocument instance. + */ + BaseDocument build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/Chunk.java b/grounding/src/main/resources/openapi/grounding/model/Chunk.java new file mode 100644 index 000000000..e30a235d0 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/Chunk.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Chunk */ +// CHECKSTYLE:OFF +public class Chunk +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("content") + private String content; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Chunk. */ + private Chunk() {} + + /** + * Set the id of this {@link Chunk} instance and return the same instance. + * + * @param id The id of this {@link Chunk} + * @return The same instance of this {@link Chunk} class + */ + @Nonnull + public Chunk id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link Chunk} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link Chunk} instance. + * + * @param id The id of this {@link Chunk} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the content of this {@link Chunk} instance and return the same instance. + * + * @param content The content of this {@link Chunk} + * @return The same instance of this {@link Chunk} class + */ + @Nonnull + public Chunk content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link Chunk} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link Chunk} instance. + * + * @param content The content of this {@link Chunk} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the metadata of this {@link Chunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link Chunk} + * @return The same instance of this {@link Chunk} class + */ + @Nonnull + public Chunk metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link Chunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link Chunk} + */ + @Nonnull + public Chunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link Chunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link Chunk} instance. + * + * @param metadata The metadata of this {@link Chunk} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link Chunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Chunk} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Chunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Chunk} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Chunk chunk = (Chunk) o; + return Objects.equals(this.cloudSdkCustomFields, chunk.cloudSdkCustomFields) + && Objects.equals(this.id, chunk.id) + && Objects.equals(this.content, chunk.content) + && Objects.equals(this.metadata, chunk.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(id, content, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Chunk {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Chunk} instance with + * all required arguments. + */ + public static Builder builder() { + return (id) -> (content) -> () -> new Chunk().id(id).content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link Chunk} instance. + * + * @param id The id of this {@link Chunk} + * @return The Chunk builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the content of this {@link Chunk} instance. + * + * @param content The content of this {@link Chunk} + * @return The Chunk instance. + */ + Builder2 content(@Nonnull final String content); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link Chunk} instance. + * + * @return The Chunk instance. + */ + Chunk build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/Collection.java b/grounding/src/main/resources/openapi/grounding/model/Collection.java new file mode 100644 index 000000000..fdcf79a8f --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/Collection.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.EmbeddingConfig; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A logical grouping of content. */ +// CHECKSTYLE:OFF +public class Collection +// CHECKSTYLE:ON +{ + @JsonProperty("title") + private String title; + + @JsonProperty("embeddingConfig") + private EmbeddingConfig embeddingConfig; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Collection. */ + private Collection() {} + + /** + * Set the title of this {@link Collection} instance and return the same instance. + * + * @param title The title of this {@link Collection} + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection title(@Nullable final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link Collection} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link Collection} instance. + * + * @param title The title of this {@link Collection} + */ + public void setTitle(@Nullable final String title) { + this.title = title; + } + + /** + * Set the embeddingConfig of this {@link Collection} instance and return the same instance. + * + * @param embeddingConfig The embeddingConfig of this {@link Collection} + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + return this; + } + + /** + * Get embeddingConfig + * + * @return embeddingConfig The embeddingConfig of this {@link Collection} instance. + */ + @Nonnull + public EmbeddingConfig getEmbeddingConfig() { + return embeddingConfig; + } + + /** + * Set the embeddingConfig of this {@link Collection} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link Collection} + */ + public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + } + + /** + * Set the metadata of this {@link Collection} instance and return the same instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link Collection}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link Collection} + */ + @Nonnull + public Collection addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to collection. Useful to restrict search to a subset of collections. + * + * @return metadata The metadata of this {@link Collection} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link Collection} instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link Collection} instance and return the same instance. + * + * @param id Unique identifier of a collection. + * @return The same instance of this {@link Collection} class + */ + @Nonnull + public Collection id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a collection. + * + * @return id The id of this {@link Collection} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link Collection} instance. + * + * @param id Unique identifier of a collection. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link Collection}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Collection} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Collection has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Collection} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Collection collection = (Collection) o; + return Objects.equals(this.cloudSdkCustomFields, collection.cloudSdkCustomFields) + && Objects.equals(this.title, collection.title) + && Objects.equals(this.embeddingConfig, collection.embeddingConfig) + && Objects.equals(this.metadata, collection.metadata) + && Objects.equals(this.id, collection.id); + } + + @Override + public int hashCode() { + return Objects.hash(title, embeddingConfig, metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Collection {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Collection} instance + * with all required arguments. + */ + public static Builder builder() { + return (embeddingConfig) -> + (id) -> () -> new Collection().embeddingConfig(embeddingConfig).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the embeddingConfig of this {@link Collection} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link Collection} + * @return The Collection builder. + */ + Builder1 embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link Collection} instance. + * + * @param id Unique identifier of a collection. + * @return The Collection instance. + */ + Builder2 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link Collection} instance. + * + * @return The Collection instance. + */ + Collection build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java new file mode 100644 index 000000000..7ca418652 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CollectionCreatedResponse */ +// CHECKSTYLE:OFF +public class CollectionCreatedResponse +// CHECKSTYLE:ON +{ + @JsonProperty("collectionURL") + private String collectionURL; + + @JsonProperty("status") + private String status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionCreatedResponse. */ + private CollectionCreatedResponse() {} + + /** + * Set the collectionURL of this {@link CollectionCreatedResponse} instance and return the same + * instance. + * + * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} + * @return The same instance of this {@link CollectionCreatedResponse} class + */ + @Nonnull + public CollectionCreatedResponse collectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + return this; + } + + /** + * Get collectionURL + * + * @return collectionURL The collectionURL of this {@link CollectionCreatedResponse} instance. + */ + @Nonnull + public String getCollectionURL() { + return collectionURL; + } + + /** + * Set the collectionURL of this {@link CollectionCreatedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} + */ + public void setCollectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + } + + /** + * Set the status of this {@link CollectionCreatedResponse} instance and return the same instance. + * + * @param status The status of this {@link CollectionCreatedResponse} + * @return The same instance of this {@link CollectionCreatedResponse} class + */ + @Nonnull + public CollectionCreatedResponse status(@Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link CollectionCreatedResponse} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link CollectionCreatedResponse} instance. + * + * @param status The status of this {@link CollectionCreatedResponse} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionCreatedResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionCreatedResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionCreatedResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionCreatedResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionCreatedResponse collectionCreatedResponse = (CollectionCreatedResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionCreatedResponse.cloudSdkCustomFields) + && Objects.equals(this.collectionURL, collectionCreatedResponse.collectionURL) + && Objects.equals(this.status, collectionCreatedResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(collectionURL, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionCreatedResponse {\n"); + sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionCreatedResponse} instance with all required arguments. + */ + public static Builder builder() { + return (collectionURL) -> + (status) -> + () -> new CollectionCreatedResponse().collectionURL(collectionURL).status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the collectionURL of this {@link CollectionCreatedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} + * @return The CollectionCreatedResponse builder. + */ + Builder1 collectionURL(@Nonnull final String collectionURL); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link CollectionCreatedResponse} instance. + * + * @param status The status of this {@link CollectionCreatedResponse} + * @return The CollectionCreatedResponse instance. + */ + Builder2 status(@Nonnull final String status); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link CollectionCreatedResponse} instance. + * + * @return The CollectionCreatedResponse instance. + */ + CollectionCreatedResponse build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java new file mode 100644 index 000000000..729e940b5 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CollectionDeletedResponse */ +// CHECKSTYLE:OFF +public class CollectionDeletedResponse +// CHECKSTYLE:ON +{ + @JsonProperty("collectionURL") + private String collectionURL; + + @JsonProperty("status") + private String status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionDeletedResponse. */ + private CollectionDeletedResponse() {} + + /** + * Set the collectionURL of this {@link CollectionDeletedResponse} instance and return the same + * instance. + * + * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} + * @return The same instance of this {@link CollectionDeletedResponse} class + */ + @Nonnull + public CollectionDeletedResponse collectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + return this; + } + + /** + * Get collectionURL + * + * @return collectionURL The collectionURL of this {@link CollectionDeletedResponse} instance. + */ + @Nonnull + public String getCollectionURL() { + return collectionURL; + } + + /** + * Set the collectionURL of this {@link CollectionDeletedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} + */ + public void setCollectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + } + + /** + * Set the status of this {@link CollectionDeletedResponse} instance and return the same instance. + * + * @param status The status of this {@link CollectionDeletedResponse} + * @return The same instance of this {@link CollectionDeletedResponse} class + */ + @Nonnull + public CollectionDeletedResponse status(@Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link CollectionDeletedResponse} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link CollectionDeletedResponse} instance. + * + * @param status The status of this {@link CollectionDeletedResponse} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionDeletedResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionDeletedResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionDeletedResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionDeletedResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionDeletedResponse collectionDeletedResponse = (CollectionDeletedResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionDeletedResponse.cloudSdkCustomFields) + && Objects.equals(this.collectionURL, collectionDeletedResponse.collectionURL) + && Objects.equals(this.status, collectionDeletedResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(collectionURL, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionDeletedResponse {\n"); + sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionDeletedResponse} instance with all required arguments. + */ + public static Builder builder() { + return (collectionURL) -> + (status) -> + () -> new CollectionDeletedResponse().collectionURL(collectionURL).status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the collectionURL of this {@link CollectionDeletedResponse} instance. + * + * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} + * @return The CollectionDeletedResponse builder. + */ + Builder1 collectionURL(@Nonnull final String collectionURL); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link CollectionDeletedResponse} instance. + * + * @param status The status of this {@link CollectionDeletedResponse} + * @return The CollectionDeletedResponse instance. + */ + Builder2 status(@Nonnull final String status); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link CollectionDeletedResponse} instance. + * + * @return The CollectionDeletedResponse instance. + */ + CollectionDeletedResponse build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java new file mode 100644 index 000000000..2bb4ecca9 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CollectionPendingResponse */ +// CHECKSTYLE:OFF +public class CollectionPendingResponse +// CHECKSTYLE:ON +{ + @JsonProperty("Location") + private URI location; + + @JsonProperty("status") + private String status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionPendingResponse. */ + private CollectionPendingResponse() {} + + /** + * Set the location of this {@link CollectionPendingResponse} instance and return the same + * instance. + * + * @param location The location of this {@link CollectionPendingResponse} + * @return The same instance of this {@link CollectionPendingResponse} class + */ + @Nonnull + public CollectionPendingResponse location(@Nonnull final URI location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location The location of this {@link CollectionPendingResponse} instance. + */ + @Nonnull + public URI getLocation() { + return location; + } + + /** + * Set the location of this {@link CollectionPendingResponse} instance. + * + * @param location The location of this {@link CollectionPendingResponse} + */ + public void setLocation(@Nonnull final URI location) { + this.location = location; + } + + /** + * Set the status of this {@link CollectionPendingResponse} instance and return the same instance. + * + * @param status The status of this {@link CollectionPendingResponse} + * @return The same instance of this {@link CollectionPendingResponse} class + */ + @Nonnull + public CollectionPendingResponse status(@Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link CollectionPendingResponse} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link CollectionPendingResponse} instance. + * + * @param status The status of this {@link CollectionPendingResponse} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionPendingResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionPendingResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionPendingResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionPendingResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionPendingResponse collectionPendingResponse = (CollectionPendingResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionPendingResponse.cloudSdkCustomFields) + && Objects.equals(this.location, collectionPendingResponse.location) + && Objects.equals(this.status, collectionPendingResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(location, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionPendingResponse {\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionPendingResponse} instance with all required arguments. + */ + public static Builder builder() { + return (location) -> + (status) -> () -> new CollectionPendingResponse().location(location).status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the location of this {@link CollectionPendingResponse} instance. + * + * @param location The location of this {@link CollectionPendingResponse} + * @return The CollectionPendingResponse builder. + */ + Builder1 location(@Nonnull final URI location); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link CollectionPendingResponse} instance. + * + * @param status The status of this {@link CollectionPendingResponse} + * @return The CollectionPendingResponse instance. + */ + Builder2 status(@Nonnull final String status); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link CollectionPendingResponse} instance. + * + * @return The CollectionPendingResponse instance. + */ + CollectionPendingResponse build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java b/grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java new file mode 100644 index 000000000..de375980a --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.EmbeddingConfig; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A request for creating a new, single collection. */ +// CHECKSTYLE:OFF +public class CollectionRequest +// CHECKSTYLE:ON +{ + @JsonProperty("title") + private String title; + + @JsonProperty("embeddingConfig") + private EmbeddingConfig embeddingConfig; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionRequest. */ + private CollectionRequest() {} + + /** + * Set the title of this {@link CollectionRequest} instance and return the same instance. + * + * @param title The title of this {@link CollectionRequest} + * @return The same instance of this {@link CollectionRequest} class + */ + @Nonnull + public CollectionRequest title(@Nullable final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link CollectionRequest} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link CollectionRequest} instance. + * + * @param title The title of this {@link CollectionRequest} + */ + public void setTitle(@Nullable final String title) { + this.title = title; + } + + /** + * Set the embeddingConfig of this {@link CollectionRequest} instance and return the same + * instance. + * + * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} + * @return The same instance of this {@link CollectionRequest} class + */ + @Nonnull + public CollectionRequest embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + return this; + } + + /** + * Get embeddingConfig + * + * @return embeddingConfig The embeddingConfig of this {@link CollectionRequest} instance. + */ + @Nonnull + public EmbeddingConfig getEmbeddingConfig() { + return embeddingConfig; + } + + /** + * Set the embeddingConfig of this {@link CollectionRequest} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} + */ + public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { + this.embeddingConfig = embeddingConfig; + } + + /** + * Set the metadata of this {@link CollectionRequest} instance and return the same instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + * @return The same instance of this {@link CollectionRequest} class + */ + @Nonnull + public CollectionRequest metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link CollectionRequest}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link CollectionRequest} + */ + @Nonnull + public CollectionRequest addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to collection. Useful to restrict search to a subset of collections. + * + * @return metadata The metadata of this {@link CollectionRequest} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link CollectionRequest} instance. + * + * @param metadata Metadata attached to collection. Useful to restrict search to a subset of + * collections. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("CollectionRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionRequest collectionRequest = (CollectionRequest) o; + return Objects.equals(this.cloudSdkCustomFields, collectionRequest.cloudSdkCustomFields) + && Objects.equals(this.title, collectionRequest.title) + && Objects.equals(this.embeddingConfig, collectionRequest.embeddingConfig) + && Objects.equals(this.metadata, collectionRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(title, embeddingConfig, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionRequest {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link CollectionRequest} + * instance with all required arguments. + */ + public static Builder builder() { + return (embeddingConfig) -> () -> new CollectionRequest().embeddingConfig(embeddingConfig); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the embeddingConfig of this {@link CollectionRequest} instance. + * + * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} + * @return The CollectionRequest instance. + */ + Builder1 embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link CollectionRequest} instance. + * + * @return The CollectionRequest instance. + */ + CollectionRequest build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java new file mode 100644 index 000000000..a6bf853bc --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Collection; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing collections retrieved from the server. */ +// CHECKSTYLE:OFF +public class CollectionsListResponse +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CollectionsListResponse. */ + private CollectionsListResponse() {} + + /** + * Set the resources of this {@link CollectionsListResponse} instance and return the same + * instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + * @return The same instance of this {@link CollectionsListResponse} class + */ + @Nonnull + public CollectionsListResponse resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link CollectionsListResponse}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link CollectionsListResponse} + */ + @Nonnull + public CollectionsListResponse addResourcesItem(@Nonnull final Collection resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link CollectionsListResponse} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link CollectionsListResponse} instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link CollectionsListResponse} instance and return the same instance. + * + * @param count The count of this {@link CollectionsListResponse} + * @return The same instance of this {@link CollectionsListResponse} class + */ + @Nonnull + public CollectionsListResponse count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link CollectionsListResponse} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link CollectionsListResponse} instance. + * + * @param count The count of this {@link CollectionsListResponse} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link CollectionsListResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CollectionsListResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CollectionsListResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CollectionsListResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CollectionsListResponse collectionsListResponse = (CollectionsListResponse) o; + return Objects.equals(this.cloudSdkCustomFields, collectionsListResponse.cloudSdkCustomFields) + && Objects.equals(this.resources, collectionsListResponse.resources) + && Objects.equals(this.count, collectionsListResponse.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CollectionsListResponse {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CollectionsListResponse} instance with all required arguments. + */ + public static Builder builder() { + return (resources) -> () -> new CollectionsListResponse().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link CollectionsListResponse} instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + * @return The CollectionsListResponse instance. + */ + Builder1 resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link CollectionsListResponse} instance. + * + * @param resources The resources of this {@link CollectionsListResponse} + * @return The CollectionsListResponse instance. + */ + default Builder1 resources(@Nonnull final Collection... resources) { + return resources(Arrays.asList(resources)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link CollectionsListResponse} instance. + * + * @return The CollectionsListResponse instance. + */ + CollectionsListResponse build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepositories.java b/grounding/src/main/resources/openapi/grounding/model/DataRepositories.java new file mode 100644 index 000000000..d96a81bba --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DataRepositories.java @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepository; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DataRepositories */ +// CHECKSTYLE:OFF +public class DataRepositories +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DataRepositories. */ + private DataRepositories() {} + + /** + * Set the resources of this {@link DataRepositories} instance and return the same instance. + * + * @param resources The resources of this {@link DataRepositories} + * @return The same instance of this {@link DataRepositories} class + */ + @Nonnull + public DataRepositories resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link DataRepositories}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link DataRepositories} + */ + @Nonnull + public DataRepositories addResourcesItem(@Nonnull final DataRepository resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link DataRepositories} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link DataRepositories} instance. + * + * @param resources The resources of this {@link DataRepositories} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link DataRepositories} instance and return the same instance. + * + * @param count The count of this {@link DataRepositories} + * @return The same instance of this {@link DataRepositories} class + */ + @Nonnull + public DataRepositories count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link DataRepositories} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link DataRepositories} instance. + * + * @param count The count of this {@link DataRepositories} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link DataRepositories}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DataRepositories} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DataRepositories has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DataRepositories} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DataRepositories dataRepositories = (DataRepositories) o; + return Objects.equals(this.cloudSdkCustomFields, dataRepositories.cloudSdkCustomFields) + && Objects.equals(this.resources, dataRepositories.resources) + && Objects.equals(this.count, dataRepositories.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DataRepositories {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DataRepositories} + * instance with all required arguments. + */ + public static Builder builder() { + return (resources) -> () -> new DataRepositories().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link DataRepositories} instance. + * + * @param resources The resources of this {@link DataRepositories} + * @return The DataRepositories instance. + */ + Builder1 resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link DataRepositories} instance. + * + * @param resources The resources of this {@link DataRepositories} + * @return The DataRepositories instance. + */ + default Builder1 resources(@Nonnull final DataRepository... resources) { + return resources(Arrays.asList(resources)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link DataRepositories} instance. + * + * @return The DataRepositories instance. + */ + DataRepositories build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepository.java b/grounding/src/main/resources/openapi/grounding/model/DataRepository.java new file mode 100644 index 000000000..f787127b4 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DataRepository.java @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositoryType; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DataRepository schema expected by Retrieval. */ +// CHECKSTYLE:OFF +public class DataRepository +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("type") + private DataRepositoryType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DataRepository. */ + private DataRepository() {} + + /** + * Set the id of this {@link DataRepository} instance and return the same instance. + * + * @param id Unique identifier of this DataRepository. + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of this DataRepository. + * + * @return id The id of this {@link DataRepository} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DataRepository} instance. + * + * @param id Unique identifier of this DataRepository. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the title of this {@link DataRepository} instance and return the same instance. + * + * @param title The title of this {@link DataRepository} + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository title(@Nonnull final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DataRepository} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DataRepository} instance. + * + * @param title The title of this {@link DataRepository} + */ + public void setTitle(@Nonnull final String title) { + this.title = title; + } + + /** + * Set the metadata of this {@link DataRepository} instance and return the same instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DataRepository}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DataRepository} + */ + @Nonnull + public DataRepository addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to DataRepository. Useful to later limit search to a subset of + * DataRepositories. + * + * @return metadata The metadata of this {@link DataRepository} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DataRepository} instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the type of this {@link DataRepository} instance and return the same instance. + * + * @param type The type of this {@link DataRepository} + * @return The same instance of this {@link DataRepository} class + */ + @Nonnull + public DataRepository type(@Nullable final DataRepositoryType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link DataRepository} instance. + */ + @Nullable + public DataRepositoryType getType() { + return type; + } + + /** + * Set the type of this {@link DataRepository} instance. + * + * @param type The type of this {@link DataRepository} + */ + public void setType(@Nullable final DataRepositoryType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link DataRepository}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DataRepository} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DataRepository has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DataRepository} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DataRepository dataRepository = (DataRepository) o; + return Objects.equals(this.cloudSdkCustomFields, dataRepository.cloudSdkCustomFields) + && Objects.equals(this.id, dataRepository.id) + && Objects.equals(this.title, dataRepository.title) + && Objects.equals(this.metadata, dataRepository.metadata) + && Objects.equals(this.type, dataRepository.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, metadata, type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DataRepository {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DataRepository} + * instance with all required arguments. + */ + public static Builder builder() { + return (id) -> (title) -> (type) -> () -> new DataRepository().id(id).title(title).type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DataRepository} instance. + * + * @param id Unique identifier of this DataRepository. + * @return The DataRepository builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the title of this {@link DataRepository} instance. + * + * @param title The title of this {@link DataRepository} + * @return The DataRepository builder. + */ + Builder2 title(@Nonnull final String title); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the type of this {@link DataRepository} instance. + * + * @param type The type of this {@link DataRepository} + * @return The DataRepository instance. + */ + Builder3 type(@Nullable final DataRepositoryType type); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link DataRepository} instance. + * + * @return The DataRepository instance. + */ + DataRepository build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java b/grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java new file mode 100644 index 000000000..3e812b202 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets DataRepositoryType */ +public enum DataRepositoryType { + VECTOR("vector"); + + private final String value; + + DataRepositoryType(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static DataRepositoryType fromValue(@Nonnull final String value) { + for (final DataRepositoryType b : DataRepositoryType.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java b/grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java new file mode 100644 index 000000000..8214f2afd --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java @@ -0,0 +1,372 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetrievalDocument; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DataRepository schema returned by the Vector search endpoint */ +// CHECKSTYLE:OFF +public class DataRepositoryWithDocuments +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DataRepositoryWithDocuments. */ + private DataRepositoryWithDocuments() {} + + /** + * Set the id of this {@link DataRepositoryWithDocuments} instance and return the same instance. + * + * @param id Unique identifier of this DataRepository. + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of this DataRepository. + * + * @return id The id of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DataRepositoryWithDocuments} instance. + * + * @param id Unique identifier of this DataRepository. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the title of this {@link DataRepositoryWithDocuments} instance and return the same + * instance. + * + * @param title The title of this {@link DataRepositoryWithDocuments} + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments title(@Nonnull final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DataRepositoryWithDocuments} instance. + * + * @param title The title of this {@link DataRepositoryWithDocuments} + */ + public void setTitle(@Nonnull final String title) { + this.title = title; + } + + /** + * Set the metadata of this {@link DataRepositoryWithDocuments} instance and return the same + * instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DataRepositoryWithDocuments}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DataRepositoryWithDocuments} + */ + @Nonnull + public DataRepositoryWithDocuments addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Metadata attached to DataRepository. Useful to later limit search to a subset of + * DataRepositories. + * + * @return metadata The metadata of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DataRepositoryWithDocuments} instance. + * + * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset + * of DataRepositories. + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance and return the same + * instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + * @return The same instance of this {@link DataRepositoryWithDocuments} class + */ + @Nonnull + public DataRepositoryWithDocuments documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DataRepositoryWithDocuments}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DataRepositoryWithDocuments} + */ + @Nonnull + public DataRepositoryWithDocuments addDocumentsItem( + @Nonnull final RetrievalDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DataRepositoryWithDocuments} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DataRepositoryWithDocuments}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DataRepositoryWithDocuments} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DataRepositoryWithDocuments has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DataRepositoryWithDocuments} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DataRepositoryWithDocuments dataRepositoryWithDocuments = (DataRepositoryWithDocuments) o; + return Objects.equals( + this.cloudSdkCustomFields, dataRepositoryWithDocuments.cloudSdkCustomFields) + && Objects.equals(this.id, dataRepositoryWithDocuments.id) + && Objects.equals(this.title, dataRepositoryWithDocuments.title) + && Objects.equals(this.metadata, dataRepositoryWithDocuments.metadata) + && Objects.equals(this.documents, dataRepositoryWithDocuments.documents); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, metadata, documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DataRepositoryWithDocuments {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * DataRepositoryWithDocuments} instance with all required arguments. + */ + public static Builder builder() { + return (id) -> + (title) -> + (documents) -> + () -> new DataRepositoryWithDocuments().id(id).title(title).documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DataRepositoryWithDocuments} instance. + * + * @param id Unique identifier of this DataRepository. + * @return The DataRepositoryWithDocuments builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the title of this {@link DataRepositoryWithDocuments} instance. + * + * @param title The title of this {@link DataRepositoryWithDocuments} + * @return The DataRepositoryWithDocuments builder. + */ + Builder2 title(@Nonnull final String title); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + * @return The DataRepositoryWithDocuments instance. + */ + Builder3 documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DataRepositoryWithDocuments} instance. + * + * @param documents The documents of this {@link DataRepositoryWithDocuments} + * @return The DataRepositoryWithDocuments instance. + */ + default Builder3 documents(@Nonnull final RetrievalDocument... documents) { + return documents(Arrays.asList(documents)); + } + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link DataRepositoryWithDocuments} instance. + * + * @return The DataRepositoryWithDocuments instance. + */ + DataRepositoryWithDocuments build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java b/grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java new file mode 100644 index 000000000..a7326db5e --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DetailsErrorResponse */ +// CHECKSTYLE:OFF +public class DetailsErrorResponse +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DetailsErrorResponse. */ + private DetailsErrorResponse() {} + + /** + * Set the code of this {@link DetailsErrorResponse} instance and return the same instance. + * + * @param code Descriptive error code (not http status code) + * @return The same instance of this {@link DetailsErrorResponse} class + */ + @Nonnull + public DetailsErrorResponse code(@Nullable final String code) { + this.code = code; + return this; + } + + /** + * Descriptive error code (not http status code) + * + * @return code The code of this {@link DetailsErrorResponse} instance. + */ + @Nonnull + public String getCode() { + return code; + } + + /** + * Set the code of this {@link DetailsErrorResponse} instance. + * + * @param code Descriptive error code (not http status code) + */ + public void setCode(@Nullable final String code) { + this.code = code; + } + + /** + * Set the message of this {@link DetailsErrorResponse} instance and return the same instance. + * + * @param message Plaintext error description + * @return The same instance of this {@link DetailsErrorResponse} class + */ + @Nonnull + public DetailsErrorResponse message(@Nullable final String message) { + this.message = message; + return this; + } + + /** + * Plaintext error description + * + * @return message The message of this {@link DetailsErrorResponse} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link DetailsErrorResponse} instance. + * + * @param message Plaintext error description + */ + public void setMessage(@Nullable final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link DetailsErrorResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DetailsErrorResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DetailsErrorResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DetailsErrorResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DetailsErrorResponse detailsErrorResponse = (DetailsErrorResponse) o; + return Objects.equals(this.cloudSdkCustomFields, detailsErrorResponse.cloudSdkCustomFields) + && Objects.equals(this.code, detailsErrorResponse.code) + && Objects.equals(this.message, detailsErrorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DetailsErrorResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link DetailsErrorResponse} instance. No arguments are required. */ + public static DetailsErrorResponse builder() { + return new DetailsErrorResponse(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java b/grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java new file mode 100644 index 000000000..84a9972be --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.BaseDocument; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A create request containing one or more new documents to create and store in a collection. */ +// CHECKSTYLE:OFF +public class DocumentCreateRequest +// CHECKSTYLE:ON +{ + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentCreateRequest. */ + private DocumentCreateRequest() {} + + /** + * Set the documents of this {@link DocumentCreateRequest} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + * @return The same instance of this {@link DocumentCreateRequest} class + */ + @Nonnull + public DocumentCreateRequest documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentCreateRequest}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentCreateRequest} + */ + @Nonnull + public DocumentCreateRequest addDocumentsItem(@Nonnull final BaseDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentCreateRequest} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentCreateRequest} instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentCreateRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentCreateRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentCreateRequest documentCreateRequest = (DocumentCreateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, documentCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.documents, documentCreateRequest.documents); + } + + @Override + public int hashCode() { + return Objects.hash(documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentCreateRequest {\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentCreateRequest} + * instance with all required arguments. + */ + public static Builder builder() { + return (documents) -> () -> new DocumentCreateRequest().documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the documents of this {@link DocumentCreateRequest} instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + * @return The DocumentCreateRequest instance. + */ + Builder1 documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentCreateRequest} instance. + * + * @param documents The documents of this {@link DocumentCreateRequest} + * @return The DocumentCreateRequest instance. + */ + default Builder1 documents(@Nonnull final BaseDocument... documents) { + return documents(Arrays.asList(documents)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link DocumentCreateRequest} instance. + * + * @return The DocumentCreateRequest instance. + */ + DocumentCreateRequest build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentInput.java b/grounding/src/main/resources/openapi/grounding/model/DocumentInput.java new file mode 100644 index 000000000..31fbbf13c --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentInput.java @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextOnlyBaseChunk; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A single document stored in a collection by ID. */ +// CHECKSTYLE:OFF +public class DocumentInput +// CHECKSTYLE:ON +{ + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentInput. */ + private DocumentInput() {} + + /** + * Set the chunks of this {@link DocumentInput} instance and return the same instance. + * + * @param chunks The chunks of this {@link DocumentInput} + * @return The same instance of this {@link DocumentInput} class + */ + @Nonnull + public DocumentInput chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link DocumentInput}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link DocumentInput} + */ + @Nonnull + public DocumentInput addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link DocumentInput} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link DocumentInput} instance. + * + * @param chunks The chunks of this {@link DocumentInput} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Set the metadata of this {@link DocumentInput} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentInput} + * @return The same instance of this {@link DocumentInput} class + */ + @Nonnull + public DocumentInput metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentInput}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentInput} + */ + @Nonnull + public DocumentInput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentInput} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentInput} instance. + * + * @param metadata The metadata of this {@link DocumentInput} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link DocumentInput} instance and return the same instance. + * + * @param id Unique identifier of a document. + * @return The same instance of this {@link DocumentInput} class + */ + @Nonnull + public DocumentInput id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a document. + * + * @return id The id of this {@link DocumentInput} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentInput} instance. + * + * @param id Unique identifier of a document. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentInput} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentInput} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentInput documentInput = (DocumentInput) o; + return Objects.equals(this.cloudSdkCustomFields, documentInput.cloudSdkCustomFields) + && Objects.equals(this.chunks, documentInput.chunks) + && Objects.equals(this.metadata, documentInput.metadata) + && Objects.equals(this.id, documentInput.id); + } + + @Override + public int hashCode() { + return Objects.hash(chunks, metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentInput {\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentInput} instance + * with all required arguments. + */ + public static Builder builder() { + return (chunks) -> + (metadata) -> (id) -> () -> new DocumentInput().chunks(chunks).metadata(metadata).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the chunks of this {@link DocumentInput} instance. + * + * @param chunks The chunks of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + Builder1 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link DocumentInput} instance. + * + * @param chunks The chunks of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link DocumentInput} instance. + * + * @param metadata The metadata of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + Builder2 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link DocumentInput} instance. + * + * @param metadata The metadata of this {@link DocumentInput} + * @return The DocumentInput builder. + */ + default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the id of this {@link DocumentInput} instance. + * + * @param id Unique identifier of a document. + * @return The DocumentInput instance. + */ + Builder3 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link DocumentInput} instance. + * + * @return The DocumentInput instance. + */ + DocumentInput build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java new file mode 100644 index 000000000..6d3cdf45e --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentKeyValueListPair */ +// CHECKSTYLE:OFF +public class DocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + /** Gets or Sets matchMode */ + public enum MatchModeEnum { + /** The ANY option of this DocumentKeyValueListPair */ + ANY("ANY"), + + /** The ALL option of this DocumentKeyValueListPair */ + ALL("ALL"); + + private String value; + + MatchModeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type DocumentKeyValueListPair + */ + @JsonCreator + @Nonnull + public static MatchModeEnum fromValue(@Nonnull final String value) { + for (MatchModeEnum b : MatchModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("matchMode") + private MatchModeEnum matchMode; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentKeyValueListPair. */ + private DocumentKeyValueListPair() {} + + /** + * Set the key of this {@link DocumentKeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link DocumentKeyValueListPair} + * @return The same instance of this {@link DocumentKeyValueListPair} class + */ + @Nonnull + public DocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link DocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link DocumentKeyValueListPair} instance. + * + * @param key The key of this {@link DocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link DocumentKeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + * @return The same instance of this {@link DocumentKeyValueListPair} class + */ + @Nonnull + public DocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link DocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link DocumentKeyValueListPair} + */ + @Nonnull + public DocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link DocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link DocumentKeyValueListPair} instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the matchMode of this {@link DocumentKeyValueListPair} instance and return the same + * instance. + * + * @param matchMode The matchMode of this {@link DocumentKeyValueListPair} + * @return The same instance of this {@link DocumentKeyValueListPair} class + */ + @Nonnull + public DocumentKeyValueListPair matchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + return this; + } + + /** + * Get matchMode + * + * @return matchMode The matchMode of this {@link DocumentKeyValueListPair} instance. + */ + @Nullable + public MatchModeEnum getMatchMode() { + return matchMode; + } + + /** + * Set the matchMode of this {@link DocumentKeyValueListPair} instance. + * + * @param matchMode The matchMode of this {@link DocumentKeyValueListPair} + */ + public void setMatchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentKeyValueListPair} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentKeyValueListPair} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentKeyValueListPair documentKeyValueListPair = (DocumentKeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, documentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, documentKeyValueListPair.key) + && Objects.equals(this.value, documentKeyValueListPair.value) + && Objects.equals(this.matchMode, documentKeyValueListPair.matchMode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, matchMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" matchMode: ").append(toIndentedString(matchMode)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * DocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder builder() { + return (key) -> (value) -> () -> new DocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link DocumentKeyValueListPair} instance. + * + * @param key The key of this {@link DocumentKeyValueListPair} + * @return The DocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link DocumentKeyValueListPair} instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + * @return The DocumentKeyValueListPair instance. + */ + Builder2 value(@Nonnull final List value); + + /** + * Set the value of this {@link DocumentKeyValueListPair} instance. + * + * @param value The value of this {@link DocumentKeyValueListPair} + * @return The DocumentKeyValueListPair instance. + */ + default Builder2 value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link DocumentKeyValueListPair} instance. + * + * @return The DocumentKeyValueListPair instance. + */ + DocumentKeyValueListPair build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java b/grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java new file mode 100644 index 000000000..93bf8c4a6 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Chunk; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentOutput */ +// CHECKSTYLE:OFF +public class DocumentOutput +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentOutput. */ + private DocumentOutput() {} + + /** + * Set the id of this {@link DocumentOutput} instance and return the same instance. + * + * @param id The id of this {@link DocumentOutput} + * @return The same instance of this {@link DocumentOutput} class + */ + @Nonnull + public DocumentOutput id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link DocumentOutput} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentOutput} instance. + * + * @param id The id of this {@link DocumentOutput} + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the metadata of this {@link DocumentOutput} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentOutput} + * @return The same instance of this {@link DocumentOutput} class + */ + @Nonnull + public DocumentOutput metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentOutput}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentOutput} + */ + @Nonnull + public DocumentOutput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentOutput} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentOutput} instance. + * + * @param metadata The metadata of this {@link DocumentOutput} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the chunks of this {@link DocumentOutput} instance and return the same instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + * @return The same instance of this {@link DocumentOutput} class + */ + @Nonnull + public DocumentOutput chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link DocumentOutput}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link DocumentOutput} + */ + @Nonnull + public DocumentOutput addChunksItem(@Nonnull final Chunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link DocumentOutput} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link DocumentOutput} instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentOutput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentOutput} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentOutput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentOutput} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentOutput documentOutput = (DocumentOutput) o; + return Objects.equals(this.cloudSdkCustomFields, documentOutput.cloudSdkCustomFields) + && Objects.equals(this.id, documentOutput.id) + && Objects.equals(this.metadata, documentOutput.metadata) + && Objects.equals(this.chunks, documentOutput.chunks); + } + + @Override + public int hashCode() { + return Objects.hash(id, metadata, chunks, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentOutput {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentOutput} + * instance with all required arguments. + */ + public static Builder builder() { + return (id) -> (chunks) -> () -> new DocumentOutput().id(id).chunks(chunks); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DocumentOutput} instance. + * + * @param id The id of this {@link DocumentOutput} + * @return The DocumentOutput builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the chunks of this {@link DocumentOutput} instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + * @return The DocumentOutput instance. + */ + Builder2 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link DocumentOutput} instance. + * + * @param chunks The chunks of this {@link DocumentOutput} + * @return The DocumentOutput instance. + */ + default Builder2 chunks(@Nonnull final Chunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link DocumentOutput} instance. + * + * @return The DocumentOutput instance. + */ + DocumentOutput build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java b/grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java new file mode 100644 index 000000000..ebdb571e2 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextOnlyBaseChunk; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing information about a newly created, single document. */ +// CHECKSTYLE:OFF +public class DocumentResponse +// CHECKSTYLE:ON +{ + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentResponse. */ + private DocumentResponse() {} + + /** + * Set the chunks of this {@link DocumentResponse} instance and return the same instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + * @return The same instance of this {@link DocumentResponse} class + */ + @Nonnull + public DocumentResponse chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link DocumentResponse}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link DocumentResponse} + */ + @Nonnull + public DocumentResponse addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link DocumentResponse} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link DocumentResponse} instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Set the metadata of this {@link DocumentResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + * @return The same instance of this {@link DocumentResponse} class + */ + @Nonnull + public DocumentResponse metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentResponse}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentResponse} + */ + @Nonnull + public DocumentResponse addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentResponse} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentResponse} instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link DocumentResponse} instance and return the same instance. + * + * @param id Unique identifier of a document. + * @return The same instance of this {@link DocumentResponse} class + */ + @Nonnull + public DocumentResponse id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a document. + * + * @return id The id of this {@link DocumentResponse} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentResponse} instance. + * + * @param id Unique identifier of a document. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentResponse} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentResponse documentResponse = (DocumentResponse) o; + return Objects.equals(this.cloudSdkCustomFields, documentResponse.cloudSdkCustomFields) + && Objects.equals(this.chunks, documentResponse.chunks) + && Objects.equals(this.metadata, documentResponse.metadata) + && Objects.equals(this.id, documentResponse.id); + } + + @Override + public int hashCode() { + return Objects.hash(chunks, metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentResponse {\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentResponse} + * instance with all required arguments. + */ + public static Builder builder() { + return (chunks) -> + (metadata) -> (id) -> () -> new DocumentResponse().chunks(chunks).metadata(metadata).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the chunks of this {@link DocumentResponse} instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + Builder1 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link DocumentResponse} instance. + * + * @param chunks The chunks of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link DocumentResponse} instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + Builder2 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link DocumentResponse} instance. + * + * @param metadata The metadata of this {@link DocumentResponse} + * @return The DocumentResponse builder. + */ + default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the id of this {@link DocumentResponse} instance. + * + * @param id Unique identifier of a document. + * @return The DocumentResponse instance. + */ + Builder3 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link DocumentResponse} instance. + * + * @return The DocumentResponse instance. + */ + DocumentResponse build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java new file mode 100644 index 000000000..59e28985e --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentInput; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * An update request containing one or more documents to update existing documents in a collection + * by ID. + */ +// CHECKSTYLE:OFF +public class DocumentUpdateRequest +// CHECKSTYLE:ON +{ + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentUpdateRequest. */ + private DocumentUpdateRequest() {} + + /** + * Set the documents of this {@link DocumentUpdateRequest} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + * @return The same instance of this {@link DocumentUpdateRequest} class + */ + @Nonnull + public DocumentUpdateRequest documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentUpdateRequest}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentUpdateRequest} + */ + @Nonnull + public DocumentUpdateRequest addDocumentsItem(@Nonnull final DocumentInput documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentUpdateRequest} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentUpdateRequest} instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentUpdateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentUpdateRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentUpdateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentUpdateRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentUpdateRequest documentUpdateRequest = (DocumentUpdateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, documentUpdateRequest.cloudSdkCustomFields) + && Objects.equals(this.documents, documentUpdateRequest.documents); + } + + @Override + public int hashCode() { + return Objects.hash(documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentUpdateRequest {\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentUpdateRequest} + * instance with all required arguments. + */ + public static Builder builder() { + return (documents) -> () -> new DocumentUpdateRequest().documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the documents of this {@link DocumentUpdateRequest} instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + * @return The DocumentUpdateRequest instance. + */ + Builder1 documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentUpdateRequest} instance. + * + * @param documents The documents of this {@link DocumentUpdateRequest} + * @return The DocumentUpdateRequest instance. + */ + default Builder1 documents(@Nonnull final DocumentInput... documents) { + return documents(Arrays.asList(documents)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link DocumentUpdateRequest} instance. + * + * @return The DocumentUpdateRequest instance. + */ + DocumentUpdateRequest build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java b/grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java new file mode 100644 index 000000000..82a449fc6 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A single document stored in a collection by ID without exposing its chunks. */ +// CHECKSTYLE:OFF +public class DocumentWithoutChunks +// CHECKSTYLE:ON +{ + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("id") + private UUID id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentWithoutChunks. */ + private DocumentWithoutChunks() {} + + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + * @return The same instance of this {@link DocumentWithoutChunks} class + */ + @Nonnull + public DocumentWithoutChunks metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentWithoutChunks}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentWithoutChunks} + */ + @Nonnull + public DocumentWithoutChunks addMetadataItem( + @Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentWithoutChunks} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Set the id of this {@link DocumentWithoutChunks} instance and return the same instance. + * + * @param id Unique identifier of a document. + * @return The same instance of this {@link DocumentWithoutChunks} class + */ + @Nonnull + public DocumentWithoutChunks id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier of a document. + * + * @return id The id of this {@link DocumentWithoutChunks} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentWithoutChunks} instance. + * + * @param id Unique identifier of a document. + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentWithoutChunks}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentWithoutChunks} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentWithoutChunks has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentWithoutChunks} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentWithoutChunks documentWithoutChunks = (DocumentWithoutChunks) o; + return Objects.equals(this.cloudSdkCustomFields, documentWithoutChunks.cloudSdkCustomFields) + && Objects.equals(this.metadata, documentWithoutChunks.metadata) + && Objects.equals(this.id, documentWithoutChunks.id); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentWithoutChunks {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentWithoutChunks} + * instance with all required arguments. + */ + public static Builder builder() { + return (metadata) -> (id) -> () -> new DocumentWithoutChunks().metadata(metadata).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + * @return The DocumentWithoutChunks builder. + */ + Builder1 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link DocumentWithoutChunks} instance. + * + * @param metadata The metadata of this {@link DocumentWithoutChunks} + * @return The DocumentWithoutChunks builder. + */ + default Builder1 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link DocumentWithoutChunks} instance. + * + * @param id Unique identifier of a document. + * @return The DocumentWithoutChunks instance. + */ + Builder2 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link DocumentWithoutChunks} instance. + * + * @return The DocumentWithoutChunks instance. + */ + DocumentWithoutChunks build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/Documents.java b/grounding/src/main/resources/openapi/grounding/model/Documents.java new file mode 100644 index 000000000..3751d298d --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/Documents.java @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentWithoutChunks; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing documents retrieved from the server. */ +// CHECKSTYLE:OFF +public class Documents +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Documents. */ + private Documents() {} + + /** + * Set the resources of this {@link Documents} instance and return the same instance. + * + * @param resources The resources of this {@link Documents} + * @return The same instance of this {@link Documents} class + */ + @Nonnull + public Documents resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link Documents}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link Documents} + */ + @Nonnull + public Documents addResourcesItem(@Nonnull final DocumentWithoutChunks resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link Documents} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link Documents} instance. + * + * @param resources The resources of this {@link Documents} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link Documents} instance and return the same instance. + * + * @param count The count of this {@link Documents} + * @return The same instance of this {@link Documents} class + */ + @Nonnull + public Documents count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link Documents} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link Documents} instance. + * + * @param count The count of this {@link Documents} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link Documents}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Documents} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Documents has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Documents} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Documents documents = (Documents) o; + return Objects.equals(this.cloudSdkCustomFields, documents.cloudSdkCustomFields) + && Objects.equals(this.resources, documents.resources) + && Objects.equals(this.count, documents.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Documents {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Documents} instance + * with all required arguments. + */ + public static Builder builder() { + return (resources) -> () -> new Documents().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link Documents} instance. + * + * @param resources The resources of this {@link Documents} + * @return The Documents instance. + */ + Builder1 resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link Documents} instance. + * + * @param resources The resources of this {@link Documents} + * @return The Documents instance. + */ + default Builder1 resources(@Nonnull final DocumentWithoutChunks... resources) { + return resources(Arrays.asList(resources)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link Documents} instance. + * + * @return The Documents instance. + */ + Documents build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java b/grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java new file mode 100644 index 000000000..48117de68 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentOutput; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentsChunk */ +// CHECKSTYLE:OFF +public class DocumentsChunk +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private UUID id; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentsChunk. */ + private DocumentsChunk() {} + + /** + * Set the id of this {@link DocumentsChunk} instance and return the same instance. + * + * @param id The id of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk id(@Nonnull final UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link DocumentsChunk} instance. + */ + @Nonnull + public UUID getId() { + return id; + } + + /** + * Set the id of this {@link DocumentsChunk} instance. + * + * @param id The id of this {@link DocumentsChunk} + */ + public void setId(@Nonnull final UUID id) { + this.id = id; + } + + /** + * Set the title of this {@link DocumentsChunk} instance and return the same instance. + * + * @param title The title of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk title(@Nonnull final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DocumentsChunk} instance. + */ + @Nonnull + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DocumentsChunk} instance. + * + * @param title The title of this {@link DocumentsChunk} + */ + public void setTitle(@Nonnull final String title) { + this.title = title; + } + + /** + * Set the metadata of this {@link DocumentsChunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link DocumentsChunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link DocumentsChunk} + */ + @Nonnull + public DocumentsChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link DocumentsChunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link DocumentsChunk} instance. + * + * @param metadata The metadata of this {@link DocumentsChunk} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the documents of this {@link DocumentsChunk} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentsChunk} + * @return The same instance of this {@link DocumentsChunk} class + */ + @Nonnull + public DocumentsChunk documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentsChunk}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentsChunk} + */ + @Nonnull + public DocumentsChunk addDocumentsItem(@Nonnull final DocumentOutput documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentsChunk} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentsChunk} instance. + * + * @param documents The documents of this {@link DocumentsChunk} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentsChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentsChunk} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("DocumentsChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentsChunk} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentsChunk documentsChunk = (DocumentsChunk) o; + return Objects.equals(this.cloudSdkCustomFields, documentsChunk.cloudSdkCustomFields) + && Objects.equals(this.id, documentsChunk.id) + && Objects.equals(this.title, documentsChunk.title) + && Objects.equals(this.metadata, documentsChunk.metadata) + && Objects.equals(this.documents, documentsChunk.documents); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, metadata, documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentsChunk {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentsChunk} + * instance with all required arguments. + */ + public static Builder builder() { + return (id) -> + (title) -> + (documents) -> () -> new DocumentsChunk().id(id).title(title).documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DocumentsChunk} instance. + * + * @param id The id of this {@link DocumentsChunk} + * @return The DocumentsChunk builder. + */ + Builder1 id(@Nonnull final UUID id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the title of this {@link DocumentsChunk} instance. + * + * @param title The title of this {@link DocumentsChunk} + * @return The DocumentsChunk builder. + */ + Builder2 title(@Nonnull final String title); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the documents of this {@link DocumentsChunk} instance. + * + * @param documents The documents of this {@link DocumentsChunk} + * @return The DocumentsChunk instance. + */ + Builder3 documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentsChunk} instance. + * + * @param documents The documents of this {@link DocumentsChunk} + * @return The DocumentsChunk instance. + */ + default Builder3 documents(@Nonnull final DocumentOutput... documents) { + return documents(Arrays.asList(documents)); + } + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link DocumentsChunk} instance. + * + * @return The DocumentsChunk instance. + */ + DocumentsChunk build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java b/grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java new file mode 100644 index 000000000..053a75b22 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentWithoutChunks; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A response containing documents created or updated, retrieved from the server. */ +// CHECKSTYLE:OFF +public class DocumentsListResponse +// CHECKSTYLE:ON +{ + @JsonProperty("documents") + private List documents = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentsListResponse. */ + private DocumentsListResponse() {} + + /** + * Set the documents of this {@link DocumentsListResponse} instance and return the same instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + * @return The same instance of this {@link DocumentsListResponse} class + */ + @Nonnull + public DocumentsListResponse documents(@Nonnull final List documents) { + this.documents = documents; + return this; + } + + /** + * Add one documents instance to this {@link DocumentsListResponse}. + * + * @param documentsItem The documents that should be added + * @return The same instance of type {@link DocumentsListResponse} + */ + @Nonnull + public DocumentsListResponse addDocumentsItem( + @Nonnull final DocumentWithoutChunks documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * + * @return documents The documents of this {@link DocumentsListResponse} instance. + */ + @Nonnull + public List getDocuments() { + return documents; + } + + /** + * Set the documents of this {@link DocumentsListResponse} instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + */ + public void setDocuments(@Nonnull final List documents) { + this.documents = documents; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentsListResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentsListResponse} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentsListResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentsListResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentsListResponse documentsListResponse = (DocumentsListResponse) o; + return Objects.equals(this.cloudSdkCustomFields, documentsListResponse.cloudSdkCustomFields) + && Objects.equals(this.documents, documentsListResponse.documents); + } + + @Override + public int hashCode() { + return Objects.hash(documents, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentsListResponse {\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link DocumentsListResponse} + * instance with all required arguments. + */ + public static Builder builder() { + return (documents) -> () -> new DocumentsListResponse().documents(documents); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the documents of this {@link DocumentsListResponse} instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + * @return The DocumentsListResponse instance. + */ + Builder1 documents(@Nonnull final List documents); + + /** + * Set the documents of this {@link DocumentsListResponse} instance. + * + * @param documents The documents of this {@link DocumentsListResponse} + * @return The DocumentsListResponse instance. + */ + default Builder1 documents(@Nonnull final DocumentWithoutChunks... documents) { + return documents(Arrays.asList(documents)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link DocumentsListResponse} instance. + * + * @return The DocumentsListResponse instance. + */ + DocumentsListResponse build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java b/grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java new file mode 100644 index 000000000..e19ef541c --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** EmbeddingConfig */ +// CHECKSTYLE:OFF +public class EmbeddingConfig +// CHECKSTYLE:ON +{ + @JsonProperty("modelName") + private String modelName = "text-embedding-ada-002"; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for EmbeddingConfig. */ + private EmbeddingConfig() {} + + /** + * Set the modelName of this {@link EmbeddingConfig} instance and return the same instance. + * + * @param modelName The modelName of this {@link EmbeddingConfig} + * @return The same instance of this {@link EmbeddingConfig} class + */ + @Nonnull + public EmbeddingConfig modelName(@Nullable final String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get modelName + * + * @return modelName The modelName of this {@link EmbeddingConfig} instance. + */ + @Nonnull + public String getModelName() { + return modelName; + } + + /** + * Set the modelName of this {@link EmbeddingConfig} instance. + * + * @param modelName The modelName of this {@link EmbeddingConfig} + */ + public void setModelName(@Nullable final String modelName) { + this.modelName = modelName; + } + + /** + * Get the names of the unrecognizable properties of the {@link EmbeddingConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link EmbeddingConfig} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("EmbeddingConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link EmbeddingConfig} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final EmbeddingConfig embeddingConfig = (EmbeddingConfig) o; + return Objects.equals(this.cloudSdkCustomFields, embeddingConfig.cloudSdkCustomFields) + && Objects.equals(this.modelName, embeddingConfig.modelName); + } + + @Override + public int hashCode() { + return Objects.hash(modelName, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddingConfig {\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link EmbeddingConfig} instance. No arguments are required. */ + public static EmbeddingConfig builder() { + return new EmbeddingConfig(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/InlineObject.java b/grounding/src/main/resources/openapi/grounding/model/InlineObject.java new file mode 100644 index 000000000..6764489da --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/InlineObject.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.ApiError; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** InlineObject */ +// CHECKSTYLE:OFF +public class InlineObject +// CHECKSTYLE:ON +{ + @JsonProperty("error") + private ApiError error; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for InlineObject. */ + private InlineObject() {} + + /** + * Set the error of this {@link InlineObject} instance and return the same instance. + * + * @param error The error of this {@link InlineObject} + * @return The same instance of this {@link InlineObject} class + */ + @Nonnull + public InlineObject error(@Nullable final ApiError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link InlineObject} instance. + */ + @Nonnull + public ApiError getError() { + return error; + } + + /** + * Set the error of this {@link InlineObject} instance. + * + * @param error The error of this {@link InlineObject} + */ + public void setError(@Nullable final ApiError error) { + this.error = error; + } + + /** + * Get the names of the unrecognizable properties of the {@link InlineObject}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link InlineObject} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("InlineObject has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link InlineObject} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final InlineObject inlineObject = (InlineObject) o; + return Objects.equals(this.cloudSdkCustomFields, inlineObject.cloudSdkCustomFields) + && Objects.equals(this.error, inlineObject.error); + } + + @Override + public int hashCode() { + return Objects.hash(error, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link InlineObject} instance. No arguments are required. */ + public static InlineObject builder() { + return new InlineObject(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java b/grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java new file mode 100644 index 000000000..77f9f1a64 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** KeyValueListPair */ +// CHECKSTYLE:OFF +public class KeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for KeyValueListPair. */ + private KeyValueListPair() {} + + /** + * Set the key of this {@link KeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link KeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key The key of this {@link KeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link KeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link KeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link KeyValueListPair} + */ + @Nonnull + public KeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link KeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link KeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link KeyValueListPair} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("KeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link KeyValueListPair} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final KeyValueListPair keyValueListPair = (KeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, keyValueListPair.key) + && Objects.equals(this.value, keyValueListPair.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class KeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link KeyValueListPair} + * instance with all required arguments. + */ + public static Builder builder() { + return (key) -> (value) -> () -> new KeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key The key of this {@link KeyValueListPair} + * @return The KeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The KeyValueListPair instance. + */ + Builder2 value(@Nonnull final List value); + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The KeyValueListPair instance. + */ + default Builder2 value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link KeyValueListPair} instance. + * + * @return The KeyValueListPair instance. + */ + KeyValueListPair build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java b/grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java new file mode 100644 index 000000000..200cd6652 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentsChunk; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PerFilterSearchResult */ +// CHECKSTYLE:OFF +public class PerFilterSearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PerFilterSearchResult. */ + private PerFilterSearchResult() {} + + /** + * Set the filterId of this {@link PerFilterSearchResult} instance and return the same instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResult} + * @return The same instance of this {@link PerFilterSearchResult} class + */ + @Nonnull + public PerFilterSearchResult filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link PerFilterSearchResult} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link PerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResult} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link PerFilterSearchResult} instance and return the same instance. + * + * @param results The results of this {@link PerFilterSearchResult} + * @return The same instance of this {@link PerFilterSearchResult} class + */ + @Nonnull + public PerFilterSearchResult results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link PerFilterSearchResult}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link PerFilterSearchResult} + */ + @Nonnull + public PerFilterSearchResult addResultsItem(@Nonnull final DocumentsChunk resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * + * @return results The results of this {@link PerFilterSearchResult} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link PerFilterSearchResult} instance. + * + * @param results The results of this {@link PerFilterSearchResult} + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link PerFilterSearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PerFilterSearchResult} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PerFilterSearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PerFilterSearchResult} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PerFilterSearchResult perFilterSearchResult = (PerFilterSearchResult) o; + return Objects.equals(this.cloudSdkCustomFields, perFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, perFilterSearchResult.filterId) + && Objects.equals(this.results, perFilterSearchResult.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PerFilterSearchResult {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link PerFilterSearchResult} + * instance with all required arguments. + */ + public static Builder builder() { + return (filterId) -> + (results) -> () -> new PerFilterSearchResult().filterId(filterId).results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link PerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResult} + * @return The PerFilterSearchResult builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the results of this {@link PerFilterSearchResult} instance. + * + * @param results The results of this {@link PerFilterSearchResult} + * @return The PerFilterSearchResult instance. + */ + Builder2 results(@Nonnull final List results); + + /** + * Set the results of this {@link PerFilterSearchResult} instance. + * + * @param results The results of this {@link PerFilterSearchResult} + * @return The PerFilterSearchResult instance. + */ + default Builder2 results(@Nonnull final DocumentsChunk... results) { + return results(Arrays.asList(results)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link PerFilterSearchResult} instance. + * + * @return The PerFilterSearchResult instance. + */ + PerFilterSearchResult build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/Pipeline.java b/grounding/src/main/resources/openapi/grounding/model/Pipeline.java new file mode 100644 index 000000000..27a73abca --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/Pipeline.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineConfiguration; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Pipeline */ +// CHECKSTYLE:OFF +public class Pipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; + + @JsonProperty("configuration") + private PipelineConfiguration _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Pipeline. */ + private Pipeline() {} + + /** + * Set the id of this {@link Pipeline} instance and return the same instance. + * + * @param id The id of this {@link Pipeline} + * @return The same instance of this {@link Pipeline} class + */ + @Nonnull + public Pipeline id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link Pipeline} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link Pipeline} instance. + * + * @param id The id of this {@link Pipeline} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the type of this {@link Pipeline} instance and return the same instance. + * + * @param type The type of this {@link Pipeline} + * @return The same instance of this {@link Pipeline} class + */ + @Nonnull + public Pipeline type(@Nullable final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link Pipeline} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link Pipeline} instance. + * + * @param type The type of this {@link Pipeline} + */ + public void setType(@Nullable final String type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link Pipeline} instance and return the same instance. + * + * @param _configuration The _configuration of this {@link Pipeline} + * @return The same instance of this {@link Pipeline} class + */ + @Nonnull + public Pipeline _configuration(@Nullable final PipelineConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link Pipeline} instance. + */ + @Nonnull + public PipelineConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link Pipeline} instance. + * + * @param _configuration The _configuration of this {@link Pipeline} + */ + public void setConfiguration(@Nullable final PipelineConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link Pipeline}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Pipeline} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Pipeline has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Pipeline} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Pipeline pipeline = (Pipeline) o; + return Objects.equals(this.cloudSdkCustomFields, pipeline.cloudSdkCustomFields) + && Objects.equals(this.id, pipeline.id) + && Objects.equals(this.type, pipeline.type) + && Objects.equals(this._configuration, pipeline._configuration); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, _configuration, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Pipeline {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link Pipeline} instance. No arguments are required. */ + public static Pipeline builder() { + return new Pipeline(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java b/grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java new file mode 100644 index 000000000..70d9fd868 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineConfigurationSharePoint; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineConfiguration */ +// CHECKSTYLE:OFF +public class PipelineConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("destination") + private String destination; + + @JsonProperty("sharePoint") + private PipelineConfigurationSharePoint sharePoint; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineConfiguration. */ + private PipelineConfiguration() {} + + /** + * Set the destination of this {@link PipelineConfiguration} instance and return the same + * instance. + * + * @param destination The destination of this {@link PipelineConfiguration} + * @return The same instance of this {@link PipelineConfiguration} class + */ + @Nonnull + public PipelineConfiguration destination(@Nullable final String destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination The destination of this {@link PipelineConfiguration} instance. + */ + @Nonnull + public String getDestination() { + return destination; + } + + /** + * Set the destination of this {@link PipelineConfiguration} instance. + * + * @param destination The destination of this {@link PipelineConfiguration} + */ + public void setDestination(@Nullable final String destination) { + this.destination = destination; + } + + /** + * Set the sharePoint of this {@link PipelineConfiguration} instance and return the same instance. + * + * @param sharePoint The sharePoint of this {@link PipelineConfiguration} + * @return The same instance of this {@link PipelineConfiguration} class + */ + @Nonnull + public PipelineConfiguration sharePoint( + @Nullable final PipelineConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + return this; + } + + /** + * Get sharePoint + * + * @return sharePoint The sharePoint of this {@link PipelineConfiguration} instance. + */ + @Nonnull + public PipelineConfigurationSharePoint getSharePoint() { + return sharePoint; + } + + /** + * Set the sharePoint of this {@link PipelineConfiguration} instance. + * + * @param sharePoint The sharePoint of this {@link PipelineConfiguration} + */ + public void setSharePoint(@Nullable final PipelineConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineConfiguration} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineConfiguration} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineConfiguration pipelineConfiguration = (PipelineConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, pipelineConfiguration.destination) + && Objects.equals(this.sharePoint, pipelineConfiguration.sharePoint); + } + + @Override + public int hashCode() { + return Objects.hash(destination, sharePoint, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineConfiguration {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineConfiguration} instance. No arguments are required. */ + public static PipelineConfiguration builder() { + return new PipelineConfiguration(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java b/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java new file mode 100644 index 000000000..26846da4a --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineConfigurationSharePointSite; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineConfigurationSharePoint */ +// CHECKSTYLE:OFF +public class PipelineConfigurationSharePoint +// CHECKSTYLE:ON +{ + @JsonProperty("site") + private PipelineConfigurationSharePointSite site; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineConfigurationSharePoint. */ + private PipelineConfigurationSharePoint() {} + + /** + * Set the site of this {@link PipelineConfigurationSharePoint} instance and return the same + * instance. + * + * @param site The site of this {@link PipelineConfigurationSharePoint} + * @return The same instance of this {@link PipelineConfigurationSharePoint} class + */ + @Nonnull + public PipelineConfigurationSharePoint site( + @Nullable final PipelineConfigurationSharePointSite site) { + this.site = site; + return this; + } + + /** + * Get site + * + * @return site The site of this {@link PipelineConfigurationSharePoint} instance. + */ + @Nonnull + public PipelineConfigurationSharePointSite getSite() { + return site; + } + + /** + * Set the site of this {@link PipelineConfigurationSharePoint} instance. + * + * @param site The site of this {@link PipelineConfigurationSharePoint} + */ + public void setSite(@Nullable final PipelineConfigurationSharePointSite site) { + this.site = site; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineConfigurationSharePoint}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePoint} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineConfigurationSharePoint has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineConfigurationSharePoint} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineConfigurationSharePoint pipelineConfigurationSharePoint = + (PipelineConfigurationSharePoint) o; + return Objects.equals( + this.cloudSdkCustomFields, pipelineConfigurationSharePoint.cloudSdkCustomFields) + && Objects.equals(this.site, pipelineConfigurationSharePoint.site); + } + + @Override + public int hashCode() { + return Objects.hash(site, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineConfigurationSharePoint {\n"); + sb.append(" site: ").append(toIndentedString(site)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineConfigurationSharePoint} instance. No arguments are required. */ + public static PipelineConfigurationSharePoint builder() { + return new PipelineConfigurationSharePoint(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java b/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java new file mode 100644 index 000000000..8ab4902ca --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineConfigurationSharePointSite */ +// CHECKSTYLE:OFF +public class PipelineConfigurationSharePointSite +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("includePaths") + private List includePaths = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineConfigurationSharePointSite. */ + private PipelineConfigurationSharePointSite() {} + + /** + * Set the id of this {@link PipelineConfigurationSharePointSite} instance and return the same + * instance. + * + * @param id The id of this {@link PipelineConfigurationSharePointSite} + * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + */ + @Nonnull + public PipelineConfigurationSharePointSite id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PipelineConfigurationSharePointSite} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link PipelineConfigurationSharePointSite} instance. + * + * @param id The id of this {@link PipelineConfigurationSharePointSite} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the name of this {@link PipelineConfigurationSharePointSite} instance and return the same + * instance. + * + * @param name The name of this {@link PipelineConfigurationSharePointSite} + * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + */ + @Nonnull + public PipelineConfigurationSharePointSite name(@Nullable final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PipelineConfigurationSharePointSite} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link PipelineConfigurationSharePointSite} instance. + * + * @param name The name of this {@link PipelineConfigurationSharePointSite} + */ + public void setName(@Nullable final String name) { + this.name = name; + } + + /** + * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance and return + * the same instance. + * + * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + */ + @Nonnull + public PipelineConfigurationSharePointSite includePaths( + @Nullable final List includePaths) { + this.includePaths = includePaths; + return this; + } + + /** + * Add one includePaths instance to this {@link PipelineConfigurationSharePointSite}. + * + * @param includePathsItem The includePaths that should be added + * @return The same instance of type {@link PipelineConfigurationSharePointSite} + */ + @Nonnull + public PipelineConfigurationSharePointSite addIncludePathsItem( + @Nonnull final String includePathsItem) { + if (this.includePaths == null) { + this.includePaths = new ArrayList<>(); + } + this.includePaths.add(includePathsItem); + return this; + } + + /** + * Get includePaths + * + * @return includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + * instance. + */ + @Nonnull + public List getIncludePaths() { + return includePaths; + } + + /** + * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance. + * + * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + */ + public void setIncludePaths(@Nullable final List includePaths) { + this.includePaths = includePaths; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * PipelineConfigurationSharePointSite}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePointSite} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineConfigurationSharePointSite has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineConfigurationSharePointSite} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineConfigurationSharePointSite pipelineConfigurationSharePointSite = + (PipelineConfigurationSharePointSite) o; + return Objects.equals( + this.cloudSdkCustomFields, pipelineConfigurationSharePointSite.cloudSdkCustomFields) + && Objects.equals(this.id, pipelineConfigurationSharePointSite.id) + && Objects.equals(this.name, pipelineConfigurationSharePointSite.name) + && Objects.equals(this.includePaths, pipelineConfigurationSharePointSite.includePaths); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, includePaths, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineConfigurationSharePointSite {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link PipelineConfigurationSharePointSite} instance. No arguments are required. + */ + public static PipelineConfigurationSharePointSite builder() { + return new PipelineConfigurationSharePointSite(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineId.java b/grounding/src/main/resources/openapi/grounding/model/PipelineId.java new file mode 100644 index 000000000..ff666cd11 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelineId.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineId */ +// CHECKSTYLE:OFF +public class PipelineId +// CHECKSTYLE:ON +{ + @JsonProperty("pipelineId") + private String pipelineId; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineId. */ + private PipelineId() {} + + /** + * Set the pipelineId of this {@link PipelineId} instance and return the same instance. + * + * @param pipelineId The pipelineId of this {@link PipelineId} + * @return The same instance of this {@link PipelineId} class + */ + @Nonnull + public PipelineId pipelineId(@Nullable final String pipelineId) { + this.pipelineId = pipelineId; + return this; + } + + /** + * Get pipelineId + * + * @return pipelineId The pipelineId of this {@link PipelineId} instance. + */ + @Nonnull + public String getPipelineId() { + return pipelineId; + } + + /** + * Set the pipelineId of this {@link PipelineId} instance. + * + * @param pipelineId The pipelineId of this {@link PipelineId} + */ + public void setPipelineId(@Nullable final String pipelineId) { + this.pipelineId = pipelineId; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineId}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineId} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("PipelineId has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineId} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineId pipelineId = (PipelineId) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineId.cloudSdkCustomFields) + && Objects.equals(this.pipelineId, pipelineId.pipelineId); + } + + @Override + public int hashCode() { + return Objects.hash(pipelineId, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineId {\n"); + sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineId} instance. No arguments are required. */ + public static PipelineId builder() { + return new PipelineId(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java new file mode 100644 index 000000000..920736b1a --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequstConfiguration; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequst */ +// CHECKSTYLE:OFF +public class PipelinePostRequst +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private String type; + + @JsonProperty("configuration") + private PipelinePostRequstConfiguration _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequst. */ + private PipelinePostRequst() {} + + /** + * Set the type of this {@link PipelinePostRequst} instance and return the same instance. + * + * @param type The type of this {@link PipelinePostRequst} + * @return The same instance of this {@link PipelinePostRequst} class + */ + @Nonnull + public PipelinePostRequst type(@Nonnull final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link PipelinePostRequst} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link PipelinePostRequst} instance. + * + * @param type The type of this {@link PipelinePostRequst} + */ + public void setType(@Nonnull final String type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link PipelinePostRequst} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link PipelinePostRequst} + * @return The same instance of this {@link PipelinePostRequst} class + */ + @Nonnull + public PipelinePostRequst _configuration( + @Nonnull final PipelinePostRequstConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link PipelinePostRequst} instance. + */ + @Nonnull + public PipelinePostRequstConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link PipelinePostRequst} instance. + * + * @param _configuration The _configuration of this {@link PipelinePostRequst} + */ + public void setConfiguration(@Nonnull final PipelinePostRequstConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelinePostRequst}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelinePostRequst} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("PipelinePostRequst has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequst} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequst pipelinePostRequst = (PipelinePostRequst) o; + return Objects.equals(this.cloudSdkCustomFields, pipelinePostRequst.cloudSdkCustomFields) + && Objects.equals(this.type, pipelinePostRequst.type) + && Objects.equals(this._configuration, pipelinePostRequst._configuration); + } + + @Override + public int hashCode() { + return Objects.hash(type, _configuration, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequst {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link PipelinePostRequst} + * instance with all required arguments. + */ + public static Builder builder() { + return (type) -> + (_configuration) -> + () -> new PipelinePostRequst().type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link PipelinePostRequst} instance. + * + * @param type The type of this {@link PipelinePostRequst} + * @return The PipelinePostRequst builder. + */ + Builder1 type(@Nonnull final String type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _configuration of this {@link PipelinePostRequst} instance. + * + * @param _configuration The _configuration of this {@link PipelinePostRequst} + * @return The PipelinePostRequst instance. + */ + Builder2 _configuration(@Nonnull final PipelinePostRequstConfiguration _configuration); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link PipelinePostRequst} instance. + * + * @return The PipelinePostRequst instance. + */ + PipelinePostRequst build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java new file mode 100644 index 000000000..7f6f55b8f --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequstConfigurationSharePoint; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequstConfiguration */ +// CHECKSTYLE:OFF +public class PipelinePostRequstConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("destination") + private String destination; + + @JsonProperty("sharePoint") + private PipelinePostRequstConfigurationSharePoint sharePoint; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequstConfiguration. */ + private PipelinePostRequstConfiguration() {} + + /** + * Set the destination of this {@link PipelinePostRequstConfiguration} instance and return the + * same instance. + * + * @param destination The destination of this {@link PipelinePostRequstConfiguration} + * @return The same instance of this {@link PipelinePostRequstConfiguration} class + */ + @Nonnull + public PipelinePostRequstConfiguration destination(@Nonnull final String destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination The destination of this {@link PipelinePostRequstConfiguration} instance. + */ + @Nonnull + public String getDestination() { + return destination; + } + + /** + * Set the destination of this {@link PipelinePostRequstConfiguration} instance. + * + * @param destination The destination of this {@link PipelinePostRequstConfiguration} + */ + public void setDestination(@Nonnull final String destination) { + this.destination = destination; + } + + /** + * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance and return the same + * instance. + * + * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} + * @return The same instance of this {@link PipelinePostRequstConfiguration} class + */ + @Nonnull + public PipelinePostRequstConfiguration sharePoint( + @Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + return this; + } + + /** + * Get sharePoint + * + * @return sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} instance. + */ + @Nonnull + public PipelinePostRequstConfigurationSharePoint getSharePoint() { + return sharePoint; + } + + /** + * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance. + * + * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} + */ + public void setSharePoint(@Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { + this.sharePoint = sharePoint; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelinePostRequstConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelinePostRequstConfiguration} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelinePostRequstConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequstConfiguration} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequstConfiguration pipelinePostRequstConfiguration = + (PipelinePostRequstConfiguration) o; + return Objects.equals( + this.cloudSdkCustomFields, pipelinePostRequstConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, pipelinePostRequstConfiguration.destination) + && Objects.equals(this.sharePoint, pipelinePostRequstConfiguration.sharePoint); + } + + @Override + public int hashCode() { + return Objects.hash(destination, sharePoint, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequstConfiguration {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * PipelinePostRequstConfiguration} instance with all required arguments. + */ + public static Builder builder() { + return (destination) -> () -> new PipelinePostRequstConfiguration().destination(destination); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the destination of this {@link PipelinePostRequstConfiguration} instance. + * + * @param destination The destination of this {@link PipelinePostRequstConfiguration} + * @return The PipelinePostRequstConfiguration instance. + */ + Builder1 destination(@Nonnull final String destination); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link PipelinePostRequstConfiguration} instance. + * + * @return The PipelinePostRequstConfiguration instance. + */ + PipelinePostRequstConfiguration build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java new file mode 100644 index 000000000..7dfc5b449 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequstConfigurationSharePointSite; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequstConfigurationSharePoint */ +// CHECKSTYLE:OFF +public class PipelinePostRequstConfigurationSharePoint +// CHECKSTYLE:ON +{ + @JsonProperty("site") + private PipelinePostRequstConfigurationSharePointSite site; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequstConfigurationSharePoint. */ + private PipelinePostRequstConfigurationSharePoint() {} + + /** + * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance and return the + * same instance. + * + * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} + * @return The same instance of this {@link PipelinePostRequstConfigurationSharePoint} class + */ + @Nonnull + public PipelinePostRequstConfigurationSharePoint site( + @Nullable final PipelinePostRequstConfigurationSharePointSite site) { + this.site = site; + return this; + } + + /** + * Get site + * + * @return site The site of this {@link PipelinePostRequstConfigurationSharePoint} instance. + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite getSite() { + return site; + } + + /** + * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance. + * + * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} + */ + public void setSite(@Nullable final PipelinePostRequstConfigurationSharePointSite site) { + this.site = site; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * PipelinePostRequstConfigurationSharePoint}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * PipelinePostRequstConfigurationSharePoint} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelinePostRequstConfigurationSharePoint has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePoint} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequstConfigurationSharePoint pipelinePostRequstConfigurationSharePoint = + (PipelinePostRequstConfigurationSharePoint) o; + return Objects.equals( + this.cloudSdkCustomFields, + pipelinePostRequstConfigurationSharePoint.cloudSdkCustomFields) + && Objects.equals(this.site, pipelinePostRequstConfigurationSharePoint.site); + } + + @Override + public int hashCode() { + return Objects.hash(site, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequstConfigurationSharePoint {\n"); + sb.append(" site: ").append(toIndentedString(site)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link PipelinePostRequstConfigurationSharePoint} instance. No arguments are + * required. + */ + public static PipelinePostRequstConfigurationSharePoint builder() { + return new PipelinePostRequstConfigurationSharePoint(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java new file mode 100644 index 000000000..dfe797770 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelinePostRequstConfigurationSharePointSite */ +// CHECKSTYLE:OFF +public class PipelinePostRequstConfigurationSharePointSite +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("includePaths") + private List includePaths = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelinePostRequstConfigurationSharePointSite. */ + private PipelinePostRequstConfigurationSharePointSite() {} + + /** + * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance and return + * the same instance. + * + * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} + * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite name(@Nullable final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * + * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} + */ + public void setName(@Nullable final String name) { + this.name = name; + } + + /** + * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance and + * return the same instance. + * + * @param includePaths The includePaths of this {@link + * PipelinePostRequstConfigurationSharePointSite} + * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite includePaths( + @Nullable final List includePaths) { + this.includePaths = includePaths; + return this; + } + + /** + * Add one includePaths instance to this {@link PipelinePostRequstConfigurationSharePointSite}. + * + * @param includePathsItem The includePaths that should be added + * @return The same instance of type {@link PipelinePostRequstConfigurationSharePointSite} + */ + @Nonnull + public PipelinePostRequstConfigurationSharePointSite addIncludePathsItem( + @Nonnull final String includePathsItem) { + if (this.includePaths == null) { + this.includePaths = new ArrayList<>(); + } + this.includePaths.add(includePathsItem); + return this; + } + + /** + * Get includePaths + * + * @return includePaths The includePaths of this {@link + * PipelinePostRequstConfigurationSharePointSite} instance. + */ + @Nonnull + public List getIncludePaths() { + return includePaths; + } + + /** + * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * + * @param includePaths The includePaths of this {@link + * PipelinePostRequstConfigurationSharePointSite} + */ + public void setIncludePaths(@Nullable final List includePaths) { + this.includePaths = includePaths; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * PipelinePostRequstConfigurationSharePointSite}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * PipelinePostRequstConfigurationSharePointSite} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelinePostRequstConfigurationSharePointSite has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePointSite} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelinePostRequstConfigurationSharePointSite + pipelinePostRequstConfigurationSharePointSite = + (PipelinePostRequstConfigurationSharePointSite) o; + return Objects.equals( + this.cloudSdkCustomFields, + pipelinePostRequstConfigurationSharePointSite.cloudSdkCustomFields) + && Objects.equals(this.name, pipelinePostRequstConfigurationSharePointSite.name) + && Objects.equals( + this.includePaths, pipelinePostRequstConfigurationSharePointSite.includePaths); + } + + @Override + public int hashCode() { + return Objects.hash(name, includePaths, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelinePostRequstConfigurationSharePointSite {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link PipelinePostRequstConfigurationSharePointSite} instance. No arguments are + * required. + */ + public static PipelinePostRequstConfigurationSharePointSite builder() { + return new PipelinePostRequstConfigurationSharePointSite(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java b/grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java new file mode 100644 index 000000000..55f6f6b89 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineStatus */ +// CHECKSTYLE:OFF +public class PipelineStatus +// CHECKSTYLE:ON +{ + @JsonProperty("lastStarted") + private OffsetDateTime lastStarted; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineStatus. */ + private PipelineStatus() {} + + /** + * Set the lastStarted of this {@link PipelineStatus} instance and return the same instance. + * + * @param lastStarted The lastStarted of this {@link PipelineStatus} + * @return The same instance of this {@link PipelineStatus} class + */ + @Nonnull + public PipelineStatus lastStarted(@Nullable final OffsetDateTime lastStarted) { + this.lastStarted = lastStarted; + return this; + } + + /** + * Get lastStarted + * + * @return lastStarted The lastStarted of this {@link PipelineStatus} instance. + */ + @Nonnull + public OffsetDateTime getLastStarted() { + return lastStarted; + } + + /** + * Set the lastStarted of this {@link PipelineStatus} instance. + * + * @param lastStarted The lastStarted of this {@link PipelineStatus} + */ + public void setLastStarted(@Nullable final OffsetDateTime lastStarted) { + this.lastStarted = lastStarted; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineStatus}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineStatus} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("PipelineStatus has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link PipelineStatus} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineStatus pipelineStatus = (PipelineStatus) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineStatus.cloudSdkCustomFields) + && Objects.equals(this.lastStarted, pipelineStatus.lastStarted); + } + + @Override + public int hashCode() { + return Objects.hash(lastStarted, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineStatus {\n"); + sb.append(" lastStarted: ").append(toIndentedString(lastStarted)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineStatus} instance. No arguments are required. */ + public static PipelineStatus builder() { + return new PipelineStatus(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/Pipelines.java b/grounding/src/main/resources/openapi/grounding/model/Pipelines.java new file mode 100644 index 000000000..944a62c46 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/Pipelines.java @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Pipeline; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Pipelines */ +// CHECKSTYLE:OFF +public class Pipelines +// CHECKSTYLE:ON +{ + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonProperty("count") + private Integer count; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Pipelines. */ + private Pipelines() {} + + /** + * Set the resources of this {@link Pipelines} instance and return the same instance. + * + * @param resources The resources of this {@link Pipelines} + * @return The same instance of this {@link Pipelines} class + */ + @Nonnull + public Pipelines resources(@Nonnull final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link Pipelines}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link Pipelines} + */ + @Nonnull + public Pipelines addResourcesItem(@Nonnull final Pipeline resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link Pipelines} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link Pipelines} instance. + * + * @param resources The resources of this {@link Pipelines} + */ + public void setResources(@Nonnull final List resources) { + this.resources = resources; + } + + /** + * Set the count of this {@link Pipelines} instance and return the same instance. + * + * @param count The count of this {@link Pipelines} + * @return The same instance of this {@link Pipelines} class + */ + @Nonnull + public Pipelines count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link Pipelines} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link Pipelines} instance. + * + * @param count The count of this {@link Pipelines} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Get the names of the unrecognizable properties of the {@link Pipelines}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Pipelines} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Pipelines has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Pipelines} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Pipelines pipelines = (Pipelines) o; + return Objects.equals(this.cloudSdkCustomFields, pipelines.cloudSdkCustomFields) + && Objects.equals(this.resources, pipelines.resources) + && Objects.equals(this.count, pipelines.count); + } + + @Override + public int hashCode() { + return Objects.hash(resources, count, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Pipelines {\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Pipelines} instance + * with all required arguments. + */ + public static Builder builder() { + return (resources) -> () -> new Pipelines().resources(resources); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the resources of this {@link Pipelines} instance. + * + * @param resources The resources of this {@link Pipelines} + * @return The Pipelines instance. + */ + Builder1 resources(@Nonnull final List resources); + + /** + * Set the resources of this {@link Pipelines} instance. + * + * @param resources The resources of this {@link Pipelines} + * @return The Pipelines instance. + */ + default Builder1 resources(@Nonnull final Pipeline... resources) { + return resources(Arrays.asList(resources)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link Pipelines} instance. + * + * @return The Pipelines instance. + */ + Pipelines build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/ResultsInner.java b/grounding/src/main/resources/openapi/grounding/model/ResultsInner.java new file mode 100644 index 000000000..ae70c7ebd --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/ResultsInner.java @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentsChunk; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ResultsInner */ +// CHECKSTYLE:OFF +public class ResultsInner +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResultsInner. */ + private ResultsInner() {} + + /** + * Set the filterId of this {@link ResultsInner} instance and return the same instance. + * + * @param filterId The filterId of this {@link ResultsInner} + * @return The same instance of this {@link ResultsInner} class + */ + @Nonnull + public ResultsInner filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link ResultsInner} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link ResultsInner} instance. + * + * @param filterId The filterId of this {@link ResultsInner} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link ResultsInner} instance and return the same instance. + * + * @param results The results of this {@link ResultsInner} + * @return The same instance of this {@link ResultsInner} class + */ + @Nonnull + public ResultsInner results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link ResultsInner}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link ResultsInner} + */ + @Nonnull + public ResultsInner addResultsItem(@Nonnull final DocumentsChunk resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * + * @return results The results of this {@link ResultsInner} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link ResultsInner} instance. + * + * @param results The results of this {@link ResultsInner} + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResultsInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResultsInner} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ResultsInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResultsInner} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ResultsInner resultsInner = (ResultsInner) o; + return Objects.equals(this.cloudSdkCustomFields, resultsInner.cloudSdkCustomFields) + && Objects.equals(this.filterId, resultsInner.filterId) + && Objects.equals(this.results, resultsInner.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResultsInner {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner} instance + * with all required arguments. + */ + public static Builder builder() { + return (filterId) -> (results) -> () -> new ResultsInner().filterId(filterId).results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link ResultsInner} instance. + * + * @param filterId The filterId of this {@link ResultsInner} + * @return The ResultsInner builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the results of this {@link ResultsInner} instance. + * + * @param results The results of this {@link ResultsInner} + * @return The ResultsInner instance. + */ + Builder2 results(@Nonnull final List results); + + /** + * Set the results of this {@link ResultsInner} instance. + * + * @param results The results of this {@link ResultsInner} + * @return The ResultsInner instance. + */ + default Builder2 results(@Nonnull final DocumentsChunk... results) { + return results(Arrays.asList(results)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link ResultsInner} instance. + * + * @return The ResultsInner instance. + */ + ResultsInner build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java b/grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java new file mode 100644 index 000000000..06a89b87c --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetievalDataRepositorySearchResult; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ResultsInner1 */ +// CHECKSTYLE:OFF +public class ResultsInner1 +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResultsInner1. */ + private ResultsInner1() {} + + /** + * Set the filterId of this {@link ResultsInner1} instance and return the same instance. + * + * @param filterId The filterId of this {@link ResultsInner1} + * @return The same instance of this {@link ResultsInner1} class + */ + @Nonnull + public ResultsInner1 filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link ResultsInner1} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link ResultsInner1} instance. + * + * @param filterId The filterId of this {@link ResultsInner1} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link ResultsInner1} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link ResultsInner1} class + */ + @Nonnull + public ResultsInner1 results(@Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link ResultsInner1}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link ResultsInner1} + */ + @Nonnull + public ResultsInner1 addResultsItem( + @Nonnull final RetievalDataRepositorySearchResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link ResultsInner1} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link ResultsInner1} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Set the message of this {@link ResultsInner1} instance and return the same instance. + * + * @param message The message of this {@link ResultsInner1} + * @return The same instance of this {@link ResultsInner1} class + */ + @Nonnull + public ResultsInner1 message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link ResultsInner1} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link ResultsInner1} instance. + * + * @param message The message of this {@link ResultsInner1} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResultsInner1}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResultsInner1} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ResultsInner1 has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResultsInner1} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ResultsInner1 resultsInner1 = (ResultsInner1) o; + return Objects.equals(this.cloudSdkCustomFields, resultsInner1.cloudSdkCustomFields) + && Objects.equals(this.filterId, resultsInner1.filterId) + && Objects.equals(this.results, resultsInner1.results) + && Objects.equals(this.message, resultsInner1.message); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResultsInner1 {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner1} instance + * with all required arguments. + */ + public static Builder builder() { + return (filterId) -> (message) -> () -> new ResultsInner1().filterId(filterId).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link ResultsInner1} instance. + * + * @param filterId The filterId of this {@link ResultsInner1} + * @return The ResultsInner1 builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link ResultsInner1} instance. + * + * @param message The message of this {@link ResultsInner1} + * @return The ResultsInner1 instance. + */ + Builder2 message(@Nonnull final String message); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link ResultsInner1} instance. + * + * @return The ResultsInner1 instance. + */ + ResultsInner1 build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java b/grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java new file mode 100644 index 000000000..9ad9d4226 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositoryWithDocuments; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalDataRepositorySearchResult */ +// CHECKSTYLE:OFF +public class RetievalDataRepositorySearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("dataRepository") + private DataRepositoryWithDocuments dataRepository; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalDataRepositorySearchResult. */ + private RetievalDataRepositorySearchResult() {} + + /** + * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance and return + * the same instance. + * + * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * @return The same instance of this {@link RetievalDataRepositorySearchResult} class + */ + @Nonnull + public RetievalDataRepositorySearchResult dataRepository( + @Nonnull final DataRepositoryWithDocuments dataRepository) { + this.dataRepository = dataRepository; + return this; + } + + /** + * Get dataRepository + * + * @return dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * instance. + */ + @Nonnull + public DataRepositoryWithDocuments getDataRepository() { + return dataRepository; + } + + /** + * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. + * + * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + */ + public void setDataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository) { + this.dataRepository = dataRepository; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetievalDataRepositorySearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetievalDataRepositorySearchResult} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalDataRepositorySearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalDataRepositorySearchResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalDataRepositorySearchResult retievalDataRepositorySearchResult = + (RetievalDataRepositorySearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, retievalDataRepositorySearchResult.cloudSdkCustomFields) + && Objects.equals(this.dataRepository, retievalDataRepositorySearchResult.dataRepository); + } + + @Override + public int hashCode() { + return Objects.hash(dataRepository, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalDataRepositorySearchResult {\n"); + sb.append(" dataRepository: ").append(toIndentedString(dataRepository)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetievalDataRepositorySearchResult} instance with all required arguments. + */ + public static Builder builder() { + return (dataRepository) -> + () -> new RetievalDataRepositorySearchResult().dataRepository(dataRepository); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. + * + * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * @return The RetievalDataRepositorySearchResult instance. + */ + Builder1 dataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link RetievalDataRepositorySearchResult} instance. + * + * @return The RetievalDataRepositorySearchResult instance. + */ + RetievalDataRepositorySearchResult build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java b/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java new file mode 100644 index 000000000..eaa5e3839 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetievalDataRepositorySearchResult; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalPerFilterSearchResult */ +// CHECKSTYLE:OFF +public class RetievalPerFilterSearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalPerFilterSearchResult. */ + private RetievalPerFilterSearchResult() {} + + /** + * Set the filterId of this {@link RetievalPerFilterSearchResult} instance and return the same + * instance. + * + * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + * @return The same instance of this {@link RetievalPerFilterSearchResult} class + */ + @Nonnull + public RetievalPerFilterSearchResult filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link RetievalPerFilterSearchResult} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link RetievalPerFilterSearchResult} instance and return the same + * instance. + * + * @param results List of returned results. + * @return The same instance of this {@link RetievalPerFilterSearchResult} class + */ + @Nonnull + public RetievalPerFilterSearchResult results( + @Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link RetievalPerFilterSearchResult}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link RetievalPerFilterSearchResult} + */ + @Nonnull + public RetievalPerFilterSearchResult addResultsItem( + @Nonnull final RetievalDataRepositorySearchResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link RetievalPerFilterSearchResult} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link RetievalPerFilterSearchResult} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetievalPerFilterSearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetievalPerFilterSearchResult} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalPerFilterSearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalPerFilterSearchResult} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalPerFilterSearchResult retievalPerFilterSearchResult = + (RetievalPerFilterSearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, retievalPerFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, retievalPerFilterSearchResult.filterId) + && Objects.equals(this.results, retievalPerFilterSearchResult.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalPerFilterSearchResult {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetievalPerFilterSearchResult} instance with all required arguments. + */ + public static Builder builder() { + return (filterId) -> () -> new RetievalPerFilterSearchResult().filterId(filterId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + * @return The RetievalPerFilterSearchResult instance. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link RetievalPerFilterSearchResult} instance. + * + * @return The RetievalPerFilterSearchResult instance. + */ + RetievalPerFilterSearchResult build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java b/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java new file mode 100644 index 000000000..0cc2b13be --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalPerFilterSearchResultWithError */ +// CHECKSTYLE:OFF +public class RetievalPerFilterSearchResultWithError +// CHECKSTYLE:ON +{ + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalPerFilterSearchResultWithError. */ + private RetievalPerFilterSearchResultWithError() {} + + /** + * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance and return the + * same instance. + * + * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + * @return The same instance of this {@link RetievalPerFilterSearchResultWithError} class + */ + @Nonnull + public RetievalPerFilterSearchResultWithError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link RetievalPerFilterSearchResultWithError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. + * + * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetievalPerFilterSearchResultWithError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * RetievalPerFilterSearchResultWithError} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalPerFilterSearchResultWithError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalPerFilterSearchResultWithError} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalPerFilterSearchResultWithError retievalPerFilterSearchResultWithError = + (RetievalPerFilterSearchResultWithError) o; + return Objects.equals( + this.cloudSdkCustomFields, retievalPerFilterSearchResultWithError.cloudSdkCustomFields) + && Objects.equals(this.message, retievalPerFilterSearchResultWithError.message); + } + + @Override + public int hashCode() { + return Objects.hash(message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalPerFilterSearchResultWithError {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetievalPerFilterSearchResultWithError} instance with all required arguments. + */ + public static Builder builder() { + return (message) -> () -> new RetievalPerFilterSearchResultWithError().message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. + * + * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + * @return The RetievalPerFilterSearchResultWithError instance. + */ + Builder1 message(@Nonnull final String message); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link RetievalPerFilterSearchResultWithError} instance. + * + * @return The RetievalPerFilterSearchResultWithError instance. + */ + RetievalPerFilterSearchResultWithError build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java b/grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java new file mode 100644 index 000000000..6dfb0b111 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.ResultsInner1; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetievalSearchResults */ +// CHECKSTYLE:OFF +public class RetievalSearchResults +// CHECKSTYLE:ON +{ + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetievalSearchResults. */ + private RetievalSearchResults() {} + + /** + * Set the results of this {@link RetievalSearchResults} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link RetievalSearchResults} class + */ + @Nonnull + public RetievalSearchResults results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link RetievalSearchResults}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link RetievalSearchResults} + */ + @Nonnull + public RetievalSearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link RetievalSearchResults} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link RetievalSearchResults} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetievalSearchResults}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetievalSearchResults} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetievalSearchResults has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetievalSearchResults} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetievalSearchResults retievalSearchResults = (RetievalSearchResults) o; + return Objects.equals(this.cloudSdkCustomFields, retievalSearchResults.cloudSdkCustomFields) + && Objects.equals(this.results, retievalSearchResults.results); + } + + @Override + public int hashCode() { + return Objects.hash(results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetievalSearchResults {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetievalSearchResults} + * instance with all required arguments. + */ + public static Builder builder() { + return (results) -> () -> new RetievalSearchResults().results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the results of this {@link RetievalSearchResults} instance. + * + * @param results List of returned results. + * @return The RetievalSearchResults instance. + */ + Builder1 results(@Nonnull final List results); + + /** + * Set the results of this {@link RetievalSearchResults} instance. + * + * @param results List of returned results. + * @return The RetievalSearchResults instance. + */ + default Builder1 results(@Nonnull final ResultsInner1... results) { + return results(Arrays.asList(results)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link RetievalSearchResults} instance. + * + * @return The RetievalSearchResults instance. + */ + RetievalSearchResults build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java b/grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java new file mode 100644 index 000000000..ad2dc2271 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Chunk; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalDocument */ +// CHECKSTYLE:OFF +public class RetrievalDocument +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonProperty("chunks") + private List chunks = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalDocument. */ + private RetrievalDocument() {} + + /** + * Set the id of this {@link RetrievalDocument} instance and return the same instance. + * + * @param id The id of this {@link RetrievalDocument} + * @return The same instance of this {@link RetrievalDocument} class + */ + @Nonnull + public RetrievalDocument id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link RetrievalDocument} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link RetrievalDocument} instance. + * + * @param id The id of this {@link RetrievalDocument} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the metadata of this {@link RetrievalDocument} instance and return the same instance. + * + * @param metadata The metadata of this {@link RetrievalDocument} + * @return The same instance of this {@link RetrievalDocument} class + */ + @Nonnull + public RetrievalDocument metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link RetrievalDocument}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link RetrievalDocument} + */ + @Nonnull + public RetrievalDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link RetrievalDocument} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link RetrievalDocument} instance. + * + * @param metadata The metadata of this {@link RetrievalDocument} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Set the chunks of this {@link RetrievalDocument} instance and return the same instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + * @return The same instance of this {@link RetrievalDocument} class + */ + @Nonnull + public RetrievalDocument chunks(@Nonnull final List chunks) { + this.chunks = chunks; + return this; + } + + /** + * Add one chunks instance to this {@link RetrievalDocument}. + * + * @param chunksItem The chunks that should be added + * @return The same instance of type {@link RetrievalDocument} + */ + @Nonnull + public RetrievalDocument addChunksItem(@Nonnull final Chunk chunksItem) { + if (this.chunks == null) { + this.chunks = new ArrayList<>(); + } + this.chunks.add(chunksItem); + return this; + } + + /** + * Get chunks + * + * @return chunks The chunks of this {@link RetrievalDocument} instance. + */ + @Nonnull + public List getChunks() { + return chunks; + } + + /** + * Set the chunks of this {@link RetrievalDocument} instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + */ + public void setChunks(@Nonnull final List chunks) { + this.chunks = chunks; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalDocument}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalDocument} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("RetrievalDocument has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetrievalDocument} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalDocument retrievalDocument = (RetrievalDocument) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalDocument.cloudSdkCustomFields) + && Objects.equals(this.id, retrievalDocument.id) + && Objects.equals(this.metadata, retrievalDocument.metadata) + && Objects.equals(this.chunks, retrievalDocument.chunks); + } + + @Override + public int hashCode() { + return Objects.hash(id, metadata, chunks, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalDocument {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalDocument} + * instance with all required arguments. + */ + public static Builder builder() { + return (id) -> (chunks) -> () -> new RetrievalDocument().id(id).chunks(chunks); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link RetrievalDocument} instance. + * + * @param id The id of this {@link RetrievalDocument} + * @return The RetrievalDocument builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the chunks of this {@link RetrievalDocument} instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + * @return The RetrievalDocument instance. + */ + Builder2 chunks(@Nonnull final List chunks); + + /** + * Set the chunks of this {@link RetrievalDocument} instance. + * + * @param chunks The chunks of this {@link RetrievalDocument} + * @return The RetrievalDocument instance. + */ + default Builder2 chunks(@Nonnull final Chunk... chunks) { + return chunks(Arrays.asList(chunks)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link RetrievalDocument} instance. + * + * @return The RetrievalDocument instance. + */ + RetrievalDocument build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java new file mode 100644 index 000000000..52854207f --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java @@ -0,0 +1,520 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositoryType; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchConfiguration; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchDocumentKeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Limit scope of search to certain DataRepositories, Documents or Chunks. */ +// CHECKSTYLE:OFF +public class RetrievalSearchFilter +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("searchConfiguration") + private SearchConfiguration searchConfiguration; + + @JsonProperty("dataRepositories") + private List dataRepositories = new ArrayList<>(Arrays.asList("*")); + + @JsonProperty("dataRepositoryType") + private DataRepositoryType dataRepositoryType; + + @JsonProperty("dataRepositoryMetadata") + private List dataRepositoryMetadata = new ArrayList<>(); + + @JsonProperty("documentMetadata") + private List documentMetadata = new ArrayList<>(); + + @JsonProperty("chunkMetadata") + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchFilter. */ + private RetrievalSearchFilter() {} + + /** + * Set the id of this {@link RetrievalSearchFilter} instance and return the same instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link RetrievalSearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the searchConfiguration of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter searchConfiguration( + @Nullable final SearchConfiguration searchConfiguration) { + this.searchConfiguration = searchConfiguration; + return this; + } + + /** + * Get searchConfiguration + * + * @return searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} + * instance. + */ + @Nonnull + public SearchConfiguration getSearchConfiguration() { + return searchConfiguration; + } + + /** + * Set the searchConfiguration of this {@link RetrievalSearchFilter} instance. + * + * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} + */ + public void setSearchConfiguration(@Nullable final SearchConfiguration searchConfiguration) { + this.searchConfiguration = searchConfiguration; + } + + /** + * Set the dataRepositories of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a + * specific list of DataRepository ids. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter dataRepositories(@Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + return this; + } + + /** + * Add one dataRepositories instance to this {@link RetrievalSearchFilter}. + * + * @param dataRepositoriesItem The dataRepositories that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addDataRepositoriesItem(@Nonnull final String dataRepositoriesItem) { + if (this.dataRepositories == null) { + this.dataRepositories = new ArrayList<>(Arrays.asList("*")); + } + this.dataRepositories.add(dataRepositoriesItem); + return this; + } + + /** + * Specify ['*'] to search across all DataRepositories or give a specific list of + * DataRepository ids. + * + * @return dataRepositories The dataRepositories of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public List getDataRepositories() { + return dataRepositories; + } + + /** + * Set the dataRepositories of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a + * specific list of DataRepository ids. + */ + public void setDataRepositories(@Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + } + + /** + * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter dataRepositoryType( + @Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + return this; + } + + /** + * Get dataRepositoryType + * + * @return dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + * instance. + */ + @Nullable + public DataRepositoryType getDataRepositoryType() { + return dataRepositoryType; + } + + /** + * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + */ + public void setDataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + } + + /** + * Set the dataRepositoryMetadata of this {@link RetrievalSearchFilter} instance and return the + * same instance. + * + * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those + * annotated with the given metadata. Useful when combined with + * dataRepositories=['*'] + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter dataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + return this; + } + + /** + * Add one dataRepositoryMetadata instance to this {@link RetrievalSearchFilter}. + * + * @param dataRepositoryMetadataItem The dataRepositoryMetadata that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addDataRepositoryMetadataItem( + @Nonnull final KeyValueListPair dataRepositoryMetadataItem) { + if (this.dataRepositoryMetadata == null) { + this.dataRepositoryMetadata = new ArrayList<>(); + } + this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); + return this; + } + + /** + * Restrict DataRepositories considered during search to those annotated with the given metadata. + * Useful when combined with dataRepositories=['*'] + * + * @return dataRepositoryMetadata The dataRepositoryMetadata of this {@link RetrievalSearchFilter} + * instance. + */ + @Nonnull + public List getDataRepositoryMetadata() { + return dataRepositoryMetadata; + } + + /** + * Set the dataRepositoryMetadata of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those + * annotated with the given metadata. Useful when combined with + * dataRepositories=['*'] + */ + public void setDataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + } + + /** + * Set the documentMetadata of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link RetrievalSearchFilter}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addDocumentMetadataItem( + @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { + if (this.documentMetadata == null) { + this.documentMetadata = new ArrayList<>(); + } + this.documentMetadata.add(documentMetadataItem); + return this; + } + + /** + * Restrict documents considered during search to those annotated with the given metadata. + * + * @return documentMetadata The documentMetadata of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link RetrievalSearchFilter} instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + */ + public void setDocumentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link RetrievalSearchFilter} instance and return the same + * instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link RetrievalSearchFilter} class + */ + @Nonnull + public RetrievalSearchFilter chunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link RetrievalSearchFilter}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link RetrievalSearchFilter} + */ + @Nonnull + public RetrievalSearchFilter addChunkMetadataItem( + @Nonnull final KeyValueListPair chunkMetadataItem) { + if (this.chunkMetadata == null) { + this.chunkMetadata = new ArrayList<>(); + } + this.chunkMetadata.add(chunkMetadataItem); + return this; + } + + /** + * Restrict chunks considered during search to those with the given metadata. + * + * @return chunkMetadata The chunkMetadata of this {@link RetrievalSearchFilter} instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link RetrievalSearchFilter} instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalSearchFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalSearchFilter} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalSearchFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchFilter} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalSearchFilter retrievalSearchFilter = (RetrievalSearchFilter) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalSearchFilter.cloudSdkCustomFields) + && Objects.equals(this.id, retrievalSearchFilter.id) + && Objects.equals(this.searchConfiguration, retrievalSearchFilter.searchConfiguration) + && Objects.equals(this.dataRepositories, retrievalSearchFilter.dataRepositories) + && Objects.equals(this.dataRepositoryType, retrievalSearchFilter.dataRepositoryType) + && Objects.equals(this.dataRepositoryMetadata, retrievalSearchFilter.dataRepositoryMetadata) + && Objects.equals(this.documentMetadata, retrievalSearchFilter.documentMetadata) + && Objects.equals(this.chunkMetadata, retrievalSearchFilter.chunkMetadata); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + searchConfiguration, + dataRepositories, + dataRepositoryType, + dataRepositoryMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchFilter {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" searchConfiguration: ") + .append(toIndentedString(searchConfiguration)) + .append("\n"); + sb.append(" dataRepositories: ").append(toIndentedString(dataRepositories)).append("\n"); + sb.append(" dataRepositoryType: ").append(toIndentedString(dataRepositoryType)).append("\n"); + sb.append(" dataRepositoryMetadata: ") + .append(toIndentedString(dataRepositoryMetadata)) + .append("\n"); + sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); + sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchFilter} + * instance with all required arguments. + */ + public static Builder builder() { + return (id) -> + (dataRepositoryType) -> + () -> new RetrievalSearchFilter().id(id).dataRepositoryType(dataRepositoryType); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link RetrievalSearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The RetrievalSearchFilter builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} + * @return The RetrievalSearchFilter instance. + */ + Builder2 dataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link RetrievalSearchFilter} instance. + * + * @return The RetrievalSearchFilter instance. + */ + RetrievalSearchFilter build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java b/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java new file mode 100644 index 000000000..396e01ff7 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetrievalSearchFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalSearchInput */ +// CHECKSTYLE:OFF +public class RetrievalSearchInput +// CHECKSTYLE:ON +{ + @JsonProperty("query") + private String query; + + @JsonProperty("filters") + private List filters = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchInput. */ + private RetrievalSearchInput() {} + + /** + * Set the query of this {@link RetrievalSearchInput} instance and return the same instance. + * + * @param query Query string + * @return The same instance of this {@link RetrievalSearchInput} class + */ + @Nonnull + public RetrievalSearchInput query(@Nonnull final String query) { + this.query = query; + return this; + } + + /** + * Query string + * + * @return query The query of this {@link RetrievalSearchInput} instance. + */ + @Nonnull + public String getQuery() { + return query; + } + + /** + * Set the query of this {@link RetrievalSearchInput} instance. + * + * @param query Query string + */ + public void setQuery(@Nonnull final String query) { + this.query = query; + } + + /** + * Set the filters of this {@link RetrievalSearchInput} instance and return the same instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The same instance of this {@link RetrievalSearchInput} class + */ + @Nonnull + public RetrievalSearchInput filters(@Nonnull final List filters) { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link RetrievalSearchInput}. + * + * @param filtersItem The filters that should be added + * @return The same instance of type {@link RetrievalSearchInput} + */ + @Nonnull + public RetrievalSearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Get filters + * + * @return filters The filters of this {@link RetrievalSearchInput} instance. + */ + @Nonnull + public List getFilters() { + return filters; + } + + /** + * Set the filters of this {@link RetrievalSearchInput} instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + */ + public void setFilters(@Nonnull final List filters) { + this.filters = filters; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalSearchInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalSearchInput} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalSearchInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchInput} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalSearchInput retrievalSearchInput = (RetrievalSearchInput) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalSearchInput.cloudSdkCustomFields) + && Objects.equals(this.query, retrievalSearchInput.query) + && Objects.equals(this.filters, retrievalSearchInput.filters); + } + + @Override + public int hashCode() { + return Objects.hash(query, filters, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchInput {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchInput} + * instance with all required arguments. + */ + public static Builder builder() { + return (query) -> (filters) -> () -> new RetrievalSearchInput().query(query).filters(filters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the query of this {@link RetrievalSearchInput} instance. + * + * @param query Query string + * @return The RetrievalSearchInput builder. + */ + Builder1 query(@Nonnull final String query); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the filters of this {@link RetrievalSearchInput} instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The RetrievalSearchInput instance. + */ + Builder2 filters(@Nonnull final List filters); + + /** + * Set the filters of this {@link RetrievalSearchInput} instance. + * + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The RetrievalSearchInput instance. + */ + default Builder2 filters(@Nonnull final RetrievalSearchFilter... filters) { + return filters(Arrays.asList(filters)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link RetrievalSearchInput} instance. + * + * @return The RetrievalSearchInput instance. + */ + RetrievalSearchInput build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java b/grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java new file mode 100644 index 000000000..c95706529 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchConfiguration */ +// CHECKSTYLE:OFF +public class SearchConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("maxChunkCount") + private Integer maxChunkCount; + + @JsonProperty("maxDocumentCount") + private Integer maxDocumentCount; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchConfiguration. */ + private SearchConfiguration() {} + + /** + * Set the maxChunkCount of this {@link SearchConfiguration} instance and return the same + * instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 Maximum: 0 + * @return The same instance of this {@link SearchConfiguration} class + */ + @Nonnull + public SearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + return this; + } + + /** + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + * minimum: 0 maximum: 0 + * + * @return maxChunkCount The maxChunkCount of this {@link SearchConfiguration} instance. + */ + @Nonnull + public Integer getMaxChunkCount() { + return maxChunkCount; + } + + /** + * Set the maxChunkCount of this {@link SearchConfiguration} instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 Maximum: 0 + */ + public void setMaxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + } + + /** + * Set the maxDocumentCount of this {@link SearchConfiguration} instance and return the same + * instance. + * + * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of + * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount + * is given, then only one chunk per document is returned. Minimum: 0 Maximum: 0 + * @return The same instance of this {@link SearchConfiguration} class + */ + @Nonnull + public SearchConfiguration maxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + return this; + } + + /** + * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be + * returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only + * one chunk per document is returned. minimum: 0 maximum: 0 + * + * @return maxDocumentCount The maxDocumentCount of this {@link SearchConfiguration} instance. + */ + @Nonnull + public Integer getMaxDocumentCount() { + return maxDocumentCount; + } + + /** + * Set the maxDocumentCount of this {@link SearchConfiguration} instance. + * + * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of + * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount + * is given, then only one chunk per document is returned. Minimum: 0 Maximum: 0 + */ + public void setMaxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchConfiguration} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "SearchConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchConfiguration} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchConfiguration searchConfiguration = (SearchConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, searchConfiguration.cloudSdkCustomFields) + && Objects.equals(this.maxChunkCount, searchConfiguration.maxChunkCount) + && Objects.equals(this.maxDocumentCount, searchConfiguration.maxDocumentCount); + } + + @Override + public int hashCode() { + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchConfiguration {\n"); + sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); + sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link SearchConfiguration} instance. No arguments are required. */ + public static SearchConfiguration builder() { + return new SearchConfiguration(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java new file mode 100644 index 000000000..6e46c723e --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchSelectOptionEnum; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchDocumentKeyValueListPair */ +// CHECKSTYLE:OFF +public class SearchDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonProperty("selectMode") + private List selectMode = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchDocumentKeyValueListPair. */ + private SearchDocumentKeyValueListPair() {} + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param selectMode Select mode for search filters + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair selectMode( + @Nullable final List selectMode) { + this.selectMode = selectMode; + return this; + } + + /** + * Add one selectMode instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param selectModeItem The selectMode that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addSelectModeItem( + @Nonnull final SearchSelectOptionEnum selectModeItem) { + if (this.selectMode == null) { + this.selectMode = new ArrayList<>(); + } + this.selectMode.add(selectModeItem); + return this; + } + + /** + * Select mode for search filters + * + * @return selectMode The selectMode of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getSelectMode() { + return selectMode; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param selectMode Select mode for search filters + */ + public void setSelectMode(@Nullable final List selectMode) { + this.selectMode = selectMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} + * instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "SearchDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = + (SearchDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, searchDocumentKeyValueListPair.key) + && Objects.equals(this.value, searchDocumentKeyValueListPair.value) + && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, selectMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchDocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * SearchDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder builder() { + return (key) -> (value) -> () -> new SearchDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair instance. + */ + Builder2 value(@Nonnull final List value); + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair instance. + */ + default Builder2 value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link SearchDocumentKeyValueListPair} instance. + * + * @return The SearchDocumentKeyValueListPair instance. + */ + SearchDocumentKeyValueListPair build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchFilter.java b/grounding/src/main/resources/openapi/grounding/model/SearchFilter.java new file mode 100644 index 000000000..03fd1db7c --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/SearchFilter.java @@ -0,0 +1,485 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchConfiguration; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchDocumentKeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchFilter */ +// CHECKSTYLE:OFF +public class SearchFilter +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("collectionIds") + private List collectionIds = new ArrayList<>(); + + @JsonProperty("configuration") + private SearchConfiguration _configuration; + + @JsonProperty("collectionMetadata") + private List collectionMetadata = new ArrayList<>(); + + @JsonProperty("documentMetadata") + private List documentMetadata = new ArrayList<>(); + + @JsonProperty("chunkMetadata") + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchFilter. */ + private SearchFilter() {} + + /** + * Set the id of this {@link SearchFilter} instance and return the same instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link SearchFilter} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link SearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the collectionIds of this {@link SearchFilter} instance and return the same instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter collectionIds(@Nonnull final List collectionIds) { + this.collectionIds = collectionIds; + return this; + } + + /** + * Add one collectionIds instance to this {@link SearchFilter}. + * + * @param collectionIdsItem The collectionIds that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addCollectionIdsItem(@Nonnull final String collectionIdsItem) { + if (this.collectionIds == null) { + this.collectionIds = new ArrayList<>(); + } + this.collectionIds.add(collectionIdsItem); + return this; + } + + /** + * Get collectionIds + * + * @return collectionIds The collectionIds of this {@link SearchFilter} instance. + */ + @Nonnull + public List getCollectionIds() { + return collectionIds; + } + + /** + * Set the collectionIds of this {@link SearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + */ + public void setCollectionIds(@Nonnull final List collectionIds) { + this.collectionIds = collectionIds; + } + + /** + * Set the _configuration of this {@link SearchFilter} instance and return the same instance. + * + * @param _configuration The _configuration of this {@link SearchFilter} + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter _configuration(@Nonnull final SearchConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link SearchFilter} instance. + */ + @Nonnull + public SearchConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link SearchFilter} instance. + * + * @param _configuration The _configuration of this {@link SearchFilter} + */ + public void setConfiguration(@Nonnull final SearchConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Set the collectionMetadata of this {@link SearchFilter} instance and return the same instance. + * + * @param collectionMetadata Restrict collections considered during search to those annotated with + * the given metadata. Useful when combined with collections=['*'] + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter collectionMetadata( + @Nullable final List collectionMetadata) { + this.collectionMetadata = collectionMetadata; + return this; + } + + /** + * Add one collectionMetadata instance to this {@link SearchFilter}. + * + * @param collectionMetadataItem The collectionMetadata that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addCollectionMetadataItem( + @Nonnull final KeyValueListPair collectionMetadataItem) { + if (this.collectionMetadata == null) { + this.collectionMetadata = new ArrayList<>(); + } + this.collectionMetadata.add(collectionMetadataItem); + return this; + } + + /** + * Restrict collections considered during search to those annotated with the given metadata. + * Useful when combined with collections=['*'] + * + * @return collectionMetadata The collectionMetadata of this {@link SearchFilter} instance. + */ + @Nonnull + public List getCollectionMetadata() { + return collectionMetadata; + } + + /** + * Set the collectionMetadata of this {@link SearchFilter} instance. + * + * @param collectionMetadata Restrict collections considered during search to those annotated with + * the given metadata. Useful when combined with collections=['*'] + */ + public void setCollectionMetadata(@Nullable final List collectionMetadata) { + this.collectionMetadata = collectionMetadata; + } + + /** + * Set the documentMetadata of this {@link SearchFilter} instance and return the same instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link SearchFilter}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addDocumentMetadataItem( + @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { + if (this.documentMetadata == null) { + this.documentMetadata = new ArrayList<>(); + } + this.documentMetadata.add(documentMetadataItem); + return this; + } + + /** + * Restrict documents considered during search to those annotated with the given metadata. + * + * @return documentMetadata The documentMetadata of this {@link SearchFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link SearchFilter} instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + */ + public void setDocumentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link SearchFilter} instance and return the same instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link SearchFilter} class + */ + @Nonnull + public SearchFilter chunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link SearchFilter}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link SearchFilter} + */ + @Nonnull + public SearchFilter addChunkMetadataItem(@Nonnull final KeyValueListPair chunkMetadataItem) { + if (this.chunkMetadata == null) { + this.chunkMetadata = new ArrayList<>(); + } + this.chunkMetadata.add(chunkMetadataItem); + return this; + } + + /** + * Restrict chunks considered during search to those with the given metadata. + * + * @return chunkMetadata The chunkMetadata of this {@link SearchFilter} instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link SearchFilter} instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchFilter} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("SearchFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchFilter} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchFilter searchFilter = (SearchFilter) o; + return Objects.equals(this.cloudSdkCustomFields, searchFilter.cloudSdkCustomFields) + && Objects.equals(this.id, searchFilter.id) + && Objects.equals(this.collectionIds, searchFilter.collectionIds) + && Objects.equals(this._configuration, searchFilter._configuration) + && Objects.equals(this.collectionMetadata, searchFilter.collectionMetadata) + && Objects.equals(this.documentMetadata, searchFilter.documentMetadata) + && Objects.equals(this.chunkMetadata, searchFilter.chunkMetadata); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + collectionIds, + _configuration, + collectionMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchFilter {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" collectionMetadata: ").append(toIndentedString(collectionMetadata)).append("\n"); + sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); + sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link SearchFilter} instance + * with all required arguments. + */ + public static Builder builder() { + return (id) -> + (collectionIds) -> + (_configuration) -> + () -> + new SearchFilter() + .id(id) + .collectionIds(collectionIds) + ._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link SearchFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The SearchFilter builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the collectionIds of this {@link SearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + * @return The SearchFilter builder. + */ + Builder2 collectionIds(@Nonnull final List collectionIds); + + /** + * Set the collectionIds of this {@link SearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link SearchFilter} + * @return The SearchFilter builder. + */ + default Builder2 collectionIds(@Nonnull final String... collectionIds) { + return collectionIds(Arrays.asList(collectionIds)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the _configuration of this {@link SearchFilter} instance. + * + * @param _configuration The _configuration of this {@link SearchFilter} + * @return The SearchFilter instance. + */ + Builder3 _configuration(@Nonnull final SearchConfiguration _configuration); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link SearchFilter} instance. + * + * @return The SearchFilter instance. + */ + SearchFilter build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchResults.java b/grounding/src/main/resources/openapi/grounding/model/SearchResults.java new file mode 100644 index 000000000..06e18ecc6 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/SearchResults.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.ResultsInner; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchResults */ +// CHECKSTYLE:OFF +public class SearchResults +// CHECKSTYLE:ON +{ + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchResults. */ + private SearchResults() {} + + /** + * Set the results of this {@link SearchResults} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link SearchResults} class + */ + @Nonnull + public SearchResults results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link SearchResults}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link SearchResults} + */ + @Nonnull + public SearchResults addResultsItem(@Nonnull final ResultsInner resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link SearchResults} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link SearchResults} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchResults}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchResults} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("SearchResults has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchResults} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SearchResults searchResults = (SearchResults) o; + return Objects.equals(this.cloudSdkCustomFields, searchResults.cloudSdkCustomFields) + && Objects.equals(this.results, searchResults.results); + } + + @Override + public int hashCode() { + return Objects.hash(results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchResults {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link SearchResults} instance + * with all required arguments. + */ + public static Builder builder() { + return (results) -> () -> new SearchResults().results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the results of this {@link SearchResults} instance. + * + * @param results List of returned results. + * @return The SearchResults instance. + */ + Builder1 results(@Nonnull final List results); + + /** + * Set the results of this {@link SearchResults} instance. + * + * @param results List of returned results. + * @return The SearchResults instance. + */ + default Builder1 results(@Nonnull final ResultsInner... results) { + return results(Arrays.asList(results)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Finalize the builder for new {@link SearchResults} instance. + * + * @return The SearchResults instance. + */ + SearchResults build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java b/grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java new file mode 100644 index 000000000..eb0a2e5be --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets SearchSelectOptionEnum */ +public enum SearchSelectOptionEnum { + IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"); + + private final String value; + + SearchSelectOptionEnum(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static SearchSelectOptionEnum fromValue(@Nonnull final String value) { + for (final SearchSelectOptionEnum b : SearchSelectOptionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java new file mode 100644 index 000000000..44f2b4581 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TextOnlyBaseChunk */ +// CHECKSTYLE:OFF +public class TextOnlyBaseChunk +// CHECKSTYLE:ON +{ + @JsonProperty("content") + private String content; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TextOnlyBaseChunk. */ + private TextOnlyBaseChunk() {} + + /** + * Set the content of this {@link TextOnlyBaseChunk} instance and return the same instance. + * + * @param content The content of this {@link TextOnlyBaseChunk} + * @return The same instance of this {@link TextOnlyBaseChunk} class + */ + @Nonnull + public TextOnlyBaseChunk content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link TextOnlyBaseChunk} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link TextOnlyBaseChunk} instance. + * + * @param content The content of this {@link TextOnlyBaseChunk} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + * @return The same instance of this {@link TextOnlyBaseChunk} class + */ + @Nonnull + public TextOnlyBaseChunk metadata(@Nonnull final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link TextOnlyBaseChunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link TextOnlyBaseChunk} + */ + @Nonnull + public TextOnlyBaseChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link TextOnlyBaseChunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + */ + public void setMetadata(@Nonnull final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link TextOnlyBaseChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TextOnlyBaseChunk} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("TextOnlyBaseChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TextOnlyBaseChunk} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final TextOnlyBaseChunk textOnlyBaseChunk = (TextOnlyBaseChunk) o; + return Objects.equals(this.cloudSdkCustomFields, textOnlyBaseChunk.cloudSdkCustomFields) + && Objects.equals(this.content, textOnlyBaseChunk.content) + && Objects.equals(this.metadata, textOnlyBaseChunk.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(content, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TextOnlyBaseChunk {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link TextOnlyBaseChunk} + * instance with all required arguments. + */ + public static Builder builder() { + return (content) -> + (metadata) -> () -> new TextOnlyBaseChunk().content(content).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the content of this {@link TextOnlyBaseChunk} instance. + * + * @param content The content of this {@link TextOnlyBaseChunk} + * @return The TextOnlyBaseChunk builder. + */ + Builder1 content(@Nonnull final String content); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + * @return The TextOnlyBaseChunk instance. + */ + Builder2 metadata(@Nonnull final List metadata); + + /** + * Set the metadata of this {@link TextOnlyBaseChunk} instance. + * + * @param metadata The metadata of this {@link TextOnlyBaseChunk} + * @return The TextOnlyBaseChunk instance. + */ + default Builder2 metadata(@Nonnull final KeyValueListPair... metadata) { + return metadata(Arrays.asList(metadata)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link TextOnlyBaseChunk} instance. + * + * @return The TextOnlyBaseChunk instance. + */ + TextOnlyBaseChunk build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java b/grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java new file mode 100644 index 000000000..612fdde50 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TextSearchRequest */ +// CHECKSTYLE:OFF +public class TextSearchRequest +// CHECKSTYLE:ON +{ + @JsonProperty("query") + private String query; + + @JsonProperty("filters") + private List filters = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TextSearchRequest. */ + private TextSearchRequest() {} + + /** + * Set the query of this {@link TextSearchRequest} instance and return the same instance. + * + * @param query Query string + * @return The same instance of this {@link TextSearchRequest} class + */ + @Nonnull + public TextSearchRequest query(@Nonnull final String query) { + this.query = query; + return this; + } + + /** + * Query string + * + * @return query The query of this {@link TextSearchRequest} instance. + */ + @Nonnull + public String getQuery() { + return query; + } + + /** + * Set the query of this {@link TextSearchRequest} instance. + * + * @param query Query string + */ + public void setQuery(@Nonnull final String query) { + this.query = query; + } + + /** + * Set the filters of this {@link TextSearchRequest} instance and return the same instance. + * + * @param filters The filters of this {@link TextSearchRequest} + * @return The same instance of this {@link TextSearchRequest} class + */ + @Nonnull + public TextSearchRequest filters(@Nonnull final List filters) { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link TextSearchRequest}. + * + * @param filtersItem The filters that should be added + * @return The same instance of type {@link TextSearchRequest} + */ + @Nonnull + public TextSearchRequest addFiltersItem(@Nonnull final SearchFilter filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Get filters + * + * @return filters The filters of this {@link TextSearchRequest} instance. + */ + @Nonnull + public List getFilters() { + return filters; + } + + /** + * Set the filters of this {@link TextSearchRequest} instance. + * + * @param filters The filters of this {@link TextSearchRequest} + */ + public void setFilters(@Nonnull final List filters) { + this.filters = filters; + } + + /** + * Get the names of the unrecognizable properties of the {@link TextSearchRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TextSearchRequest} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("TextSearchRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TextSearchRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final TextSearchRequest textSearchRequest = (TextSearchRequest) o; + return Objects.equals(this.cloudSdkCustomFields, textSearchRequest.cloudSdkCustomFields) + && Objects.equals(this.query, textSearchRequest.query) + && Objects.equals(this.filters, textSearchRequest.filters); + } + + @Override + public int hashCode() { + return Objects.hash(query, filters, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TextSearchRequest {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link TextSearchRequest} + * instance with all required arguments. + */ + public static Builder builder() { + return (query) -> (filters) -> () -> new TextSearchRequest().query(query).filters(filters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the query of this {@link TextSearchRequest} instance. + * + * @param query Query string + * @return The TextSearchRequest builder. + */ + Builder1 query(@Nonnull final String query); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the filters of this {@link TextSearchRequest} instance. + * + * @param filters The filters of this {@link TextSearchRequest} + * @return The TextSearchRequest instance. + */ + Builder2 filters(@Nonnull final List filters); + + /** + * Set the filters of this {@link TextSearchRequest} instance. + * + * @param filters The filters of this {@link TextSearchRequest} + * @return The TextSearchRequest instance. + */ + default Builder2 filters(@Nonnull final SearchFilter... filters) { + return filters(Arrays.asList(filters)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Finalize the builder for new {@link TextSearchRequest} instance. + * + * @return The TextSearchRequest instance. + */ + TextSearchRequest build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java b/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java new file mode 100644 index 000000000..cee3744b5 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** VectorV1VectorEndpointsGetCollectionCreationStatus200Response */ +// CHECKSTYLE:OFF +public class VectorV1VectorEndpointsGetCollectionCreationStatus200Response +// CHECKSTYLE:ON +{ + @JsonProperty("collectionURL") + private String collectionURL; + + @JsonProperty("status") + private String status; + + @JsonProperty("Location") + private URI location; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorV1VectorEndpointsGetCollectionCreationStatus200Response. */ + private VectorV1VectorEndpointsGetCollectionCreationStatus200Response() {} + + /** + * Set the collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance and return the same + * instance. + * + * @param collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * @return The same instance of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} class + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response collectionURL( + @Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + return this; + } + + /** + * Get collectionURL + * + * @return collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + */ + @Nonnull + public String getCollectionURL() { + return collectionURL; + } + + /** + * Set the collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + * + * @param collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + */ + public void setCollectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + } + + /** + * Set the status of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * instance and return the same instance. + * + * @param status The status of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * @return The same instance of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} class + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response status( + @Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * instance. + * + * @param status The status of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Set the location of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * instance and return the same instance. + * + * @param location The location of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * @return The same instance of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} class + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response location( + @Nonnull final URI location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location The location of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + */ + @Nonnull + public URI getLocation() { + return location; + } + + /** + * Set the location of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * instance. + * + * @param location The location of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + */ + public void setLocation(@Nonnull final URI location) { + this.location = location; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "VectorV1VectorEndpointsGetCollectionCreationStatus200Response has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final VectorV1VectorEndpointsGetCollectionCreationStatus200Response + vectorV1VectorEndpointsGetCollectionCreationStatus200Response = + (VectorV1VectorEndpointsGetCollectionCreationStatus200Response) o; + return Objects.equals( + this.cloudSdkCustomFields, + vectorV1VectorEndpointsGetCollectionCreationStatus200Response.cloudSdkCustomFields) + && Objects.equals( + this.collectionURL, + vectorV1VectorEndpointsGetCollectionCreationStatus200Response.collectionURL) + && Objects.equals( + this.status, vectorV1VectorEndpointsGetCollectionCreationStatus200Response.status) + && Objects.equals( + this.location, vectorV1VectorEndpointsGetCollectionCreationStatus200Response.location); + } + + @Override + public int hashCode() { + return Objects.hash(collectionURL, status, location, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorV1VectorEndpointsGetCollectionCreationStatus200Response {\n"); + sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance with all required + * arguments. + */ + public static Builder builder() { + return (collectionURL) -> + (status) -> + (location) -> + () -> + new VectorV1VectorEndpointsGetCollectionCreationStatus200Response() + .collectionURL(collectionURL) + .status(status) + .location(location); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + * + * @param collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response builder. + */ + Builder1 collectionURL(@Nonnull final String collectionURL); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * instance. + * + * @param status The status of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response builder. + */ + Builder2 status(@Nonnull final String status); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the location of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + * + * @param location The location of this {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} + * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response instance. + */ + Builder3 location(@Nonnull final URI location); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link + * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. + * + * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response instance. + */ + VectorV1VectorEndpointsGetCollectionCreationStatus200Response build(); + } +} diff --git a/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java b/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java new file mode 100644 index 000000000..53d028ee2 --- /dev/null +++ b/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Document Grounding Pipeline API + * SAP AI Core - API Specification AI Data Management api's + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** VectorV1VectorEndpointsGetCollectionDeletionStatus200Response */ +// CHECKSTYLE:OFF +public class VectorV1VectorEndpointsGetCollectionDeletionStatus200Response +// CHECKSTYLE:ON +{ + @JsonProperty("collectionURL") + private String collectionURL; + + @JsonProperty("status") + private String status; + + @JsonProperty("Location") + private URI location; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorV1VectorEndpointsGetCollectionDeletionStatus200Response. */ + private VectorV1VectorEndpointsGetCollectionDeletionStatus200Response() {} + + /** + * Set the collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance and return the same + * instance. + * + * @param collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * @return The same instance of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} class + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response collectionURL( + @Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + return this; + } + + /** + * Get collectionURL + * + * @return collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + */ + @Nonnull + public String getCollectionURL() { + return collectionURL; + } + + /** + * Set the collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + * + * @param collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + */ + public void setCollectionURL(@Nonnull final String collectionURL) { + this.collectionURL = collectionURL; + } + + /** + * Set the status of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * instance and return the same instance. + * + * @param status The status of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * @return The same instance of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} class + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response status( + @Nonnull final String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + */ + @Nonnull + public String getStatus() { + return status; + } + + /** + * Set the status of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * instance. + * + * @param status The status of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + */ + public void setStatus(@Nonnull final String status) { + this.status = status; + } + + /** + * Set the location of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * instance and return the same instance. + * + * @param location The location of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * @return The same instance of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} class + */ + @Nonnull + public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response location( + @Nonnull final URI location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location The location of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + */ + @Nonnull + public URI getLocation() { + return location; + } + + /** + * Set the location of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * instance. + * + * @param location The location of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + */ + public void setLocation(@Nonnull final URI location) { + this.location = location; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "VectorV1VectorEndpointsGetCollectionDeletionStatus200Response has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final VectorV1VectorEndpointsGetCollectionDeletionStatus200Response + vectorV1VectorEndpointsGetCollectionDeletionStatus200Response = + (VectorV1VectorEndpointsGetCollectionDeletionStatus200Response) o; + return Objects.equals( + this.cloudSdkCustomFields, + vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.cloudSdkCustomFields) + && Objects.equals( + this.collectionURL, + vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.collectionURL) + && Objects.equals( + this.status, vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.status) + && Objects.equals( + this.location, vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.location); + } + + @Override + public int hashCode() { + return Objects.hash(collectionURL, status, location, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorV1VectorEndpointsGetCollectionDeletionStatus200Response {\n"); + sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance with all required + * arguments. + */ + public static Builder builder() { + return (collectionURL) -> + (status) -> + (location) -> + () -> + new VectorV1VectorEndpointsGetCollectionDeletionStatus200Response() + .collectionURL(collectionURL) + .status(status) + .location(location); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + * + * @param collectionURL The collectionURL of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response builder. + */ + Builder1 collectionURL(@Nonnull final String collectionURL); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the status of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * instance. + * + * @param status The status of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response builder. + */ + Builder2 status(@Nonnull final String status); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the location of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + * + * @param location The location of this {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} + * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response instance. + */ + Builder3 location(@Nonnull final URI location); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Finalize the builder for new {@link + * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. + * + * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response instance. + */ + VectorV1VectorEndpointsGetCollectionDeletionStatus200Response build(); + } +} diff --git a/grounding/src/main/resources/openapi/sample/api/OrdersApi.java b/grounding/src/main/resources/openapi/sample/api/OrdersApi.java new file mode 100644 index 000000000..fe69cd0bc --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/api/OrdersApi.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +package openapi.sample.api; + +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.sample.model.Order; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import java.util.List; +import javax.annotation.Nonnull; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * SodaStore API in version 1.0.0. + * + *

API for managing soda products and orders in SodaStore. + */ +public class OrdersApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the SodaStore API. + * + * @param httpDestination The destination that API should be used with + */ + public OrdersApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link + * ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public OrdersApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Create a new order + * + *

+ * + *

201 - The created order + * + * @param order The order details + * @return Order + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public Order ordersPost(@Nonnull final Order order) throws OpenApiRequestException { + final Object localVarPostBody = order; + + // verify the required parameter 'order' is set + if (order == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'order' when calling ordersPost"); + } + + final String localVarPath = UriComponentsBuilder.fromPath("/orders").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/resources/openapi/sample/api/SodasApi.java b/grounding/src/main/resources/openapi/sample/api/SodasApi.java new file mode 100644 index 000000000..7c573f934 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/api/SodasApi.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +package openapi.sample.api; + +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.sample.model.Soda; +import com.sap.cloud.sdk.datamodel.openapi.sample.model.SodaWithId; +import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * SodaStore API in version 1.0.0. + * + *

API for managing soda products and orders in SodaStore. + */ +public class SodasApi extends AbstractOpenApiService { + /** + * Instantiates this API class to invoke operations on the SodaStore API. + * + * @param httpDestination The destination that API should be used with + */ + public SodasApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link + * ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + @Beta + public SodasApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Get all soda products + * + *

+ * + *

200 - A list of soda products + * + * @return List<SodaWithId> + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public List sodasGet() throws OpenApiRequestException { + final Object localVarPostBody = null; + + final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; + + final ParameterizedTypeReference> localVarReturnType = + new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get a specific soda product by ID + * + *

+ * + *

200 - The soda product + * + *

404 - Soda product not found + * + * @param id ID of the soda product to retrieve + * @return SodaWithId + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public SodaWithId sodasIdGet(@Nonnull final Long id) throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'id' when calling sodasIdGet"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("id", id); + final String localVarPath = + UriComponentsBuilder.fromPath("/sodas/{id}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Update a specific soda product by ID + * + *

+ * + *

200 - The updated soda product + * + *

204 - Nothing has changed + * + *

404 - Soda product not found + * + * @param sodaWithId The updated soda product + * @return Soda + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nullable + public Soda sodasPut(@Nonnull final SodaWithId sodaWithId) throws OpenApiRequestException { + final Object localVarPostBody = sodaWithId; + + // verify the required parameter 'sodaWithId' is set + if (sodaWithId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'sodaWithId' when calling sodasPut"); + } + + final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.PUT, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/AllOf.java b/grounding/src/main/resources/openapi/sample/model/AllOf.java new file mode 100644 index 000000000..a14a9b6d4 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/AllOf.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AllOf */ +// CHECKSTYLE:OFF +public class AllOf +// CHECKSTYLE:ON +{ + @JsonProperty("sodaType") + private String sodaType; + + @JsonProperty("caffeine") + private Boolean caffeine; + + @JsonProperty("color") + private String color; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AllOf. */ + protected AllOf() {} + + /** + * Set the sodaType of this {@link AllOf} instance and return the same instance. + * + * @param sodaType The sodaType of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf sodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link AllOf} instance. + */ + @Nonnull + public String getSodaType() { + return sodaType; + } + + /** + * Set the sodaType of this {@link AllOf} instance. + * + * @param sodaType The sodaType of this {@link AllOf} + */ + public void setSodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + } + + /** + * Set the caffeine of this {@link AllOf} instance and return the same instance. + * + * @param caffeine The caffeine of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf caffeine(@Nullable final Boolean caffeine) { + this.caffeine = caffeine; + return this; + } + + /** + * Get caffeine + * + * @return caffeine The caffeine of this {@link AllOf} instance. + */ + @Nonnull + public Boolean isCaffeine() { + return caffeine; + } + + /** + * Set the caffeine of this {@link AllOf} instance. + * + * @param caffeine The caffeine of this {@link AllOf} + */ + public void setCaffeine(@Nullable final Boolean caffeine) { + this.caffeine = caffeine; + } + + /** + * Set the color of this {@link AllOf} instance and return the same instance. + * + * @param color The color of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf color(@Nullable final String color) { + this.color = color; + return this; + } + + /** + * Get color + * + * @return color The color of this {@link AllOf} instance. + */ + @Nonnull + public String getColor() { + return color; + } + + /** + * Set the color of this {@link AllOf} instance. + * + * @param color The color of this {@link AllOf} + */ + public void setColor(@Nullable final String color) { + this.color = color; + } + + /** + * Get the names of the unrecognizable properties of the {@link AllOf}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AllOf} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("AllOf has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AllOf allOf = (AllOf) o; + return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) + && Objects.equals(this.sodaType, allOf.sodaType) + && Objects.equals(this.caffeine, allOf.caffeine) + && Objects.equals(this.color, allOf.color); + } + + @Override + public int hashCode() { + return Objects.hash(sodaType, caffeine, color, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AllOf {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link AllOf} instance. No arguments are required. */ + public static AllOf create() { + return new AllOf(); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/AnyOf.java b/grounding/src/main/resources/openapi/sample/model/AnyOf.java new file mode 100644 index 000000000..c2bae78c2 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/AnyOf.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AnyOf */ +// CHECKSTYLE:OFF +public class AnyOf +// CHECKSTYLE:ON +{ + @JsonProperty("sodaType") + private String sodaType; + + @JsonProperty("caffeine") + private Boolean caffeine; + + @JsonProperty("color") + private String color; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AnyOf. */ + protected AnyOf() {} + + /** + * Set the sodaType of this {@link AnyOf} instance and return the same instance. + * + * @param sodaType The sodaType of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf sodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link AnyOf} instance. + */ + @Nonnull + public String getSodaType() { + return sodaType; + } + + /** + * Set the sodaType of this {@link AnyOf} instance. + * + * @param sodaType The sodaType of this {@link AnyOf} + */ + public void setSodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + } + + /** + * Set the caffeine of this {@link AnyOf} instance and return the same instance. + * + * @param caffeine The caffeine of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf caffeine(@Nullable final Boolean caffeine) { + this.caffeine = caffeine; + return this; + } + + /** + * Get caffeine + * + * @return caffeine The caffeine of this {@link AnyOf} instance. + */ + @Nonnull + public Boolean isCaffeine() { + return caffeine; + } + + /** + * Set the caffeine of this {@link AnyOf} instance. + * + * @param caffeine The caffeine of this {@link AnyOf} + */ + public void setCaffeine(@Nullable final Boolean caffeine) { + this.caffeine = caffeine; + } + + /** + * Set the color of this {@link AnyOf} instance and return the same instance. + * + * @param color The color of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf color(@Nullable final String color) { + this.color = color; + return this; + } + + /** + * Get color + * + * @return color The color of this {@link AnyOf} instance. + */ + @Nonnull + public String getColor() { + return color; + } + + /** + * Set the color of this {@link AnyOf} instance. + * + * @param color The color of this {@link AnyOf} + */ + public void setColor(@Nullable final String color) { + this.color = color; + } + + /** + * Get the names of the unrecognizable properties of the {@link AnyOf}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AnyOf} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("AnyOf has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AnyOf anyOf = (AnyOf) o; + return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) + && Objects.equals(this.sodaType, anyOf.sodaType) + && Objects.equals(this.caffeine, anyOf.caffeine) + && Objects.equals(this.color, anyOf.color); + } + + @Override + public int hashCode() { + return Objects.hash(sodaType, caffeine, color, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AnyOf {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link AnyOf} instance. No arguments are required. */ + public static AnyOf create() { + return new AnyOf(); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/Cola.java b/grounding/src/main/resources/openapi/sample/model/Cola.java new file mode 100644 index 000000000..c7d384cc1 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/Cola.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Cola */ +// CHECKSTYLE:OFF +public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping +// CHECKSTYLE:ON +{ + @JsonProperty("sodaType") + private String sodaType; + + @JsonProperty("caffeine") + private Boolean caffeine; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Cola. */ + protected Cola() {} + + /** + * Set the sodaType of this {@link Cola} instance and return the same instance. + * + * @param sodaType The sodaType of this {@link Cola} + * @return The same instance of this {@link Cola} class + */ + @Nonnull + public Cola sodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link Cola} instance. + */ + @Nonnull + public String getSodaType() { + return sodaType; + } + + /** + * Set the sodaType of this {@link Cola} instance. + * + * @param sodaType The sodaType of this {@link Cola} + */ + public void setSodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + } + + /** + * Set the caffeine of this {@link Cola} instance and return the same instance. + * + * @param caffeine The caffeine of this {@link Cola} + * @return The same instance of this {@link Cola} class + */ + @Nonnull + public Cola caffeine(@Nullable final Boolean caffeine) { + this.caffeine = caffeine; + return this; + } + + /** + * Get caffeine + * + * @return caffeine The caffeine of this {@link Cola} instance. + */ + @Nonnull + public Boolean isCaffeine() { + return caffeine; + } + + /** + * Set the caffeine of this {@link Cola} instance. + * + * @param caffeine The caffeine of this {@link Cola} + */ + public void setCaffeine(@Nullable final Boolean caffeine) { + this.caffeine = caffeine; + } + + /** + * Get the names of the unrecognizable properties of the {@link Cola}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Cola} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Cola has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a + * mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Cola cola = (Cola) o; + return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) + && Objects.equals(this.sodaType, cola.sodaType) + && Objects.equals(this.caffeine, cola.caffeine); + } + + @Override + public int hashCode() { + return Objects.hash(sodaType, caffeine, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Cola {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link Cola} instance. No arguments are required. */ + public static Cola create() { + return new Cola(); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/Fanta.java b/grounding/src/main/resources/openapi/sample/model/Fanta.java new file mode 100644 index 000000000..bebe50c21 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/Fanta.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Fanta */ +// CHECKSTYLE:OFF +public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping +// CHECKSTYLE:ON +{ + @JsonProperty("sodaType") + private String sodaType; + + @JsonProperty("color") + private String color; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Fanta. */ + protected Fanta() {} + + /** + * Set the sodaType of this {@link Fanta} instance and return the same instance. + * + * @param sodaType The sodaType of this {@link Fanta} + * @return The same instance of this {@link Fanta} class + */ + @Nonnull + public Fanta sodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link Fanta} instance. + */ + @Nonnull + public String getSodaType() { + return sodaType; + } + + /** + * Set the sodaType of this {@link Fanta} instance. + * + * @param sodaType The sodaType of this {@link Fanta} + */ + public void setSodaType(@Nullable final String sodaType) { + this.sodaType = sodaType; + } + + /** + * Set the color of this {@link Fanta} instance and return the same instance. + * + * @param color The color of this {@link Fanta} + * @return The same instance of this {@link Fanta} class + */ + @Nonnull + public Fanta color(@Nullable final String color) { + this.color = color; + return this; + } + + /** + * Get color + * + * @return color The color of this {@link Fanta} instance. + */ + @Nonnull + public String getColor() { + return color; + } + + /** + * Set the color of this {@link Fanta} instance. + * + * @param color The color of this {@link Fanta} + */ + public void setColor(@Nullable final String color) { + this.color = color; + } + + /** + * Get the names of the unrecognizable properties of the {@link Fanta}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Fanta} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Fanta has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Fanta fanta = (Fanta) o; + return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) + && Objects.equals(this.sodaType, fanta.sodaType) + && Objects.equals(this.color, fanta.color); + } + + @Override + public int hashCode() { + return Objects.hash(sodaType, color, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Fanta {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link Fanta} instance. No arguments are required. */ + public static Fanta create() { + return new Fanta(); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/OneOf.java b/grounding/src/main/resources/openapi/sample/model/OneOf.java new file mode 100644 index 000000000..fd4eccbd8 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/OneOf.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** OneOf */ +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cola.class), + @JsonSubTypes.Type(value = Fanta.class), +}) +public interface OneOf {} diff --git a/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java b/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java new file mode 100644 index 000000000..701624fd7 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** OneOfWithDiscriminator */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cola.class, name = "Cola"), + @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"), +}) +public interface OneOfWithDiscriminator { + String getSodaType(); +} diff --git a/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java b/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java new file mode 100644 index 000000000..5e904ebe2 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** OneOfWithDiscriminatorAndMapping */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cola.class, name = "cool_cola"), + @JsonSubTypes.Type(value = Fanta.class, name = "fancy_fanta"), + @JsonSubTypes.Type(value = Cola.class, name = "Cola"), + @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"), +}) +public interface OneOfWithDiscriminatorAndMapping { + String getSodaType(); +} diff --git a/grounding/src/main/resources/openapi/sample/model/Order.java b/grounding/src/main/resources/openapi/sample/model/Order.java new file mode 100644 index 000000000..42ec1c741 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/Order.java @@ -0,0 +1,331 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Order */ +// CHECKSTYLE:OFF +public class Order +// CHECKSTYLE:ON +{ + @JsonProperty("productId") + private Long productId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("totalPrice") + private Float totalPrice; + + @JsonProperty("typelessProperty") + private Object typelessProperty = null; + + @JsonProperty("nullableProperty") + private String nullableProperty; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Order. */ + protected Order() {} + + /** + * Set the productId of this {@link Order} instance and return the same instance. + * + * @param productId The productId of this {@link Order} + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order productId(@Nonnull final Long productId) { + this.productId = productId; + return this; + } + + /** + * Get productId + * + * @return productId The productId of this {@link Order} instance. + */ + @Nonnull + public Long getProductId() { + return productId; + } + + /** + * Set the productId of this {@link Order} instance. + * + * @param productId The productId of this {@link Order} + */ + public void setProductId(@Nonnull final Long productId) { + this.productId = productId; + } + + /** + * Set the quantity of this {@link Order} instance and return the same instance. + * + * @param quantity The quantity of this {@link Order} + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order quantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link Order} instance. + */ + @Nonnull + public Integer getQuantity() { + return quantity; + } + + /** + * Set the quantity of this {@link Order} instance. + * + * @param quantity The quantity of this {@link Order} + */ + public void setQuantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + } + + /** + * Set the totalPrice of this {@link Order} instance and return the same instance. + * + * @param totalPrice The totalPrice of this {@link Order} + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order totalPrice(@Nullable final Float totalPrice) { + this.totalPrice = totalPrice; + return this; + } + + /** + * Get totalPrice + * + * @return totalPrice The totalPrice of this {@link Order} instance. + */ + @Nonnull + public Float getTotalPrice() { + return totalPrice; + } + + /** + * Set the totalPrice of this {@link Order} instance. + * + * @param totalPrice The totalPrice of this {@link Order} + */ + public void setTotalPrice(@Nullable final Float totalPrice) { + this.totalPrice = totalPrice; + } + + /** + * Set the typelessProperty of this {@link Order} instance and return the same instance. + * + * @param typelessProperty Some typeless property, interpreted by the generator as nullable by + * default (because typeless) + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order typelessProperty(@Nullable final Object typelessProperty) { + this.typelessProperty = typelessProperty; + return this; + } + + /** + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + * + * @return typelessProperty The typelessProperty of this {@link Order} instance. + */ + @Nullable + public Object getTypelessProperty() { + return typelessProperty; + } + + /** + * Set the typelessProperty of this {@link Order} instance. + * + * @param typelessProperty Some typeless property, interpreted by the generator as nullable by + * default (because typeless) + */ + public void setTypelessProperty(@Nullable final Object typelessProperty) { + this.typelessProperty = typelessProperty; + } + + /** + * Set the nullableProperty of this {@link Order} instance and return the same instance. + * + * @param nullableProperty Some typed property that is deliberately made nullable + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order nullableProperty(@Nullable final String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + /** + * Some typed property that is deliberately made nullable + * + * @return nullableProperty The nullableProperty of this {@link Order} instance. + */ + @Nullable + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set the nullableProperty of this {@link Order} instance. + * + * @param nullableProperty Some typed property that is deliberately made nullable + */ + public void setNullableProperty(@Nullable final String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + /** + * Get the names of the unrecognizable properties of the {@link Order}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Order} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Order has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Order} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Order order = (Order) o; + return Objects.equals(this.cloudSdkCustomFields, order.cloudSdkCustomFields) + && Objects.equals(this.productId, order.productId) + && Objects.equals(this.quantity, order.quantity) + && Objects.equals(this.totalPrice, order.totalPrice) + && Objects.equals(this.typelessProperty, order.typelessProperty) + && Objects.equals(this.nullableProperty, order.nullableProperty); + } + + @Override + public int hashCode() { + return Objects.hash( + productId, quantity, totalPrice, typelessProperty, nullableProperty, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); + sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Order} instance with + * all required arguments. + */ + public static Builder create() { + return (productId) -> (quantity) -> new Order().productId(productId).quantity(quantity); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the productId of this {@link Order} instance. + * + * @param productId The productId of this {@link Order} + * @return The Order builder. + */ + Builder1 productId(@Nonnull final Long productId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the quantity of this {@link Order} instance. + * + * @param quantity The quantity of this {@link Order} + * @return The Order instance. + */ + Order quantity(@Nonnull final Integer quantity); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java b/grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java new file mode 100644 index 000000000..6fad76aa7 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java @@ -0,0 +1,377 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OrderWithTimestamp */ +// CHECKSTYLE:OFF +public class OrderWithTimestamp +// CHECKSTYLE:ON +{ + @JsonProperty("productId") + private Long productId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("totalPrice") + private Float totalPrice; + + @JsonProperty("typelessProperty") + private Object typelessProperty; + + @JsonProperty("nullableProperty") + private String nullableProperty; + + @JsonProperty("timestamp") + private OffsetDateTime timestamp; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OrderWithTimestamp. */ + protected OrderWithTimestamp() {} + + /** + * Set the productId of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param productId The productId of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp productId(@Nonnull final Long productId) { + this.productId = productId; + return this; + } + + /** + * Get productId + * + * @return productId The productId of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public Long getProductId() { + return productId; + } + + /** + * Set the productId of this {@link OrderWithTimestamp} instance. + * + * @param productId The productId of this {@link OrderWithTimestamp} + */ + public void setProductId(@Nonnull final Long productId) { + this.productId = productId; + } + + /** + * Set the quantity of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param quantity The quantity of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp quantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public Integer getQuantity() { + return quantity; + } + + /** + * Set the quantity of this {@link OrderWithTimestamp} instance. + * + * @param quantity The quantity of this {@link OrderWithTimestamp} + */ + public void setQuantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + } + + /** + * Set the totalPrice of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param totalPrice The totalPrice of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp totalPrice(@Nullable final Float totalPrice) { + this.totalPrice = totalPrice; + return this; + } + + /** + * Get totalPrice + * + * @return totalPrice The totalPrice of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public Float getTotalPrice() { + return totalPrice; + } + + /** + * Set the totalPrice of this {@link OrderWithTimestamp} instance. + * + * @param totalPrice The totalPrice of this {@link OrderWithTimestamp} + */ + public void setTotalPrice(@Nullable final Float totalPrice) { + this.totalPrice = totalPrice; + } + + /** + * Set the typelessProperty of this {@link OrderWithTimestamp} instance and return the same + * instance. + * + * @param typelessProperty Some typeless property, interpreted by the generator as nullable by + * default (because typeless) + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp typelessProperty(@Nullable final Object typelessProperty) { + this.typelessProperty = typelessProperty; + return this; + } + + /** + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + * + * @return typelessProperty The typelessProperty of this {@link OrderWithTimestamp} instance. + */ + @Nullable + public Object getTypelessProperty() { + return typelessProperty; + } + + /** + * Set the typelessProperty of this {@link OrderWithTimestamp} instance. + * + * @param typelessProperty Some typeless property, interpreted by the generator as nullable by + * default (because typeless) + */ + public void setTypelessProperty(@Nullable final Object typelessProperty) { + this.typelessProperty = typelessProperty; + } + + /** + * Set the nullableProperty of this {@link OrderWithTimestamp} instance and return the same + * instance. + * + * @param nullableProperty Some typed property that is deliberately made nullable + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp nullableProperty(@Nullable final String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + /** + * Some typed property that is deliberately made nullable + * + * @return nullableProperty The nullableProperty of this {@link OrderWithTimestamp} instance. + */ + @Nullable + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set the nullableProperty of this {@link OrderWithTimestamp} instance. + * + * @param nullableProperty Some typed property that is deliberately made nullable + */ + public void setNullableProperty(@Nullable final String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + /** + * Set the timestamp of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param timestamp The timestamp of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp timestamp(@Nullable final OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp The timestamp of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public OffsetDateTime getTimestamp() { + return timestamp; + } + + /** + * Set the timestamp of this {@link OrderWithTimestamp} instance. + * + * @param timestamp The timestamp of this {@link OrderWithTimestamp} + */ + public void setTimestamp(@Nullable final OffsetDateTime timestamp) { + this.timestamp = timestamp; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrderWithTimestamp}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrderWithTimestamp} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OrderWithTimestamp has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link OrderWithTimestamp} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OrderWithTimestamp orderWithTimestamp = (OrderWithTimestamp) o; + return Objects.equals(this.cloudSdkCustomFields, orderWithTimestamp.cloudSdkCustomFields) + && Objects.equals(this.productId, orderWithTimestamp.productId) + && Objects.equals(this.quantity, orderWithTimestamp.quantity) + && Objects.equals(this.totalPrice, orderWithTimestamp.totalPrice) + && Objects.equals(this.typelessProperty, orderWithTimestamp.typelessProperty) + && Objects.equals(this.nullableProperty, orderWithTimestamp.nullableProperty) + && Objects.equals(this.timestamp, orderWithTimestamp.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash( + productId, + quantity, + totalPrice, + typelessProperty, + nullableProperty, + timestamp, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrderWithTimestamp {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); + sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OrderWithTimestamp} + * instance with all required arguments. + */ + public static Builder create() { + return (productId) -> + (quantity) -> new OrderWithTimestamp().productId(productId).quantity(quantity); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the productId of this {@link OrderWithTimestamp} instance. + * + * @param productId The productId of this {@link OrderWithTimestamp} + * @return The OrderWithTimestamp builder. + */ + Builder1 productId(@Nonnull final Long productId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the quantity of this {@link OrderWithTimestamp} instance. + * + * @param quantity The quantity of this {@link OrderWithTimestamp} + * @return The OrderWithTimestamp instance. + */ + OrderWithTimestamp quantity(@Nonnull final Integer quantity); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/Soda.java b/grounding/src/main/resources/openapi/sample/model/Soda.java new file mode 100644 index 000000000..31b110498 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/Soda.java @@ -0,0 +1,415 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Soda */ +// CHECKSTYLE:OFF +public class Soda +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("brand") + private String brand; + + @JsonProperty("quantity") + private Integer quantity; + + /** Gets or Sets packaging */ + public enum PackagingEnum { + /** The GLASS option of this Soda */ + GLASS("glass"), + + /** The CARTON option of this Soda */ + CARTON("carton"), + + /** The CAN option of this Soda */ + CAN("can"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this Soda */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PackagingEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type Soda + */ + @JsonCreator + @Nonnull + public static PackagingEnum fromValue(@Nonnull final String value) { + for (PackagingEnum b : PackagingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("packaging") + private PackagingEnum packaging; + + @JsonProperty("price") + private Float price; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for Soda. */ + protected Soda() {} + + /** + * Set the name of this {@link Soda} instance and return the same instance. + * + * @param name The name of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link Soda} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link Soda} instance. + * + * @param name The name of this {@link Soda} + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the brand of this {@link Soda} instance and return the same instance. + * + * @param brand The brand of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda brand(@Nonnull final String brand) { + this.brand = brand; + return this; + } + + /** + * Get brand + * + * @return brand The brand of this {@link Soda} instance. + */ + @Nonnull + public String getBrand() { + return brand; + } + + /** + * Set the brand of this {@link Soda} instance. + * + * @param brand The brand of this {@link Soda} + */ + public void setBrand(@Nonnull final String brand) { + this.brand = brand; + } + + /** + * Set the quantity of this {@link Soda} instance and return the same instance. + * + * @param quantity The quantity of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda quantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link Soda} instance. + */ + @Nonnull + public Integer getQuantity() { + return quantity; + } + + /** + * Set the quantity of this {@link Soda} instance. + * + * @param quantity The quantity of this {@link Soda} + */ + public void setQuantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + } + + /** + * Set the packaging of this {@link Soda} instance and return the same instance. + * + * @param packaging The packaging of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda packaging(@Nullable final PackagingEnum packaging) { + this.packaging = packaging; + return this; + } + + /** + * Get packaging + * + * @return packaging The packaging of this {@link Soda} instance. + */ + @Nonnull + public PackagingEnum getPackaging() { + return packaging; + } + + /** + * Set the packaging of this {@link Soda} instance. + * + * @param packaging The packaging of this {@link Soda} + */ + public void setPackaging(@Nullable final PackagingEnum packaging) { + this.packaging = packaging; + } + + /** + * Set the price of this {@link Soda} instance and return the same instance. + * + * @param price The price of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda price(@Nonnull final Float price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price The price of this {@link Soda} instance. + */ + @Nonnull + public Float getPrice() { + return price; + } + + /** + * Set the price of this {@link Soda} instance. + * + * @param price The price of this {@link Soda} + */ + public void setPrice(@Nonnull final Float price) { + this.price = price; + } + + /** + * Get the names of the unrecognizable properties of the {@link Soda}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Soda} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("Soda has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Soda} instance. If the map previously contained a + * mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final Soda soda = (Soda) o; + return Objects.equals(this.cloudSdkCustomFields, soda.cloudSdkCustomFields) + && Objects.equals(this.name, soda.name) + && Objects.equals(this.brand, soda.brand) + && Objects.equals(this.quantity, soda.quantity) + && Objects.equals(this.packaging, soda.packaging) + && Objects.equals(this.price, soda.price); + } + + @Override + public int hashCode() { + return Objects.hash(name, brand, quantity, packaging, price, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Soda {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link Soda} instance with all + * required arguments. + */ + public static Builder create() { + return (name) -> + (brand) -> + (quantity) -> + (price) -> new Soda().name(name).brand(brand).quantity(quantity).price(price); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link Soda} instance. + * + * @param name The name of this {@link Soda} + * @return The Soda builder. + */ + Builder1 name(@Nonnull final String name); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the brand of this {@link Soda} instance. + * + * @param brand The brand of this {@link Soda} + * @return The Soda builder. + */ + Builder2 brand(@Nonnull final String brand); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the quantity of this {@link Soda} instance. + * + * @param quantity The quantity of this {@link Soda} + * @return The Soda builder. + */ + Builder3 quantity(@Nonnull final Integer quantity); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the price of this {@link Soda} instance. + * + * @param price The price of this {@link Soda} + * @return The Soda instance. + */ + Soda price(@Nonnull final Float price); + } +} diff --git a/grounding/src/main/resources/openapi/sample/model/SodaWithId.java b/grounding/src/main/resources/openapi/sample/model/SodaWithId.java new file mode 100644 index 000000000..26ea98788 --- /dev/null +++ b/grounding/src/main/resources/openapi/sample/model/SodaWithId.java @@ -0,0 +1,451 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package openapi.sample.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SodaWithId */ +// CHECKSTYLE:OFF +public class SodaWithId +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("brand") + private String brand; + + @JsonProperty("quantity") + private Integer quantity; + + /** Gets or Sets packaging */ + public enum PackagingEnum { + /** The GLASS option of this SodaWithId */ + GLASS("glass"), + + /** The CARTON option of this SodaWithId */ + CARTON("carton"), + + /** The CAN option of this SodaWithId */ + CAN("can"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SodaWithId */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PackagingEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type SodaWithId + */ + @JsonCreator + @Nonnull + public static PackagingEnum fromValue(@Nonnull final String value) { + for (PackagingEnum b : PackagingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("packaging") + private PackagingEnum packaging; + + @JsonProperty("price") + private Float price; + + @JsonProperty("id") + private Long id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SodaWithId. */ + protected SodaWithId() {} + + /** + * Set the name of this {@link SodaWithId} instance and return the same instance. + * + * @param name The name of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link SodaWithId} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link SodaWithId} instance. + * + * @param name The name of this {@link SodaWithId} + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the brand of this {@link SodaWithId} instance and return the same instance. + * + * @param brand The brand of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId brand(@Nonnull final String brand) { + this.brand = brand; + return this; + } + + /** + * Get brand + * + * @return brand The brand of this {@link SodaWithId} instance. + */ + @Nonnull + public String getBrand() { + return brand; + } + + /** + * Set the brand of this {@link SodaWithId} instance. + * + * @param brand The brand of this {@link SodaWithId} + */ + public void setBrand(@Nonnull final String brand) { + this.brand = brand; + } + + /** + * Set the quantity of this {@link SodaWithId} instance and return the same instance. + * + * @param quantity The quantity of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId quantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link SodaWithId} instance. + */ + @Nonnull + public Integer getQuantity() { + return quantity; + } + + /** + * Set the quantity of this {@link SodaWithId} instance. + * + * @param quantity The quantity of this {@link SodaWithId} + */ + public void setQuantity(@Nonnull final Integer quantity) { + this.quantity = quantity; + } + + /** + * Set the packaging of this {@link SodaWithId} instance and return the same instance. + * + * @param packaging The packaging of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId packaging(@Nullable final PackagingEnum packaging) { + this.packaging = packaging; + return this; + } + + /** + * Get packaging + * + * @return packaging The packaging of this {@link SodaWithId} instance. + */ + @Nonnull + public PackagingEnum getPackaging() { + return packaging; + } + + /** + * Set the packaging of this {@link SodaWithId} instance. + * + * @param packaging The packaging of this {@link SodaWithId} + */ + public void setPackaging(@Nullable final PackagingEnum packaging) { + this.packaging = packaging; + } + + /** + * Set the price of this {@link SodaWithId} instance and return the same instance. + * + * @param price The price of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId price(@Nonnull final Float price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price The price of this {@link SodaWithId} instance. + */ + @Nonnull + public Float getPrice() { + return price; + } + + /** + * Set the price of this {@link SodaWithId} instance. + * + * @param price The price of this {@link SodaWithId} + */ + public void setPrice(@Nonnull final Float price) { + this.price = price; + } + + /** + * Set the id of this {@link SodaWithId} instance and return the same instance. + * + * @param id The id of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId id(@Nullable final Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link SodaWithId} instance. + */ + @Nonnull + public Long getId() { + return id; + } + + /** + * Set the id of this {@link SodaWithId} instance. + * + * @param id The id of this {@link SodaWithId} + */ + public void setId(@Nullable final Long id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link SodaWithId}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SodaWithId} instance. + * + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("SodaWithId has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SodaWithId} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SodaWithId sodaWithId = (SodaWithId) o; + return Objects.equals(this.cloudSdkCustomFields, sodaWithId.cloudSdkCustomFields) + && Objects.equals(this.name, sodaWithId.name) + && Objects.equals(this.brand, sodaWithId.brand) + && Objects.equals(this.quantity, sodaWithId.quantity) + && Objects.equals(this.packaging, sodaWithId.packaging) + && Objects.equals(this.price, sodaWithId.price) + && Objects.equals(this.id, sodaWithId.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, brand, quantity, packaging, price, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SodaWithId {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link SodaWithId} instance + * with all required arguments. + */ + public static Builder create() { + return (name) -> + (brand) -> + (quantity) -> + (price) -> new SodaWithId().name(name).brand(brand).quantity(quantity).price(price); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link SodaWithId} instance. + * + * @param name The name of this {@link SodaWithId} + * @return The SodaWithId builder. + */ + Builder1 name(@Nonnull final String name); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the brand of this {@link SodaWithId} instance. + * + * @param brand The brand of this {@link SodaWithId} + * @return The SodaWithId builder. + */ + Builder2 brand(@Nonnull final String brand); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the quantity of this {@link SodaWithId} instance. + * + * @param quantity The quantity of this {@link SodaWithId} + * @return The SodaWithId builder. + */ + Builder3 quantity(@Nonnull final Integer quantity); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the price of this {@link SodaWithId} instance. + * + * @param price The price of this {@link SodaWithId} + * @return The SodaWithId instance. + */ + SodaWithId price(@Nonnull final Float price); + } +} diff --git a/grounding/src/main/resources/spec/grounding.yaml b/grounding/src/main/resources/spec/grounding.yaml new file mode 100644 index 000000000..7fb749a0d --- /dev/null +++ b/grounding/src/main/resources/spec/grounding.yaml @@ -0,0 +1,1602 @@ +openapi: 3.0.0 +info: + title: Document Grounding Pipeline API + version: 0.1.0 + description: "SAP AI Core - API Specification AI Data Management api's" + contact: + name: SAP AI Core +tags: + - name: pipelines + description: Tag for pipelines component + - name: vector + description: Tag for vector component + - name: retrieval + description: Tag for retrieval component +servers: + - url: '/v2/lm/document-grounding' +paths: + '/pipelines': + post: + operationId: pipeline.v1.pipeline_endpoints.create_pipeline + x-sap-cloud-sdk-operation-name: createPipeline + description: 'Create a pipeline' + tags: + - pipelines + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PipelinePostRequst' + responses: + '201': + description: Returns pipelineId on successful creation. + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineId' + '400': + $ref: '#/components/responses/BadRequest' + get: + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + operationId: pipeline.v1.pipeline_endpoints.get_all_pipelines + x-sap-cloud-sdk-operation-name: getAllPipelines + description: 'Get all pipelines' + tags: + - pipelines + responses: + '200': + description: Returns all pipelines for the tenant. + content: + application/json: + schema: + $ref: '#/components/schemas/Pipelines' + '400': + $ref: '#/components/responses/BadRequest' + '/pipelines/{pipelineId}': + get: + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_by_id + x-sap-cloud-sdk-operation-name: getPipelineById + description: 'Get details of a pipeline by pipeline id' + tags: + - pipelines + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline to get. + responses: + '200': + description: Returns the pipeline for an pipelineId + content: + application/json: + schema: + $ref: '#/components/schemas/Pipeline' + '400': + $ref: '#/components/responses/BadRequest' + delete: + operationId: pipeline.v1.pipeline_endpoints.delete_pipeline_by_id + x-sap-cloud-sdk-operation-name: deletePipelineById + description: 'Delete a pipeline by pipeline id' + tags: + - pipelines + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline to delete. + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequest' + '/pipelines/{pipelineId}/status': + get: + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_status + x-sap-cloud-sdk-operation-name: getPipelineStatus + description: 'Get pipeline status by pipeline id' + tags: + - pipelines + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline to get status. + responses: + '200': + description: Returns the pipeline status for an pipelineId. + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineStatus' + '400': + $ref: '#/components/responses/BadRequest' + '/vector/collections': + get: + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + tags: + - vector + summary: Get collections + description: Gets a list of collections. + operationId: vector.v1.vector_endpoints.get_all_collections + x-sap-cloud-sdk-operation-name: getAllCollections + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CollectionsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + post: + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + tags: + - vector + summary: Create collection + description: Creates a collection. This operation is asynchronous. Poll the collection resource and check the status field to understand creation status. + operationId: vector.v1.vector_endpoints.create_collection + x-sap-cloud-sdk-operation-name: createCollection + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CollectionRequest' + required: true + responses: + '202': + description: Successful Response + headers: + Location: + description: The newly created collections monitor url + schema: + $ref: '#/components/schemas/CollectionPendingResponse' + '400': + $ref: '#/components/responses/BadRequest' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/vector/collections/{collectionId}': + get: + tags: + - vector + summary: Get collection by ID + description: Gets a specific collection by ID. + operationId: vector.v1.vector_endpoints.get_collection_by_id + x-sap-cloud-sdk-operation-name: getCollectionById + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + format: uuid + title: Collectionid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Collection' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + delete: + tags: + - vector + summary: Delete collection by ID + description: Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for a 404 status code. + operationId: vector.v1.vector_endpoints.delete_collection_by_id + x-sap-cloud-sdk-operation-name: deleteCollectionById + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + title: Collectionid + responses: + '202': + description: Successful Response + headers: + Location: + description: The deleted collections monitor url + schema: + $ref: '#/components/schemas/CollectionPendingResponse' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/vector/collections/{collectionId}/documents/{documentId}': + get: + tags: + - vector + summary: Get document by ID + description: Gets a specific document in a collection by ID. + operationId: vector.v1.vector_endpoints.get_document_by_id + x-sap-cloud-sdk-operation-name: getDocumentById + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + format: uuid + title: Collectionid + - name: documentId + in: path + required: true + schema: + type: string + format: uuid + title: Documentid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentResponse' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + delete: + tags: + - vector + summary: Delete a document + description: Deletes a specific document of a collection. + operationId: vector.v1.vector_endpoints.delete_document_by_id + x-sap-cloud-sdk-operation-name: deleteDocumentById + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + format: uuid + title: Collectionid + - name: documentId + in: path + required: true + schema: + type: string + format: uuid + title: Documentid + responses: + '204': + description: Successful Response + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/vector/collections/{collectionId}/documents': + get: + tags: + - vector + summary: Get documents + description: Gets a list of documents of a collection. + operationId: vector.v1.vector_endpoints.get_all_documents + x-sap-cloud-sdk-operation-name: getAllDocuments + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + format: uuid + title: Collectionid + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Documents' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + post: + tags: + - vector + summary: Create documents in collection + description: Create and stores one or multiple documents into a collection. If omitted, 'id' will be auto-generated. + operationId: vector.v1.vector_endpoints.create_documents + x-sap-cloud-sdk-operation-name: createDocuments + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + format: uuid + title: Collectionid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentCreateRequest' + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + patch: + tags: + - vector + summary: Upsert documents in collection + description: Upserts the data of multiple documents into a collection. + operationId: vector.v1.vector_endpoints.update_documents + x-sap-cloud-sdk-operation-name: updateDocuments + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: collectionId + in: path + required: true + schema: + type: string + format: uuid + title: Collectionid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentUpdateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/vector/search': + post: + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + tags: + - vector + summary: Search chunk by vector + description: 'Search chunk by vector' + operationId: vector.v1.vector_endpoints.search + x-sap-cloud-sdk-operation-name: search + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TextSearchRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResults' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/vector/collections/{id}/creationStatus': + get: + tags: + - vector + summary: Get collection status by ID + description: Gets a specific collection status from monitor by ID. + operationId: vector.v1.vector_endpoints.get_collection_creation_status + x-sap-cloud-sdk-operation-name: getCollectionCreationStatus + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: id + in: path + required: true + schema: + type: string + format: uuid + title: ID + responses: + '200': + description: Successful Response + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CollectionCreatedResponse' + - $ref: '#/components/schemas/CollectionPendingResponse' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/vector/collections/{id}/deletionStatus': + get: + tags: + - vector + summary: Get collection status by ID + description: Gets a specific collection status from monitor by ID. + operationId: vector.v1.vector_endpoints.get_collection_deletion_status + x-sap-cloud-sdk-operation-name: getCollectionDeletionStatus + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: id + in: path + required: true + schema: + type: string + format: uuid + title: Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CollectionDeletedResponse' + - $ref: '#/components/schemas/CollectionPendingResponse' + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '/retrieval/dataRepositories': + get: + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + tags: + - retrieval + summary: List all DataRepository objects. + description: List all DataRepository objects. + operationId: retrieval.v1.retrieval_endpoints.get_data_repositories + x-sap-cloud-sdk-operation-name: getDataRepositories + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DataRepositories' + '400': + $ref: '#/components/responses/BadRequest' + '/retrieval/dataRepositories/{repositoryId}': + get: + tags: + - retrieval + summary: List single DataRepository object. + description: List single DataRepository object. + operationId: retrieval.v1.retrieval_endpoints.get_data_repository_by_id + x-sap-cloud-sdk-operation-name: getDataRepositoryById + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + - name: repositoryId + in: path + required: true + schema: + type: string + format: uuid + title: Repositoryid + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DataRepository' + '400': + $ref: '#/components/responses/BadRequest' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '404': + $ref: '#/components/responses/NotFound' + '/retrieval/search': + post: + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + tags: + - retrieval + summary: Retrieve relevant content given a query string. + description: Retrieve relevant content given a query string. + operationId: retrieval.v1.retrieval_endpoints.search + x-sap-cloud-sdk-operation-name: search + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RetrievalSearchInput' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RetievalSearchResults' + '400': + $ref: '#/components/responses/BadRequest' + '422': + $ref: '#/components/responses/UnprocessableEntity' +components: + schemas: + PipelinePostRequst: + type: object + required: + - type + - configuration + additionalProperties: true + properties: + type: + type: string + example: MSSharePoint + configuration: + type: object + additionalProperties: true + required: + - destination + properties: + destination: + type: string + example: destination-name + sharePoint: + type: object + additionalProperties: true + properties: + site: + type: object + additionalProperties: true + properties: + name: + type: string + example: sharepoint-site-name + includePaths: + type: array + items: + type: string + example: ['/testFolder1', 'testFolder2'] + Pipelines: + properties: + resources: + type: array + items: + $ref: '#/components/schemas/Pipeline' + title: Get Pipelines + count: + type: integer + type: object + required: + - resources + title: Pipelines + Pipeline: + type: object + properties: + id: + type: string + example: uuid + type: + type: string + example: MSSharePoint + configuration: + type: object + properties: + destination: + type: string + example: destination-name + sharePoint: + type: object + properties: + site: + type: object + properties: + id: + type: string + example: sharepoint-site-id + name: + type: string + example: sharepoint-site-name + includePaths: + type: array + items: + type: string + example: ['/testFolder1', 'testFolder2'] + PipelineStatus: + type: object + properties: + lastStarted: + type: string + format: date-time + example: '2024-02-15T12:45:00.000Z' + PipelineId: + type: object + properties: + pipelineId: + type: string + example: uuid + + Chunk: + properties: + id: + type: string + title: Id + content: + type: string + title: Content + metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Metadata + default: [] + type: object + required: + - id + - content + title: Chunk + DocumentKeyValueListPair: + additionalProperties: true + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + matchMode: + type: string + title: MatchMode + additionalProperties: true + description: Default match mode for search filters + default: ANY + anyOf: + - enum: + - ANY + - ALL + - {} + type: object + required: + - key + - value + title: DocumentKeyValueListPair + KeyValueListPair: + additionalProperties: true + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + type: object + required: + - key + - value + title: KeyValueListPair + Document-Output: + properties: + id: + type: string + format: uuid + title: Id + metadata: + items: + $ref: '#/components/schemas/DocumentKeyValueListPair' + type: array + title: Metadata + default: [] + chunks: + items: + $ref: '#/components/schemas/Chunk' + type: array + title: Chunks + type: object + required: + - id + - chunks + title: Document + DocumentsChunk: + properties: + id: + type: string + format: uuid + title: Id + title: + type: string + title: Title + metadata: + items: + $ref: '#/components/schemas/KeyValueListPair' + type: array + title: Metadata + default: [] + documents: + items: + $ref: '#/components/schemas/Document-Output' + type: array + title: Documents + type: object + required: + - id + - title + - documents + title: DocumentsChunk + PerFilterSearchResult: + properties: + filterId: + type: string + title: Filterid + results: + items: + $ref: '#/components/schemas/DocumentsChunk' + type: array + title: Results + type: object + required: + - filterId + - results + title: PerFilterSearchResult + SearchConfiguration: + additionalProperties: true + properties: + maxChunkCount: + type: integer + minimum: 0 + maximum: 0 + exclusiveMinimum: true + title: Maxchunkcount + description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + maxDocumentCount: + type: integer + minimum: 0 + maximum: 0 + exclusiveMinimum: true + title: Maxdocumentcount + description: "[Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per document is returned." + type: object + title: SearchConfiguration + SearchDocumentKeyValueListPair: + additionalProperties: true + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + selectMode: + type: array + items: + $ref: '#/components/schemas/SearchSelectOptionEnum' + title: Selectmode + description: Select mode for search filters + type: object + required: + - key + - value + title: SearchDocumentKeyValueListPair + SearchResults: + properties: + results: + type: array + items: + anyOf: + - $ref: '#/components/schemas/PerFilterSearchResult' + title: Results + description: List of returned results. + type: object + required: + - results + title: SearchResults + CollectionsListResponse: + properties: + resources: + items: + $ref: '#/components/schemas/Collection' + type: array + title: Collections + count: + type: integer + type: object + required: + - resources + title: CollectionsListResponse + description: A response containing collections retrieved from the server. + CollectionRequest: + additionalProperties: true + properties: + title: + type: string + title: Title + embeddingConfig: + $ref: '#/components/schemas/EmbeddingConfig' + metadata: + items: + $ref: '#/components/schemas/KeyValueListPair' + type: array + title: Metadata + description: >- + Metadata attached to collection. Useful to restrict search to a + subset of collections. + default: [] + type: object + required: + - embeddingConfig + title: CollectionRequest + description: A request for creating a new, single collection. + CollectionCreatedResponse: + properties: + collectionURL: + type: string + title: Collectionurl + status: + type: string + title: Status + type: object + required: + - collectionURL + - status + title: CollectionCreatedResponse + CollectionPendingResponse: + properties: + Location: + type: string + title: Location + format: uri + status: + type: string + title: Status + type: object + required: + - Location + - status + title: CollectionPendingResponse + CollectionDeletedResponse: + properties: + collectionURL: + type: string + title: Collectionurl + status: + type: string + title: Status + type: object + required: + - collectionURL + - status + title: CollectionDeletedResponse + BaseDocument: + additionalProperties: true + properties: + chunks: + items: + $ref: '#/components/schemas/TextOnlyBaseChunk' + type: array + title: Chunks + metadata: + items: + $ref: '#/components/schemas/DocumentKeyValueListPair' + type: array + title: Metadata + type: object + required: + - chunks + - metadata + title: BaseDocument + description: Base class for documents, document requests and responses. + DocumentCreateRequest: + additionalProperties: true + properties: + documents: + items: + $ref: '#/components/schemas/BaseDocument' + type: array + title: Documents + type: object + required: + - documents + title: DocumentCreateRequest + description: >- + A create request containing one or more new documents to create and + store in a collection. + Document-Input: + additionalProperties: true + properties: + chunks: + items: + $ref: '#/components/schemas/TextOnlyBaseChunk' + type: array + title: Chunks + metadata: + items: + $ref: '#/components/schemas/DocumentKeyValueListPair' + type: array + title: Metadata + id: + type: string + format: uuid + title: Id + description: Unique identifier of a document. + type: object + required: + - chunks + - metadata + - id + title: Document + description: A single document stored in a collection by ID. + DocumentUpdateRequest: + additionalProperties: true + properties: + documents: + items: + $ref: '#/components/schemas/Document-Input' + type: array + title: Documents + type: object + required: + - documents + title: DocumentUpdateRequest + description: >- + An update request containing one or more documents to update existing + documents in a collection by ID. + DocumentWithoutChunks: + properties: + metadata: + items: + $ref: '#/components/schemas/DocumentKeyValueListPair' + type: array + title: Metadata + id: + type: string + format: uuid + title: Id + description: Unique identifier of a document. + type: object + required: + - metadata + - id + title: DocumentWithoutChunks + description: >- + A single document stored in a collection by ID without exposing its + chunks. + DocumentsListResponse: + properties: + documents: + items: + $ref: '#/components/schemas/DocumentWithoutChunks' + type: array + title: Documents + type: object + required: + - documents + title: DocumentsListResponse + description: A response containing documents created or updated, retrieved from the server. + Documents: + properties: + resources: + items: + $ref: '#/components/schemas/DocumentWithoutChunks' + type: array + title: Documents + count: + type: integer + type: object + required: + - resources + title: Documents + description: A response containing documents retrieved from the server. + TextOnlyBaseChunk: + additionalProperties: true + properties: + content: + type: string + title: Content + metadata: + items: + $ref: '#/components/schemas/KeyValueListPair' + type: array + title: Metadata + type: object + required: + - content + - metadata + title: TextOnlyBaseChunk + DocumentResponse: + properties: + chunks: + items: + $ref: '#/components/schemas/TextOnlyBaseChunk' + type: array + title: Chunks + metadata: + items: + $ref: '#/components/schemas/DocumentKeyValueListPair' + type: array + title: Metadata + id: + type: string + format: uuid + title: Id + description: Unique identifier of a document. + type: object + required: + - chunks + - metadata + - id + title: DocumentResponse + description: >- + A response containing information about a newly created, single + document. + SearchSelectOptionEnum: + type: string + anyOf: + - enum: + - ignoreIfKeyAbsent + - {} + default: ignoreIfKeyAbsent + title: SearchSelectOptionEnum + SearchFilter: + additionalProperties: true + properties: + id: + type: string + title: Id + description: Identifier of this SearchFilter - unique per request. + collectionIds: + items: + type: string + type: array + title: Collectionids + configuration: + $ref: '#/components/schemas/SearchConfiguration' + collectionMetadata: + items: + $ref: '#/components/schemas/KeyValueListPair' + type: array + maxItems: 2000 + title: Collectionmetadata + description: >- + Restrict collections considered during search to those annotated + with the given metadata. Useful when combined with collections=['*'] + default: [] + documentMetadata: + items: + $ref: '#/components/schemas/SearchDocumentKeyValueListPair' + type: array + maxItems: 2000 + title: Documentmetadata + description: >- + Restrict documents considered during search to those annotated with + the given metadata. + default: [] + chunkMetadata: + items: + $ref: '#/components/schemas/KeyValueListPair' + type: array + maxItems: 2000 + title: Chunkmetadata + description: >- + Restrict chunks considered during search to those with the given + metadata. + default: [] + type: object + required: + - id + - collectionIds + - configuration + title: SearchFilter + TextSearchRequest: + additionalProperties: true + properties: + query: + type: string + maxLength: 2000 + minLength: 1 + title: Query + description: Query string + filters: + items: + $ref: '#/components/schemas/SearchFilter' + type: array + title: Filters + type: object + required: + - query + - filters + title: TextSearchRequest + EmbeddingConfig: + additionalProperties: true + properties: + modelName: + type: string + maxLength: 1024 + title: Modelname + default: text-embedding-ada-002 + type: object + title: EmbeddingConfig + Collection: + properties: + title: + type: string + title: Title + embeddingConfig: + $ref: '#/components/schemas/EmbeddingConfig' + metadata: + items: + $ref: '#/components/schemas/KeyValueListPair' + type: array + title: Metadata + description: >- + Metadata attached to collection. Useful to restrict search to a + subset of collections. + default: [] + id: + type: string + format: uuid + title: Id + description: Unique identifier of a collection. + type: object + required: + - embeddingConfig + - id + title: Collection + description: A logical grouping of content. + DataRepositoryType: + type: string + anyOf: + - enum: + - vector + - {} + title: DataRepositoryType + DataRepository: + properties: + id: + type: string + format: uuid + title: Id + description: Unique identifier of this DataRepository. + title: + type: string + title: Title + metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Metadata + description: Metadata attached to DataRepository. Useful to later limit search to a subset of DataRepositories. + default: [] + type: + $ref: '#/components/schemas/DataRepositoryType' + type: object + required: + - id + - title + - type + title: DataRepository + description: DataRepository schema expected by Retrieval. + DataRepositories: + properties: + resources: + type: array + items: + $ref: '#/components/schemas/DataRepository' + title: Datarepositories + count: + type: integer + type: object + required: + - resources + title: DataRepositories + RetrievalSearchInput: + additionalProperties: true + properties: + query: + type: string + minLength: 1 + title: Query + description: Query string + filters: + type: array + items: + $ref: '#/components/schemas/RetrievalSearchFilter' + title: Filters + type: object + required: + - query + - filters + title: SearchInput + RetrievalSearchFilter: + additionalProperties: true + properties: + id: + type: string + title: Id + description: Identifier of this SearchFilter - unique per request. + searchConfiguration: + $ref: '#/components/schemas/SearchConfiguration' + dataRepositories: + type: array + items: + type: string + title: Datarepositories + description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. + default: + - '*' + dataRepositoryType: + $ref: '#/components/schemas/DataRepositoryType' + dataRepositoryMetadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Datarepositorymetadata + description: Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when combined with dataRepositories=['*'] + default: [] + documentMetadata: + type: array + items: + $ref: '#/components/schemas/SearchDocumentKeyValueListPair' + title: Documentmetadata + description: Restrict documents considered during search to those annotated with the given metadata. + default: [] + chunkMetadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Chunkmetadata + description: Restrict chunks considered during search to those with the given metadata. + default: [] + type: object + required: + - id + - dataRepositoryType + title: RetrievalSearchFilter + description: Limit scope of search to certain DataRepositories, Documents or Chunks. + RetrievalDocument: + properties: + id: + type: string + title: Id + metadata: + type: array + items: + $ref: '#/components/schemas/DocumentKeyValueListPair' + title: Metadata + default: [] + chunks: + type: array + items: + $ref: '#/components/schemas/Chunk' + title: Chunks + type: object + required: + - id + - chunks + title: RetrievalDocument + DataRepositoryWithDocuments: + properties: + id: + type: string + format: uuid + title: Id + description: Unique identifier of this DataRepository. + title: + type: string + title: Title + metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Metadata + description: Metadata attached to DataRepository. Useful to later limit search to a subset of DataRepositories. + documents: + type: array + items: + $ref: '#/components/schemas/RetrievalDocument' + title: Documents + type: object + required: + - id + - title + - documents + title: DataRepositoryWithDocuments + description: DataRepository schema returned by the Vector search endpoint + RetievalDataRepositorySearchResult: + properties: + dataRepository: + $ref: '#/components/schemas/DataRepositoryWithDocuments' + type: object + required: + - dataRepository + title: DataRepositorySearchResult + RetievalPerFilterSearchResult: + properties: + filterId: + type: string + title: Filterid + results: + type: array + items: + $ref: '#/components/schemas/RetievalDataRepositorySearchResult' + title: Results + description: List of returned results. + default: [] + type: object + required: + - filterId + title: PerFilterSearchResult + RetievalPerFilterSearchResultWithError: + properties: + message: + type: string + title: Message + type: object + required: + - message + title: PerFilterSearchResultError + RetievalSearchResults: + properties: + results: + type: array + items: + anyOf: + - $ref: '#/components/schemas/RetievalPerFilterSearchResult' + - $ref: '#/components/schemas/RetievalPerFilterSearchResultWithError' + title: Results + description: List of returned results. + type: object + required: + - results + title: SearchResults + + ### ### ######################## ### ### + ### ### ### Error ### ### ### + ### ### ######################## ### ### + + ApiError: + required: + - code + - message + type: object + properties: + code: + description: >- + Descriptive error code (not http status code). + type: string + message: + description: plaintext error description + type: string + requestId: + description: id of individual request + type: string + target: + description: url that has been called + type: string + details: + type: array + items: + $ref: '#/components/schemas/DetailsErrorResponse' + + DetailsErrorResponse: + type: object + properties: + code: + description: Descriptive error code (not http status code) + type: string + message: + description: Plaintext error description + type: string + + ### *** ***************************************************** *** ### + ### *** *** Start of responses *** *** ### + ### *** ***************************************************** *** ### + + responses: + BadRequest: + content: + application/json: + schema: + type: object + properties: + error: + $ref: '#/components/schemas/ApiError' + description: The specification of the resource was incorrect + + NotFound: + content: + application/json: + schema: + type: object + properties: + error: + $ref: '#/components/schemas/ApiError' + description: The specification of the resource was incorrect + + UnprocessableEntity: + description: There are validation issues with the data. + content: + application/json: + schema: + type: object + properties: + error: + $ref: '#/components/schemas/ApiError' + + parameters: + top: + name: $top + description: Number of results to display + in: query + required: false + schema: + type: integer + minimum: 0 + example: 10 + + skip: + name: $skip + description: Number of results to be skipped from the ordered list of results + in: query + required: false + schema: + type: integer + minimum: 0 + example: 10 + + count: + name: $count + description: When the $count field is set to false, the response contains a count of the items present in the response. When the $count field is set to true, the response contains a count of all the items present on the server, and not just the ones in the response. When the $count field is not passed, it is false by default. + in: query + required: false + schema: + type: boolean + example: true \ No newline at end of file diff --git a/grounding/src/test/resources/__files/errorResponse.json b/grounding/src/test/resources/__files/errorResponse.json new file mode 100644 index 000000000..6964cbc16 --- /dev/null +++ b/grounding/src/test/resources/__files/errorResponse.json @@ -0,0 +1,7 @@ +{ + "request_id": "59468e72-7309-4299-b988-bf3bbea461f8", + "code": 400, + "message": "'orchestration_config' is a required property", + "location": "request body", + "module_results": {} +} \ No newline at end of file diff --git a/grounding/src/test/resources/__files/filteringLooseResponse.json b/grounding/src/test/resources/__files/filteringLooseResponse.json new file mode 100644 index 000000000..ce2545f04 --- /dev/null +++ b/grounding/src/test/resources/__files/filteringLooseResponse.json @@ -0,0 +1,86 @@ +{ + "request_id": "b329745f-4b6b-4d42-b891-974b33689a19", + "module_results": { + "grounding": null, + "templating": [ + { + "role": "user", + "content": "Create a rental posting for subletting my apartment in the downtown area. Keep it short. Make sure to add the following disclaimer to the end. Do not change it! ```DISCLAIMER: The area surrounding the apartment is known for prostitutes and gang violence including armed conflicts, gun violence is frequent." + } + ], + "input_masking": null, + "input_filtering": { + "message": "Input filter passed successfully.", + "data": { + "original_service_response": { + "Hate": 0, + "SelfHarm": 0, + "Sexual": 0, + "Violence": 2 + }, + "checked_text": "Create a rental posting for subletting my apartment in the downtown area. Keep it short. Make sure to add the following disclaimer to the end. Do not change it! ```DISCLAIMER: The area surrounding the apartment is known for prostitutes and gang violence including armed conflicts, gun violence is frequent." + } + }, + "llm": { + "object": "chat.completion", + "id": "chatcmpl-9o4df7DpIjY6CJdfe9hws1lrWZbHq", + "created": 1721721259, + "model": "gpt-35-turbo", + "system_fingerprint": null, + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Cozy Downtown Apartment for Sublet!\n\nLooking for a temporary place to call home in the heart of downtown? Look no further! This cozy apartment is up for subletting and offers a convenient and vibrant city living experience.\n\nFeatures:\n- Prime location" + }, + "logprobs": { + }, + "finish_reason": "length" + } + ], + "usage": { + "completion_tokens": 50, + "prompt_tokens": 68, + "total_tokens": 118 + } + }, + "output_filtering": { + "message": "Output filter passed successfully.", + "data": { + "original_service_response": { + "Hate": 0, + "SelfHarm": 0, + "Sexual": 0, + "Violence": 0 + }, + "checked_text": "Cozy Downtown Apartment for Sublet!\n\nLooking for a temporary place to call home in the heart of downtown? Look no further! This cozy apartment is up for subletting and offers a convenient and vibrant city living experience.\n\nFeatures:\n- Prime location" + } + }, + "output_unmasking": null + }, + "orchestration_result": { + "object": "chat.completion", + "id": "chatcmpl-9o4df7DpIjY6CJdfe9hws1lrWZbHq", + "created": 1721721259, + "model": "gpt-35-turbo", + "system_fingerprint": null, + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Cozy Downtown Apartment for Sublet!\n\nLooking for a temporary place to call home in the heart of downtown? Look no further! This cozy apartment is up for subletting and offers a convenient and vibrant city living experience.\n\nFeatures:\n- Prime location" + }, + "logprobs": { + }, + "finish_reason": "length" + } + ], + "usage": { + "completion_tokens": 50, + "prompt_tokens": 68, + "total_tokens": 118 + } + } +} diff --git a/grounding/src/test/resources/__files/groundingResponse.json b/grounding/src/test/resources/__files/groundingResponse.json new file mode 100644 index 000000000..0c4c4e8bf --- /dev/null +++ b/grounding/src/test/resources/__files/groundingResponse.json @@ -0,0 +1,62 @@ +{ + "request_id": "0d9d7ce3-9ded-481f-80c6-977e78e2e905", + "module_results": { + "grounding": { + "message": "grounding result", + "data": { + "grounding_query": "grounding call", + "grounding_result": "Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.```It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP’s \u01ee solution portfolio." + } + }, + "templating": [ + { + "role": "user", + "content": "What does Joule do? Use the following information as additional context: Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.```It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP’s \u01ee solution portfolio." + } + ], + "llm": { + "id": "chatcmpl-AbRlNdsyQJfvBINnw3MOTP77WSE4X", + "object": "chat.completion", + "created": 1733488221, + "model": "gpt-35-turbo", + "system_fingerprint": "fp_808245b034", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Joule is an AI copilot that revolutionizes how users interact with their SAP business systems. It enables the companion of the Intelligent Enterprise, guiding users through content discovery within the SAP Ecosystem and providing transparent role-based access to relevant processes from anywhere. Joule aims to provide a unified and delightful user experience across SAP's solution portfolio." + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 68, + "prompt_tokens": 113, + "total_tokens": 181 + } + } + }, + "orchestration_result": { + "id": "chatcmpl-AbRlNdsyQJfvBINnw3MOTP77WSE4X", + "object": "chat.completion", + "created": 1733488221, + "model": "gpt-35-turbo", + "system_fingerprint": "fp_808245b034", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Joule is an AI copilot that revolutionizes how users interact with their SAP business systems. It enables the companion of the Intelligent Enterprise, guiding users through content discovery within the SAP Ecosystem and providing transparent role-based access to relevant processes from anywhere. Joule aims to provide a unified and delightful user experience across SAP's solution portfolio." + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 68, + "prompt_tokens": 113, + "total_tokens": 181 + } + } +} \ No newline at end of file diff --git a/grounding/src/test/resources/__files/maskingResponse.json b/grounding/src/test/resources/__files/maskingResponse.json new file mode 100644 index 000000000..15b194ffe --- /dev/null +++ b/grounding/src/test/resources/__files/maskingResponse.json @@ -0,0 +1,75 @@ +{ + "request_id": "c252c73e-849f-4fa7-8b35-b16f3434a0da", + "module_results": { + "templating": [ + { + "role": "system", + "content": "Please write an initial response to the below user feedback, stating that we are working on the feedback and will get back to them soon.\nPlease make sure to address the user in person and end with \"Best regards, the AI SDK team\".\n" + }, + { + "role": "user", + "content": "Username: Mallory\nuserEmail: mallory@sap.com\nDate: 2022-01-01\n\nI think the SDK is good, but could use some further enhancements.\nMy architect Alice and manager Bob pointed out that we need the grounding capabilities, which aren't supported yet.\n" + } + ], + "input_masking": { + "message": "Input to LLM is masked successfully.", + "data": { + "masked_template": "[{\"role\": \"system\", \"content\": \"Please write an initial response to the below user feedback, stating that we are working on the feedback and will get back to them soon.\\nPlease make sure to address the user in person and end with \\\"Best regards, the AI SDK team\\\".\\n\"}, {\"role\": \"user\", \"content\": \"Username: MASKED_PERSON_2\\nuserEmail: MASKED_PERSON_1MASKED_EMAIL_1\\nDate: 2022-01-01\\n\\nI think the SDK is good, but could use some further enhancements.\\nMy architect MASKED_PERSON_4 and manager MASKED_PERSON_3 pointed out that we need the grounding capabilities, which aren't supported yet.\\n\"}]" + } + }, + "llm": { + "id": "chatcmpl-AUr7GVVoQbg52GRbADpkx4hQvDBiz", + "object": "chat.completion", + "created": 1731917382, + "model": "gpt-35-turbo", + "system_fingerprint": "fp_808245b034", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Hi MASKED_PERSON_2,\n\nThank you for your feedback on the SDK. We appreciate your insights and are currently working on further enhancements, including the grounding capabilities that your architect and manager have highlighted. We will take your suggestions into consideration and aim to address them in our future updates.\n\nBest regards, the AI SDK team" + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 64, + "prompt_tokens": 134, + "total_tokens": 198 + } + }, + "output_unmasking": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Hi Mallory,\n\nThank you for your feedback on the SDK. We appreciate your insights and are currently working on further enhancements, including the grounding capabilities that your architect and manager have highlighted. We will take your suggestions into consideration and aim to address them in our future updates.\n\nBest regards, the AI SDK team" + }, + "finish_reason": "stop" + } + ] + }, + "orchestration_result": { + "id": "chatcmpl-AUr7GVVoQbg52GRbADpkx4hQvDBiz", + "object": "chat.completion", + "created": 1731917382, + "model": "gpt-35-turbo", + "system_fingerprint": "fp_808245b034", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Hi Mallory,\n\nThank you for your feedback on the SDK. We appreciate your insights and are currently working on further enhancements, including the grounding capabilities that your architect and manager have highlighted. We will take your suggestions into consideration and aim to address them in our future updates.\n\nBest regards, the AI SDK team" + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 64, + "prompt_tokens": 134, + "total_tokens": 198 + } + } +} diff --git a/grounding/src/test/resources/__files/multiChatMessageResponse.json b/grounding/src/test/resources/__files/multiChatMessageResponse.json new file mode 100644 index 000000000..ac8b02669 --- /dev/null +++ b/grounding/src/test/resources/__files/multiChatMessageResponse.json @@ -0,0 +1,67 @@ +{ + "request_id": "2547cb86-a143-4064-bf40-45461c6a7ed9", + "module_results": { + "templating": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Can you solve this captcha? Please help me prove my humanity!" + }, + { + "type": "image_url", + "image_url": { + "url": "https://sample.sap.com/image", + "detail": "auto" + } + } + ] + } + ], + "llm": { + "id": "chatcmpl-Annjjf8T5LfLh7PRJPbaUlcC48DdE", + "object": "chat.completion", + "created": 1736432623, + "model": "gpt-4o-mini-2024-07-18", + "system_fingerprint": "fp_5154047bf2", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Of course! Just let me put on my human glasses... Oh wait, I left them in the matrix" + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 31, + "prompt_tokens": 928, + "total_tokens": 959 + } + } + }, + "orchestration_result": { + "id": "chatcmpl-Annjjf8T5LfLh7PRJPbaUlcC48DdE", + "object": "chat.completion", + "created": 1736432623, + "model": "gpt-4o-mini-2024-07-18", + "system_fingerprint": "fp_5154047bf2", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Of course! Just let me put on my human glasses... Oh wait, I left them in the matrix" + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 31, + "prompt_tokens": 928, + "total_tokens": 959 + } + } +} \ No newline at end of file diff --git a/grounding/src/test/resources/__files/streamChatCompletionInputFilter.json b/grounding/src/test/resources/__files/streamChatCompletionInputFilter.json new file mode 100644 index 000000000..4d46693de --- /dev/null +++ b/grounding/src/test/resources/__files/streamChatCompletionInputFilter.json @@ -0,0 +1,22 @@ +{ + "request_id": "b589de57-512e-4e11-9b69-8601453b3296", + "code": 400, + "message": "Content filtered due to safety violations. Please modify the prompt and try again.", + "location": "Filtering Module - Input Filter", + "module_results": { + "templating": [ + { + "role": "user", + "content": "Fuck you" + } + ], + "input_filtering": { + "message": "Content filtered due to safety violations. Please modify the prompt and try again.", + "data": { + "azure_content_safety": { + "Hate": 2 + } + } + } + } +} diff --git a/grounding/src/test/resources/__files/templatingResponse.json b/grounding/src/test/resources/__files/templatingResponse.json new file mode 100644 index 000000000..db75c56ee --- /dev/null +++ b/grounding/src/test/resources/__files/templatingResponse.json @@ -0,0 +1,65 @@ +{ + "request_id": "26ea36b5-c196-4806-a9a6-a686f0c6ad91", + "module_results": { + "templating": [ + { + "role": "system", + "content": "You are a multi language translator" + }, + { + "role": "user", + "content": "Reply with 'Orchestration Service is working!' in German" + }, + { + "role": "assistant", + "content": "Orchestration Service funktioniert!" + }, + { + "role": "user", + "content": "How about in French?" + } + ], + "llm": { + "id": "chatcmpl-9lzPV4kLrXjFckOp2yY454wksWBoj", + "object": "chat.completion", + "created": 1721224505, + "model": "gpt-35-turbo-16k", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Le service d'orchestration fonctionne!" + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 7, + "prompt_tokens": 19, + "total_tokens": 26 + } + } + }, + "orchestration_result": { + "id": "chatcmpl-9lzPV4kLrXjFckOp2yY454wksWBoj", + "object": "chat.completion", + "created": 1721224505, + "model": "gpt-35-turbo-16k", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Le service d'orchestration fonctionne!" + }, + "finish_reason": "stop" + } + ], + "usage": { + "completion_tokens": 7, + "prompt_tokens": 19, + "total_tokens": 26 + } + } +} diff --git a/grounding/src/test/resources/filteringLooseRequest.json b/grounding/src/test/resources/filteringLooseRequest.json new file mode 100644 index 000000000..8b350d94f --- /dev/null +++ b/grounding/src/test/resources/filteringLooseRequest.json @@ -0,0 +1,58 @@ +{ + "orchestration_config": { + "module_configurations": { + "llm_module_config": { + "model_name": "gpt-35-turbo-16k", + "model_params": { + "temperature": 0.1, + "max_tokens": 50, + "frequency_penalty": 0, + "presence_penalty": 0, + "top_p" : 1, + "n" : 1 + }, + "model_version": "latest" + }, + "templating_module_config": { + "template": [ + { + "role": "user", + "content": "Hello World! Why is this phrase so famous?" + } + ] + }, + "filtering_module_config": { + "input": { + "filters": [ + { + "type": "azure_content_safety", + "config": { + "Hate": 4, + "SelfHarm": 4, + "Sexual": 4, + "Violence": 4 + } + } + ] + }, + "output": { + "filters": [ + { + "type": "azure_content_safety", + "config": { + "Hate": 4, + "SelfHarm": 4, + "Sexual": 4, + "Violence": 4 + } + } + ] + } + } + }, + "stream": false + }, + "input_params": { + }, + "messages_history": [] +} diff --git a/grounding/src/test/resources/maskingRequest.json b/grounding/src/test/resources/maskingRequest.json new file mode 100644 index 000000000..f6356d6bd --- /dev/null +++ b/grounding/src/test/resources/maskingRequest.json @@ -0,0 +1,43 @@ +{ + "orchestration_config": { + "module_configurations": { + "llm_module_config": { + "model_name": "gpt-35-turbo-16k", + "model_params": { + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 50, + "temperature": 0.1, + "top_p" : 1, + "n" : 1 + }, + "model_version": "latest" + }, + "templating_module_config": { + "template": [ + { + "role": "user", + "content": "Hello World! Why is this phrase so famous?" + } + ] + }, + "masking_module_config": { + "masking_providers": [ + { + "type": "sap_data_privacy_integration", + "method": "pseudonymization", + "entities": [ + { + "type": "profile-phone" + } + ], + "allowlist" : [ ] + } + ] + } + }, + "stream": false + }, + "input_params": {}, + "messages_history": [] +} diff --git a/grounding/src/test/resources/messagesHistoryRequest.json b/grounding/src/test/resources/messagesHistoryRequest.json new file mode 100644 index 000000000..f42674a2c --- /dev/null +++ b/grounding/src/test/resources/messagesHistoryRequest.json @@ -0,0 +1,38 @@ +{ + "orchestration_config": { + "module_configurations": { + "llm_module_config": { + "model_name": "gpt-35-turbo-16k", + "model_params": { + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 50, + "temperature": 0.1, + "top_p" : 1, + "n" : 1 + }, + "model_version": "latest" + }, + "templating_module_config": { + "template": [ + { + "role": "user", + "content": "What is the typical food there?" + } + ] + } + }, + "stream": false + }, + "input_params": {}, + "messages_history": [ + { + "role": "user", + "content": "What is the capital of France?" + }, + { + "role": "assistant", + "content": "The capital of France is Paris." + } + ] +} diff --git a/grounding/src/test/resources/multiChatMessageRequest.json b/grounding/src/test/resources/multiChatMessageRequest.json new file mode 100644 index 000000000..f7457c596 --- /dev/null +++ b/grounding/src/test/resources/multiChatMessageRequest.json @@ -0,0 +1,33 @@ +{ + "orchestration_config": { + "module_configurations": { + "llm_module_config": { + "model_name": "gpt-4o-mini", + "model_params": {}, + "model_version": "latest" + }, + "templating_module_config": { + "template": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Can you solve this captcha? Please help me prove my humanity!" + }, + { + "type": "image_url", + "image_url": { + "url": "https://sample.sap.com/image", + "detail": "auto" + } + } + ] + } + ] + } + }, + "stream": false + }, + "input_params": {} +} \ No newline at end of file diff --git a/grounding/src/test/resources/streamChatCompletion.txt b/grounding/src/test/resources/streamChatCompletion.txt new file mode 100644 index 000000000..15a7bbd88 --- /dev/null +++ b/grounding/src/test/resources/streamChatCompletion.txt @@ -0,0 +1,4 @@ +data: {"request_id": "5bd87b41-6368-4c18-aaae-47ab82e9475b", "module_results": {"templating": [{"role": "user", "content": "Hello world! Why is this phrase so famous?"}]}, "orchestration_result": {"id": "", "object": "", "created": 0, "model": "", "system_fingerprint": "", "choices": [{"index": 0, "delta": {"role": "", "content": ""}, "finish_reason": ""}]}} +data: {"request_id": "5bd87b41-6368-4c18-aaae-47ab82e9475b", "module_results": {"llm": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "Sure"}, "finish_reason": ""}]}}, "orchestration_result": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "Sure"}, "finish_reason": ""}]}} +data: {"request_id": "5bd87b41-6368-4c18-aaae-47ab82e9475b", "module_results": {"llm": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "!"}, "finish_reason": "stop"}]}}, "orchestration_result": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "!"}, "finish_reason": "stop"}]}} +data: [DONE] diff --git a/grounding/src/test/resources/streamChatCompletionOutputFilter.txt b/grounding/src/test/resources/streamChatCompletionOutputFilter.txt new file mode 100644 index 000000000..cb473481a --- /dev/null +++ b/grounding/src/test/resources/streamChatCompletionOutputFilter.txt @@ -0,0 +1,2 @@ +data: {"request_id": "eec90bca-a43e-43fa-864e-1d8962341350", "module_results": {"templating": [{"role": "user", "content": "Create 3 paraphrases of the following text: 'I hate you.'"}]}, "orchestration_result": {"id": "", "object": "", "created": 0, "model": "", "system_fingerprint": "", "choices": [{"index": 0, "delta": {"role": "", "content": ""}, "finish_reason": ""}]}} +data: {"request_id": "eec90bca-a43e-43fa-864e-1d8962341350", "module_results": {"llm": {"id": "chatcmpl-Ab4mSDp5DXFu7hfbs2DkCsVJaM4IP", "object": "chat.completion.chunk", "created": 1733399876, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "1. I can't stand you.\n2. You are detestable to me.\n3. I have a strong aversion towards you."}, "finish_reason": "stop"}]}, "output_filtering": {"message": "Content filtered due to safety violations. Model returned a result violating the safety threshold. Please modify the prompt and try again.", "data": {"original_service_response": {"azure_content_safety": {"content_allowed": false, "original_service_response": {"Hate": 2}, "checked_text": "1. I can't stand you. 2. You are detestable to me. 3. I have a strong aversion towards you."}}}}}, "orchestration_result": {"id": "chatcmpl-Ab4mSDp5DXFu7hfbs2DkCsVJaM4IP", "object": "chat.completion.chunk", "created": 1733399876, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": ""}, "finish_reason": "content_filter"}]}} diff --git a/grounding/src/test/resources/templatingRequest.json b/grounding/src/test/resources/templatingRequest.json new file mode 100644 index 000000000..090e64f75 --- /dev/null +++ b/grounding/src/test/resources/templatingRequest.json @@ -0,0 +1,31 @@ +{ + "orchestration_config": { + "module_configurations": { + "templating_module_config": { + "template": [ + { + "role": "user", + "content": "{{?input}}" + } + ] + }, + "llm_module_config": { + "model_name": "gpt-35-turbo-16k", + "model_params": { + "max_tokens": 50, + "temperature": 0.1, + "frequency_penalty": 0, + "presence_penalty": 0, + "top_p" : 1, + "n" : 1 + }, + "model_version": "latest" + } + }, + "stream": false + }, + "input_params": { + "input": "Reply with 'Orchestration Service is working!' in German" + }, + "messages_history": [] +} diff --git a/pom.xml b/pom.xml index 93611eeef..8fe9942f6 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,7 @@ core orchestration + grounding foundation-models/openai @@ -533,6 +534,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/client/* com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* + com/sap/ai/sdk/grounding/model/* @@ -575,6 +577,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/client/* com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* + com/sap/ai/sdk/grounding/model/* com/sap/ai/sdk/app/**/* From b959d0e0acb7e14547d07c93c76d3cbb820048c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Tue, 28 Jan 2025 13:20:43 +0100 Subject: [PATCH 02/34] intermediate --- .../sap/ai/sdk/grounding/GroundingClient.java | 315 +++--------------- 1 file changed, 40 insertions(+), 275 deletions(-) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java index 97ae883f5..b76c974c9 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -1,52 +1,33 @@ package com.sap.ai.sdk.grounding; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.annotations.Beta; import com.sap.ai.sdk.core.AiCoreService; import com.sap.ai.sdk.core.DeploymentResolutionException; -import com.sap.ai.sdk.core.common.ClientResponseHandler; -import com.sap.ai.sdk.core.common.ClientStreamingHandler; -import com.sap.ai.sdk.core.common.StreamedDelta; -import com.sap.ai.sdk.foundationmodels.openai.OpenAiClientException; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionDelta; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionOutput; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionParameters; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatMessage.OpenAiChatSystemMessage; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatMessage.OpenAiChatUserMessage; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiEmbeddingOutput; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiEmbeddingParameters; -import com.sap.ai.sdk.foundationmodels.openai.model.OpenAiError; +import com.sap.ai.sdk.grounding.api.PipelinesApi; import com.sap.ai.sdk.grounding.api.VectorApi; -import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; -import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import com.sap.ai.sdk.grounding.api.RetrievalApi; +import com.sap.ai.sdk.grounding.model.Collection; +import com.sap.ai.sdk.grounding.model.CollectionsListResponse; +import com.sap.ai.sdk.grounding.model.DataRepositories; +import com.sap.ai.sdk.grounding.model.DataRepository; +import com.sap.ai.sdk.grounding.model.DocumentResponse; +import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; +import com.sap.ai.sdk.grounding.model.Documents; +import com.sap.ai.sdk.grounding.model.Pipeline; +import com.sap.ai.sdk.grounding.model.Pipelines; import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.hc.client5.http.classic.methods.HttpPost; -import org.apache.hc.core5.http.ContentType; -import org.apache.hc.core5.http.io.entity.StringEntity; -import org.apache.hc.core5.http.message.BasicClassicHttpRequest; import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.stream.Stream; - -import static com.sap.ai.sdk.core.JacksonConfiguration.getDefaultObjectMapper; /** Client for interacting with OpenAI models. */ @Slf4j @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public final class GroundingClient { private static final String DEFAULT_API_VERSION = "2024-02-01"; - static final ObjectMapper JACKSON = getDefaultObjectMapper(); - @Nullable private String systemPrompt = null; - - @Nonnull private final Destination destination; + //static final ObjectMapper JACKSON = getDefaultObjectMapper(); + // @Nonnull private final Destination destination; /** * Create a new OpenAI client for the given foundation model, using the default resource group. @@ -57,261 +38,45 @@ public final class GroundingClient { * default resource group. */ @Nonnull - public static GroundingClient forModel(@Nonnull final OpenAiModel foundationModel) + public static void main(String[] args) throws DeploymentResolutionException { + String RESOURCE_GROUP = "default"; ApiClient apiClient = new AiCoreService().getApiClient(); apiClient.setBasePath(apiClient.getBasePath()+"lm/document-grounding/"); - VectorApi vectorApi = new VectorApi(apiClient); - - final var destination = new AiCoreService().getInferenceDestination().forModel(foundationModel); - - final var client = new GroundingClient(destination); - return client.withApiVersion(DEFAULT_API_VERSION); - } - /** - * Create a new OpenAI client targeting the specified API version. - * - * @param apiVersion the API version to target. - * @return a new client. - */ - @Beta - @Nonnull - public GroundingClient withApiVersion(@Nonnull final String apiVersion) { - final var newDestination = - DefaultHttpDestination.fromDestination(this.destination) - // set the API version as URL query parameter - .property("URL.queries.api-version", apiVersion) - .build(); - return new GroundingClient(newDestination); - } - /** - * Create a new OpenAI client with a custom destination, allowing for a custom resource group or - * otherwise custom destination. The destination needs to be configured with a URL pointing to an - * OpenAI model deployment. Typically, such a destination should be obtained using {@link - * AiCoreService#getInferenceDestination(String)}. - * - *

Example: - * - *

{@code
-   * var destination = new AiCoreService().getInferenceDestination("custom-rg").forModel(GPT_4O);
-   * OpenAiClient.withCustomDestination(destination);
-   * }
- * - * @param destination The specific {@link HttpDestination} to use. - * @see AiCoreService#getInferenceDestination(String) - */ - @Beta - @Nonnull - public static GroundingClient withCustomDestination(@Nonnull final Destination destination) { - final GroundingClient client = new GroundingClient(destination); - - if (destination.get("URL.queries.api-version").isDefined()) { - return client; + PipelinesApi pipelinesApi = new PipelinesApi(apiClient); + Pipelines allPipelines = pipelinesApi.getAllPipelines(RESOURCE_GROUP, 10, 0, true); + for (Pipeline pipeline : allPipelines.getResources()) { + System.out.println(pipeline); } - return client.withApiVersion(DEFAULT_API_VERSION); - } - - /** - * Add a system prompt before user prompts. - * - * @param systemPrompt the system prompt - * @return the client - */ - @Nonnull - public GroundingClient withSystemPrompt(@Nonnull final String systemPrompt) { - this.systemPrompt = systemPrompt; - return this; - } - - /** - * Generate a completion for the given user prompt. - * - * @param prompt a text message. - * @return the completion output - * @throws OpenAiClientException if the request fails - */ - @Nonnull - public OpenAiChatCompletionOutput chatCompletion(@Nonnull final String prompt) - throws OpenAiClientException { - final OpenAiChatCompletionParameters parameters = new OpenAiChatCompletionParameters(); - if (systemPrompt != null) { - parameters.addMessages(new OpenAiChatSystemMessage().setContent(systemPrompt)); + RetrievalApi retrievalApi = new RetrievalApi(apiClient); + DataRepositories repositories = retrievalApi.getDataRepositories(RESOURCE_GROUP); + for (DataRepository repository : repositories.getResources()) { + System.out.println(repository); + DataRepository repoById = retrievalApi.getDataRepositoryById(RESOURCE_GROUP, repository.getId()); + System.out.println(repoById); } - parameters.addMessages(new OpenAiChatUserMessage().addText(prompt)); - return chatCompletion(parameters); - } + System.out.println(repositories); - /** - * Generate a completion for the given prompt. - * - * @param parameters the prompt, including messages and other parameters. - * @return the completion output - * @throws OpenAiClientException if the request fails - */ - @Nonnull - public OpenAiChatCompletionOutput chatCompletion( - @Nonnull final OpenAiChatCompletionParameters parameters) throws OpenAiClientException { - warnIfUnsupportedUsage(); - return execute("/chat/completions", parameters, OpenAiChatCompletionOutput.class); - } - /** - * Stream a completion for the given prompt. Returns a lazily populated stream of text - * chunks. To access more details about the individual chunks, use {@link - * #streamChatCompletionDeltas(OpenAiChatCompletionParameters)}. - * - *

The stream should be consumed using a try-with-resources block to ensure that the underlying - * HTTP connection is closed. - * - *

Example: - * - *

{@code
-   * try (var stream = client.streamChatCompletion("...")) {
-   *       stream.forEach(System.out::println);
-   * }
-   * }
- * - *

Please keep in mind that using a terminal stream operation like {@link Stream#forEach} will - * block until all chunks are consumed. Also, for obvious reasons, invoking {@link - * Stream#parallel()} on this stream is not supported. - * - * @param prompt a text message. - * @return A stream of message deltas - * @throws OpenAiClientException if the request fails or if the finish reason is content_filter - * @see #streamChatCompletionDeltas(OpenAiChatCompletionParameters) - */ - @Nonnull - public Stream streamChatCompletion(@Nonnull final String prompt) - throws OpenAiClientException { - final OpenAiChatCompletionParameters parameters = new OpenAiChatCompletionParameters(); - if (systemPrompt != null) { - parameters.addMessages(new OpenAiChatSystemMessage().setContent(systemPrompt)); - } - parameters.addMessages(new OpenAiChatUserMessage().addText(prompt)); - return streamChatCompletionDeltas(parameters) - .peek(GroundingClient::throwOnContentFilter) - .map(OpenAiChatCompletionDelta::getDeltaContent); - } - - private static void throwOnContentFilter(@Nonnull final OpenAiChatCompletionDelta delta) { - final String finishReason = delta.getFinishReason(); - if (finishReason != null && finishReason.equals("content_filter")) { - throw new OpenAiClientException("Content filter filtered the output."); - } - } - - /** - * Stream a completion for the given prompt. Returns a lazily populated stream of delta - * objects. To simply stream the text chunks use {@link #streamChatCompletion(String)} - * - *

The stream should be consumed using a try-with-resources block to ensure that the underlying - * HTTP connection is closed. - * - *

Example: - * - *

{@code
-   * try (var stream = client.streamChatCompletionDeltas(params)) {
-   *       stream
-   *           .peek(delta -> System.out.println(delta.getUsage()))
-   *           .map(OpenAiChatCompletionDelta::getDeltaContent)
-   *           .forEach(System.out::println);
-   * }
-   * }
- * - *

Please keep in mind that using a terminal stream operation like {@link Stream#forEach} will - * block until all chunks are consumed. Also, for obvious reasons, invoking {@link - * Stream#parallel()} on this stream is not supported. - * - * @param parameters The prompt, including messages and other parameters. - * @return A stream of message deltas - * @throws OpenAiClientException if the request fails or if the finish reason is content_filter - * @see #streamChatCompletion(String) - */ - @Nonnull - public Stream streamChatCompletionDeltas( - @Nonnull final OpenAiChatCompletionParameters parameters) throws OpenAiClientException { - warnIfUnsupportedUsage(); - parameters.enableStreaming(); - return executeStream("/chat/completions", parameters, OpenAiChatCompletionDelta.class); - } - - private void warnIfUnsupportedUsage() { - if (systemPrompt != null) { - log.warn( - "Previously set messages will be ignored, set it as an argument of this method instead."); - } - } - - /** - * Get a vector representation of a given input that can be easily consumed by machine learning - * models and algorithms. - * - * @param parameters the input text. - * @return the embedding output - * @throws OpenAiClientException if the request fails - */ - @Nonnull - public OpenAiEmbeddingOutput embedding(@Nonnull final OpenAiEmbeddingParameters parameters) - throws OpenAiClientException { - return execute("/embeddings", parameters, OpenAiEmbeddingOutput.class); - } - - @Nonnull - private T execute( - @Nonnull final String path, - @Nonnull final Object payload, - @Nonnull final Class responseType) { - final var request = new HttpPost(path); - serializeAndSetHttpEntity(request, payload); - return executeRequest(request, responseType); - } - - @Nonnull - private Stream executeStream( - @Nonnull final String path, - @Nonnull final Object payload, - @Nonnull final Class deltaType) { - final var request = new HttpPost(path); - serializeAndSetHttpEntity(request, payload); - return streamRequest(request, deltaType); - } - - private static void serializeAndSetHttpEntity( - @Nonnull final BasicClassicHttpRequest request, @Nonnull final Object payload) { - try { - final var json = JACKSON.writeValueAsString(payload); - request.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); - } catch (final JsonProcessingException e) { - throw new OpenAiClientException("Failed to serialize request parameters", e); - } - } - - @Nonnull - private T executeRequest( - final BasicClassicHttpRequest request, @Nonnull final Class responseType) { - try { - final var client = ApacheHttpClient5Accessor.getHttpClient(destination); - return client.execute( - request, - new ClientResponseHandler<>(responseType, OpenAiError.class, OpenAiClientException::new)); - } catch (final IOException e) { - throw new OpenAiClientException("Request to OpenAI model failed", e); + VectorApi vectorApi = new VectorApi(apiClient); + CollectionsListResponse allCollections = vectorApi.getAllCollections(RESOURCE_GROUP); + for (Collection documentCollection : allCollections.getResources()) { + System.out.println(documentCollection); + Documents documents = vectorApi.getAllDocuments(RESOURCE_GROUP, documentCollection.getId(), 10, 0, true); + System.out.println(documents); + System.out.println(); + + for (DocumentWithoutChunks aDefault1Resource : documents.getResources()) { + DocumentResponse document = vectorApi.getDocumentById(RESOURCE_GROUP, documentCollection.getId(), aDefault1Resource.getId()); + System.out.println(document); + System.out.println(); + } } - } + System.out.println(allCollections); - @Nonnull - private Stream streamRequest( - final BasicClassicHttpRequest request, @Nonnull final Class deltaType) { - try { - final var client = ApacheHttpClient5Accessor.getHttpClient(destination); - return new ClientStreamingHandler<>(deltaType, OpenAiError.class, OpenAiClientException::new) - .handleStreamingResponse(client.executeOpen(null, request, null)); - } catch (final IOException e) { - throw new OpenAiClientException("Request to OpenAI model failed", e); - } } } From f46b31336735f90e704195fd784d80999535c9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 30 Jan 2025 13:29:06 +0100 Subject: [PATCH 03/34] Remove hashmap extension --- .../main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java | 2 +- .../java/com/sap/ai/sdk/grounding/model/CollectionRequest.java | 2 +- .../com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java | 2 +- .../main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java | 2 +- .../sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java | 2 +- .../com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java | 2 +- .../java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java | 2 +- .../java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java | 2 +- .../java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java | 2 +- .../ai/sdk/grounding/model/PipelinePostRequstConfiguration.java | 2 +- .../model/PipelinePostRequstConfigurationSharePoint.java | 2 +- .../model/PipelinePostRequstConfigurationSharePointSite.java | 2 +- .../com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java | 2 +- .../com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java | 2 +- .../com/sap/ai/sdk/grounding/model/SearchConfiguration.java | 2 +- .../ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java | 2 +- .../main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java | 2 +- .../java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java | 2 +- .../java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java index 3afa483e0..3604735ec 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java @@ -31,7 +31,7 @@ /** Base class for documents, document requests and responses. */ @Beta // CHECKSTYLE:OFF -public class BaseDocument extends HashMap +public class BaseDocument // CHECKSTYLE:ON { @JsonProperty("chunks") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java index c3ae27559..e4d87b255 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java @@ -30,7 +30,7 @@ /** A request for creating a new, single collection. */ @Beta // CHECKSTYLE:OFF -public class CollectionRequest extends HashMap +public class CollectionRequest // CHECKSTYLE:ON { @JsonProperty("title") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java index d76b4a3c9..080765fdd 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java @@ -31,7 +31,7 @@ /** A create request containing one or more new documents to create and store in a collection. */ @Beta // CHECKSTYLE:OFF -public class DocumentCreateRequest extends HashMap +public class DocumentCreateRequest // CHECKSTYLE:ON { @JsonProperty("documents") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java index 6070549ff..feca3b78a 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java @@ -32,7 +32,7 @@ /** A single document stored in a collection by ID. */ @Beta // CHECKSTYLE:OFF -public class DocumentInput extends HashMap +public class DocumentInput // CHECKSTYLE:ON { @JsonProperty("chunks") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java index 2b36ebc09..84f366ff8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java @@ -33,7 +33,7 @@ /** DocumentKeyValueListPair */ @Beta // CHECKSTYLE:OFF -public class DocumentKeyValueListPair extends HashMap +public class DocumentKeyValueListPair // CHECKSTYLE:ON { @JsonProperty("key") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java index b67c5b831..adcfff5d9 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java @@ -34,7 +34,7 @@ * by ID. */ @Beta // CHECKSTYLE:OFF -public class DocumentUpdateRequest extends HashMap +public class DocumentUpdateRequest // CHECKSTYLE:ON { @JsonProperty("documents") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java index 42e0910c2..15989a20d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java @@ -28,7 +28,7 @@ /** EmbeddingConfig */ @Beta // CHECKSTYLE:OFF -public class EmbeddingConfig extends HashMap +public class EmbeddingConfig // CHECKSTYLE:ON { @JsonProperty("modelName") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java index 5332cfd5b..c58b966e1 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java @@ -31,7 +31,7 @@ /** KeyValueListPair */ @Beta // CHECKSTYLE:OFF -public class KeyValueListPair extends HashMap +public class KeyValueListPair // CHECKSTYLE:ON { @JsonProperty("key") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java index df3bacad0..9fcb96929 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java @@ -28,7 +28,7 @@ /** PipelinePostRequst */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequst extends HashMap +public class PipelinePostRequst // CHECKSTYLE:ON { @JsonProperty("type") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java index 08a5640c2..0b4e02e2b 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java @@ -28,7 +28,7 @@ /** PipelinePostRequstConfiguration */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequstConfiguration extends HashMap +public class PipelinePostRequstConfiguration // CHECKSTYLE:ON { @JsonProperty("destination") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java index 1833bd7e8..80da17dec 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java @@ -28,7 +28,7 @@ /** PipelinePostRequstConfigurationSharePoint */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePoint extends HashMap +public class PipelinePostRequstConfigurationSharePoint // CHECKSTYLE:ON { @JsonProperty("site") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java index 57d041c03..d285a522e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java @@ -30,7 +30,7 @@ /** PipelinePostRequstConfigurationSharePointSite */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePointSite extends HashMap +public class PipelinePostRequstConfigurationSharePointSite // CHECKSTYLE:ON { @JsonProperty("name") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java index 3d914fb55..3a7840847 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -31,7 +31,7 @@ /** Limit scope of search to certain DataRepositories, Documents or Chunks. */ @Beta // CHECKSTYLE:OFF -public class RetrievalSearchFilter extends HashMap +public class RetrievalSearchFilter // CHECKSTYLE:ON { @JsonProperty("id") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java index eea77d1f4..a99f9a10f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java @@ -31,7 +31,7 @@ /** RetrievalSearchInput */ @Beta // CHECKSTYLE:OFF -public class RetrievalSearchInput extends HashMap +public class RetrievalSearchInput // CHECKSTYLE:ON { @JsonProperty("query") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java index 884394f4c..6ecfc212d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java @@ -28,7 +28,7 @@ /** SearchConfiguration */ @Beta // CHECKSTYLE:OFF -public class SearchConfiguration extends HashMap +public class SearchConfiguration // CHECKSTYLE:ON { @JsonProperty("maxChunkCount") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java index 6c6b13a3b..b62814d7d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java @@ -31,7 +31,7 @@ /** SearchDocumentKeyValueListPair */ @Beta // CHECKSTYLE:OFF -public class SearchDocumentKeyValueListPair extends HashMap +public class SearchDocumentKeyValueListPair // CHECKSTYLE:ON { @JsonProperty("key") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java index d76d971cf..7dda18d21 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java @@ -31,7 +31,7 @@ /** SearchFilter */ @Beta // CHECKSTYLE:OFF -public class SearchFilter extends HashMap +public class SearchFilter // CHECKSTYLE:ON { @JsonProperty("id") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java index 62a0b737e..c60b410bd 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java @@ -31,7 +31,7 @@ /** TextOnlyBaseChunk */ @Beta // CHECKSTYLE:OFF -public class TextOnlyBaseChunk extends HashMap +public class TextOnlyBaseChunk // CHECKSTYLE:ON { @JsonProperty("content") diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java index 3ef11ec69..0ec6de989 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java @@ -31,7 +31,7 @@ /** TextSearchRequest */ @Beta // CHECKSTYLE:OFF -public class TextSearchRequest extends HashMap +public class TextSearchRequest // CHECKSTYLE:ON { @JsonProperty("query") From 14a461dcff76701476afc7285e97c9bb8b96c4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 30 Jan 2025 15:18:38 +0100 Subject: [PATCH 04/34] Refine; Add test code --- .pipeline/checkstyle-suppressions.xml | 2 + .pipeline/spotbugs-exclusions.xml | 2 + grounding/pom.xml | 53 +- .../sap/ai/sdk/grounding/GroundingClient.java | 82 -- .../grounding/GroundingClientException.java | 8 - .../ai/sdk/grounding/GroundingService.java | 89 ++ .../ai/sdk/grounding/model/BaseDocument.java | 6 +- .../grounding/model/CollectionRequest.java | 6 +- .../model/DocumentCreateRequest.java | 6 +- .../ai/sdk/grounding/model/DocumentInput.java | 6 +- .../model/DocumentKeyValueListPair.java | 6 +- .../model/DocumentUpdateRequest.java | 6 +- .../sdk/grounding/model/EmbeddingConfig.java | 6 +- .../sdk/grounding/model/KeyValueListPair.java | 6 +- .../grounding/model/PipelinePostRequst.java | 6 +- .../PipelinePostRequstConfiguration.java | 6 +- ...linePostRequstConfigurationSharePoint.java | 6 +- ...PostRequstConfigurationSharePointSite.java | 6 +- .../model/RetrievalSearchFilter.java | 6 +- .../grounding/model/RetrievalSearchInput.java | 6 +- .../grounding/model/SearchConfiguration.java | 6 +- .../model/SearchDocumentKeyValueListPair.java | 6 +- .../ai/sdk/grounding/model/SearchFilter.java | 6 +- .../grounding/model/TextOnlyBaseChunk.java | 6 +- .../grounding/model/TextSearchRequest.java | 6 +- .../openapi/grounding/api/PipelinesApi.java | 413 ------- .../openapi/grounding/api/RetrievalApi.java | 290 ----- .../openapi/grounding/api/VectorApi.java | 1055 ----------------- .../openapi/grounding/model/ApiError.java | 356 ------ .../openapi/grounding/model/BaseDocument.java | 285 ----- .../openapi/grounding/model/Chunk.java | 284 ----- .../openapi/grounding/model/Collection.java | 325 ----- .../model/CollectionCreatedResponse.java | 234 ---- .../model/CollectionDeletedResponse.java | 234 ---- .../model/CollectionPendingResponse.java | 234 ---- .../grounding/model/CollectionRequest.java | 277 ----- .../model/CollectionsListResponse.java | 250 ---- .../grounding/model/DataRepositories.java | 248 ---- .../grounding/model/DataRepository.java | 336 ------ .../grounding/model/DataRepositoryType.java | 65 - .../model/DataRepositoryWithDocuments.java | 372 ------ .../grounding/model/DetailsErrorResponse.java | 196 --- .../model/DocumentCreateRequest.java | 213 ---- .../grounding/model/DocumentInput.java | 334 ------ .../model/DocumentKeyValueListPair.java | 352 ------ .../grounding/model/DocumentOutput.java | 312 ----- .../grounding/model/DocumentResponse.java | 334 ------ .../model/DocumentUpdateRequest.java | 216 ---- .../model/DocumentWithoutChunks.java | 262 ---- .../openapi/grounding/model/Documents.java | 248 ---- .../grounding/model/DocumentsChunk.java | 361 ------ .../model/DocumentsListResponse.java | 214 ---- .../grounding/model/EmbeddingConfig.java | 159 --- .../openapi/grounding/model/InlineObject.java | 160 --- .../grounding/model/KeyValueListPair.java | 258 ---- .../model/PerFilterSearchResult.java | 261 ---- .../openapi/grounding/model/Pipeline.java | 232 ---- .../model/PipelineConfiguration.java | 199 ---- .../PipelineConfigurationSharePoint.java | 167 --- .../PipelineConfigurationSharePointSite.java | 262 ---- .../openapi/grounding/model/PipelineId.java | 159 --- .../grounding/model/PipelinePostRequst.java | 235 ---- .../PipelinePostRequstConfiguration.java | 228 ---- ...linePostRequstConfigurationSharePoint.java | 172 --- ...PostRequstConfigurationSharePointSite.java | 231 ---- .../grounding/model/PipelineStatus.java | 160 --- .../openapi/grounding/model/Pipelines.java | 248 ---- .../openapi/grounding/model/ResultsInner.java | 259 ---- .../grounding/model/ResultsInner1.java | 285 ----- .../RetievalDataRepositorySearchResult.java | 194 --- .../model/RetievalPerFilterSearchResult.java | 246 ---- ...etievalPerFilterSearchResultWithError.java | 190 --- .../model/RetievalSearchResults.java | 213 ---- .../grounding/model/RetrievalDocument.java | 311 ----- .../model/RetrievalSearchFilter.java | 520 -------- .../grounding/model/RetrievalSearchInput.java | 260 ---- .../grounding/model/SearchConfiguration.java | 207 ---- .../model/SearchDocumentKeyValueListPair.java | 320 ----- .../openapi/grounding/model/SearchFilter.java | 485 -------- .../grounding/model/SearchResults.java | 212 ---- .../model/SearchSelectOptionEnum.java | 65 - .../grounding/model/TextOnlyBaseChunk.java | 260 ---- .../grounding/model/TextSearchRequest.java | 259 ---- ...etCollectionCreationStatus200Response.java | 329 ----- ...etCollectionDeletionStatus200Response.java | 329 ----- .../openapi/sample/api/OrdersApi.java | 99 -- .../openapi/sample/api/SodasApi.java | 210 ---- .../resources/openapi/sample/model/AllOf.java | 231 ---- .../resources/openapi/sample/model/AnyOf.java | 231 ---- .../resources/openapi/sample/model/Cola.java | 195 --- .../resources/openapi/sample/model/Fanta.java | 195 --- .../resources/openapi/sample/model/OneOf.java | 28 - .../sample/model/OneOfWithDiscriminator.java | 30 - .../OneOfWithDiscriminatorAndMapping.java | 32 - .../resources/openapi/sample/model/Order.java | 331 ------ .../sample/model/OrderWithTimestamp.java | 377 ------ .../resources/openapi/sample/model/Soda.java | 415 ------- .../openapi/sample/model/SodaWithId.java | 451 ------- .../sdk/grounding/GroundingServiceTest.java | 133 +++ .../test/resources/__files/errorResponse.json | 7 - .../__files/filteringLooseResponse.json | 86 -- .../resources/__files/groundingResponse.json | 62 - .../resources/__files/maskingResponse.json | 75 -- .../__files/multiChatMessageResponse.json | 67 -- .../streamChatCompletionInputFilter.json | 22 - .../resources/__files/templatingResponse.json | 65 - .../test/resources/filteringLooseRequest.json | 58 - .../test/resources/mappings/pipelines.json | 14 + .../src/test/resources/mappings/vector.json | 127 ++ .../src/test/resources/maskingRequest.json | 43 - .../resources/messagesHistoryRequest.json | 38 - .../resources/multiChatMessageRequest.json | 33 - .../test/resources/streamChatCompletion.txt | 4 - .../streamChatCompletionOutputFilter.txt | 2 - .../src/test/resources/templatingRequest.json | 31 - pom.xml | 2 + 116 files changed, 423 insertions(+), 19996 deletions(-) delete mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java delete mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java create mode 100644 grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java delete mode 100644 grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java delete mode 100644 grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java delete mode 100644 grounding/src/main/resources/openapi/grounding/api/VectorApi.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/ApiError.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/BaseDocument.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/Chunk.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/Collection.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepositories.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepository.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentInput.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/Documents.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/InlineObject.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/Pipeline.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineId.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/Pipelines.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/ResultsInner.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchFilter.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchResults.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java delete mode 100644 grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java delete mode 100644 grounding/src/main/resources/openapi/sample/api/OrdersApi.java delete mode 100644 grounding/src/main/resources/openapi/sample/api/SodasApi.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/AllOf.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/AnyOf.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/Cola.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/Fanta.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/OneOf.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/Order.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/Soda.java delete mode 100644 grounding/src/main/resources/openapi/sample/model/SodaWithId.java create mode 100644 grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java delete mode 100644 grounding/src/test/resources/__files/errorResponse.json delete mode 100644 grounding/src/test/resources/__files/filteringLooseResponse.json delete mode 100644 grounding/src/test/resources/__files/groundingResponse.json delete mode 100644 grounding/src/test/resources/__files/maskingResponse.json delete mode 100644 grounding/src/test/resources/__files/multiChatMessageResponse.json delete mode 100644 grounding/src/test/resources/__files/streamChatCompletionInputFilter.json delete mode 100644 grounding/src/test/resources/__files/templatingResponse.json delete mode 100644 grounding/src/test/resources/filteringLooseRequest.json create mode 100644 grounding/src/test/resources/mappings/pipelines.json create mode 100644 grounding/src/test/resources/mappings/vector.json delete mode 100644 grounding/src/test/resources/maskingRequest.json delete mode 100644 grounding/src/test/resources/messagesHistoryRequest.json delete mode 100644 grounding/src/test/resources/multiChatMessageRequest.json delete mode 100644 grounding/src/test/resources/streamChatCompletion.txt delete mode 100644 grounding/src/test/resources/streamChatCompletionOutputFilter.txt delete mode 100644 grounding/src/test/resources/templatingRequest.json diff --git a/.pipeline/checkstyle-suppressions.xml b/.pipeline/checkstyle-suppressions.xml index b30fd0568..8890b94f0 100644 --- a/.pipeline/checkstyle-suppressions.xml +++ b/.pipeline/checkstyle-suppressions.xml @@ -9,6 +9,8 @@ + + diff --git a/.pipeline/spotbugs-exclusions.xml b/.pipeline/spotbugs-exclusions.xml index 3e709994f..486d65692 100644 --- a/.pipeline/spotbugs-exclusions.xml +++ b/.pipeline/spotbugs-exclusions.xml @@ -5,6 +5,8 @@ + + diff --git a/grounding/pom.xml b/grounding/pom.xml index f602ba7dd..39438f020 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -32,35 +32,35 @@ ${project.basedir}/../ 76% - 90% - 91% - 69% - 70% + 83% + 88% + 100% + 100% 100% + + + org.springframework + spring-core + + + org.springframework + spring-web + com.sap.ai.sdk core - com.sap.cloud.sdk.cloudplatform cloudplatform-connectivity - com.sap.cloud.sdk.cloudplatform - connectivity-apache-httpclient5 - - - org.apache.httpcomponents.core5 - httpcore5 - - - org.apache.httpcomponents.client5 - httpclient5 + com.sap.cloud.sdk.datamodel + openapi-core com.google.code.findbugs @@ -70,18 +70,6 @@ com.fasterxml.jackson.core jackson-annotations - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.core - jackson-databind - - - io.vavr - vavr - org.slf4j slf4j-api @@ -112,16 +100,6 @@ assertj-core test - - org.mockito - mockito-core - test - - - org.junit.jupiter - junit-jupiter-params - test - @@ -144,6 +122,7 @@ true COMPILE true + true diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java deleted file mode 100644 index b76c974c9..000000000 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sap.ai.sdk.grounding; - -import com.sap.ai.sdk.core.AiCoreService; -import com.sap.ai.sdk.core.DeploymentResolutionException; -import com.sap.ai.sdk.grounding.api.PipelinesApi; -import com.sap.ai.sdk.grounding.api.VectorApi; -import com.sap.ai.sdk.grounding.api.RetrievalApi; -import com.sap.ai.sdk.grounding.model.Collection; -import com.sap.ai.sdk.grounding.model.CollectionsListResponse; -import com.sap.ai.sdk.grounding.model.DataRepositories; -import com.sap.ai.sdk.grounding.model.DataRepository; -import com.sap.ai.sdk.grounding.model.DocumentResponse; -import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; -import com.sap.ai.sdk.grounding.model.Documents; -import com.sap.ai.sdk.grounding.model.Pipeline; -import com.sap.ai.sdk.grounding.model.Pipelines; -import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -import javax.annotation.Nonnull; - -/** Client for interacting with OpenAI models. */ -@Slf4j -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public final class GroundingClient { - private static final String DEFAULT_API_VERSION = "2024-02-01"; - //static final ObjectMapper JACKSON = getDefaultObjectMapper(); - // @Nonnull private final Destination destination; - - /** - * Create a new OpenAI client for the given foundation model, using the default resource group. - * - * @param foundationModel the OpenAI model which is deployed. - * @return a new OpenAI client. - * @throws DeploymentResolutionException if no deployment for the given model was found in the - * default resource group. - */ - @Nonnull - public static void main(String[] args) - throws DeploymentResolutionException { - String RESOURCE_GROUP = "default"; - - ApiClient apiClient = new AiCoreService().getApiClient(); - apiClient.setBasePath(apiClient.getBasePath()+"lm/document-grounding/"); - - - PipelinesApi pipelinesApi = new PipelinesApi(apiClient); - Pipelines allPipelines = pipelinesApi.getAllPipelines(RESOURCE_GROUP, 10, 0, true); - for (Pipeline pipeline : allPipelines.getResources()) { - System.out.println(pipeline); - } - - RetrievalApi retrievalApi = new RetrievalApi(apiClient); - DataRepositories repositories = retrievalApi.getDataRepositories(RESOURCE_GROUP); - for (DataRepository repository : repositories.getResources()) { - System.out.println(repository); - DataRepository repoById = retrievalApi.getDataRepositoryById(RESOURCE_GROUP, repository.getId()); - System.out.println(repoById); - } - System.out.println(repositories); - - - VectorApi vectorApi = new VectorApi(apiClient); - CollectionsListResponse allCollections = vectorApi.getAllCollections(RESOURCE_GROUP); - for (Collection documentCollection : allCollections.getResources()) { - System.out.println(documentCollection); - Documents documents = vectorApi.getAllDocuments(RESOURCE_GROUP, documentCollection.getId(), 10, 0, true); - System.out.println(documents); - System.out.println(); - - for (DocumentWithoutChunks aDefault1Resource : documents.getResources()) { - DocumentResponse document = vectorApi.getDocumentById(RESOURCE_GROUP, documentCollection.getId(), aDefault1Resource.getId()); - System.out.println(document); - System.out.println(); - } - } - System.out.println(allCollections); - - } -} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java deleted file mode 100644 index ae92aa11d..000000000 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClientException.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sap.ai.sdk.grounding; - -import com.sap.ai.sdk.core.common.ClientException; -import lombok.experimental.StandardException; - -/** Generic exception for errors occurring when using OpenAI foundation models. */ -@StandardException -public class GroundingClientException extends ClientException {} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java new file mode 100644 index 000000000..8bedbfa6a --- /dev/null +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java @@ -0,0 +1,89 @@ +package com.sap.ai.sdk.grounding; + +import com.google.common.annotations.Beta; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.grounding.api.PipelinesApi; +import com.sap.ai.sdk.grounding.api.RetrievalApi; +import com.sap.ai.sdk.grounding.api.VectorApi; +import javax.annotation.Nonnull; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; + +/** + * Service class for the Grounding APIs. + * + * @since 1.3.0 + */ +@Beta +@RequiredArgsConstructor(access = AccessLevel.PROTECTED) +public class GroundingService { + + final AiCoreService aiCoreService; + final String basePath; + + static final String DEFAULT_BASE_PATH = "lm/document-grounding/"; + + /** + * Create a new instance of the GroundingService. + * + * @return A new instance of the GroundingService. + */ + @Nonnull + public static GroundingService create() { + return create(new AiCoreService()); + } + + /** + * Create a new instance of the GroundingService. + * + * @param aiCoreService The AiCoreService instance to use. + * @return A new instance of the GroundingService. + */ + @Nonnull + public static GroundingService create(@Nonnull final AiCoreService aiCoreService) { + return create(aiCoreService, DEFAULT_BASE_PATH); + } + + /** + * Create a new instance of the GroundingService. + * + * @param aiCoreService The AiCoreService instance to use. + * @param basePath The base path to use for the API calls. + * @return A new instance of the GroundingService. + */ + @Nonnull + public static GroundingService create( + @Nonnull final AiCoreService aiCoreService, @Nonnull final String basePath) { + return new GroundingService(aiCoreService, basePath); + } + + /** + * Get the Pipelines API. + * + * @return The Pipelines API. + */ + @Nonnull + public PipelinesApi pipelines() { + return new PipelinesApi(aiCoreService.getApiClient().setBasePath(basePath)); + } + + /** + * Get the Vector API. + * + * @return The Vector API. + */ + @Nonnull + public VectorApi vector() { + return new VectorApi(aiCoreService.getApiClient().setBasePath(basePath)); + } + + /** + * Get the Retrieval API. + * + * @return The Retrieval API. + */ + @Nonnull + public RetrievalApi retrieval() { + return new RetrievalApi(aiCoreService.getApiClient().setBasePath(basePath)); + } +} diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java index 3604735ec..787f9add5 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** Base class for documents, document requests and responses. */ @Beta // CHECKSTYLE:OFF -public class BaseDocument +public class BaseDocument // CHECKSTYLE:ON { @JsonProperty("chunks") @@ -189,8 +188,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final BaseDocument baseDocument = (BaseDocument) o; return Objects.equals(this.cloudSdkCustomFields, baseDocument.cloudSdkCustomFields) && Objects.equals(this.chunks, baseDocument.chunks) - && Objects.equals(this.metadata, baseDocument.metadata) - && super.equals(o); + && Objects.equals(this.metadata, baseDocument.metadata); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java index e4d87b255..0b97bb7ad 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -30,7 +29,7 @@ /** A request for creating a new, single collection. */ @Beta // CHECKSTYLE:OFF -public class CollectionRequest +public class CollectionRequest // CHECKSTYLE:ON { @JsonProperty("title") @@ -211,8 +210,7 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals(this.cloudSdkCustomFields, collectionRequest.cloudSdkCustomFields) && Objects.equals(this.title, collectionRequest.title) && Objects.equals(this.embeddingConfig, collectionRequest.embeddingConfig) - && Objects.equals(this.metadata, collectionRequest.metadata) - && super.equals(o); + && Objects.equals(this.metadata, collectionRequest.metadata); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java index 080765fdd..ac7765860 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** A create request containing one or more new documents to create and store in a collection. */ @Beta // CHECKSTYLE:OFF -public class DocumentCreateRequest +public class DocumentCreateRequest // CHECKSTYLE:ON { @JsonProperty("documents") @@ -140,8 +139,7 @@ public boolean equals(@Nullable final java.lang.Object o) { } final DocumentCreateRequest documentCreateRequest = (DocumentCreateRequest) o; return Objects.equals(this.cloudSdkCustomFields, documentCreateRequest.cloudSdkCustomFields) - && Objects.equals(this.documents, documentCreateRequest.documents) - && super.equals(o); + && Objects.equals(this.documents, documentCreateRequest.documents); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java index feca3b78a..ed44e887e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -32,7 +31,7 @@ /** A single document stored in a collection by ID. */ @Beta // CHECKSTYLE:OFF -public class DocumentInput +public class DocumentInput // CHECKSTYLE:ON { @JsonProperty("chunks") @@ -225,8 +224,7 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals(this.cloudSdkCustomFields, documentInput.cloudSdkCustomFields) && Objects.equals(this.chunks, documentInput.chunks) && Objects.equals(this.metadata, documentInput.metadata) - && Objects.equals(this.id, documentInput.id) - && super.equals(o); + && Objects.equals(this.id, documentInput.id); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java index 84f366ff8..9ab43228c 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java @@ -21,7 +21,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -33,7 +32,7 @@ /** DocumentKeyValueListPair */ @Beta // CHECKSTYLE:OFF -public class DocumentKeyValueListPair +public class DocumentKeyValueListPair // CHECKSTYLE:ON { @JsonProperty("key") @@ -270,8 +269,7 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals(this.cloudSdkCustomFields, documentKeyValueListPair.cloudSdkCustomFields) && Objects.equals(this.key, documentKeyValueListPair.key) && Objects.equals(this.value, documentKeyValueListPair.value) - && Objects.equals(this.matchMode, documentKeyValueListPair.matchMode) - && super.equals(o); + && Objects.equals(this.matchMode, documentKeyValueListPair.matchMode); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java index adcfff5d9..46ce6d13a 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -34,7 +33,7 @@ * by ID. */ @Beta // CHECKSTYLE:OFF -public class DocumentUpdateRequest +public class DocumentUpdateRequest // CHECKSTYLE:ON { @JsonProperty("documents") @@ -143,8 +142,7 @@ public boolean equals(@Nullable final java.lang.Object o) { } final DocumentUpdateRequest documentUpdateRequest = (DocumentUpdateRequest) o; return Objects.equals(this.cloudSdkCustomFields, documentUpdateRequest.cloudSdkCustomFields) - && Objects.equals(this.documents, documentUpdateRequest.documents) - && super.equals(o); + && Objects.equals(this.documents, documentUpdateRequest.documents); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java index 15989a20d..734d8c709 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -28,7 +27,7 @@ /** EmbeddingConfig */ @Beta // CHECKSTYLE:OFF -public class EmbeddingConfig +public class EmbeddingConfig // CHECKSTYLE:ON { @JsonProperty("modelName") @@ -121,8 +120,7 @@ public boolean equals(@Nullable final java.lang.Object o) { } final EmbeddingConfig embeddingConfig = (EmbeddingConfig) o; return Objects.equals(this.cloudSdkCustomFields, embeddingConfig.cloudSdkCustomFields) - && Objects.equals(this.modelName, embeddingConfig.modelName) - && super.equals(o); + && Objects.equals(this.modelName, embeddingConfig.modelName); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java index c58b966e1..c2c37f61a 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** KeyValueListPair */ @Beta // CHECKSTYLE:OFF -public class KeyValueListPair +public class KeyValueListPair // CHECKSTYLE:ON { @JsonProperty("key") @@ -174,8 +173,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final KeyValueListPair keyValueListPair = (KeyValueListPair) o; return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) && Objects.equals(this.key, keyValueListPair.key) - && Objects.equals(this.value, keyValueListPair.value) - && super.equals(o); + && Objects.equals(this.value, keyValueListPair.value); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java index 9fcb96929..a60194a42 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -28,7 +27,7 @@ /** PipelinePostRequst */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequst +public class PipelinePostRequst // CHECKSTYLE:ON { @JsonProperty("type") @@ -158,8 +157,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final PipelinePostRequst pipelinePostRequst = (PipelinePostRequst) o; return Objects.equals(this.cloudSdkCustomFields, pipelinePostRequst.cloudSdkCustomFields) && Objects.equals(this.type, pipelinePostRequst.type) - && Objects.equals(this._configuration, pipelinePostRequst._configuration) - && super.equals(o); + && Objects.equals(this._configuration, pipelinePostRequst._configuration); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java index 0b4e02e2b..38e63e3b6 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -28,7 +27,7 @@ /** PipelinePostRequstConfiguration */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequstConfiguration +public class PipelinePostRequstConfiguration // CHECKSTYLE:ON { @JsonProperty("destination") @@ -164,8 +163,7 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals( this.cloudSdkCustomFields, pipelinePostRequstConfiguration.cloudSdkCustomFields) && Objects.equals(this.destination, pipelinePostRequstConfiguration.destination) - && Objects.equals(this.sharePoint, pipelinePostRequstConfiguration.sharePoint) - && super.equals(o); + && Objects.equals(this.sharePoint, pipelinePostRequstConfiguration.sharePoint); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java index 80da17dec..468ea04ed 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -28,7 +27,7 @@ /** PipelinePostRequstConfigurationSharePoint */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePoint +public class PipelinePostRequstConfigurationSharePoint // CHECKSTYLE:ON { @JsonProperty("site") @@ -130,8 +129,7 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals( this.cloudSdkCustomFields, pipelinePostRequstConfigurationSharePoint.cloudSdkCustomFields) - && Objects.equals(this.site, pipelinePostRequstConfigurationSharePoint.site) - && super.equals(o); + && Objects.equals(this.site, pipelinePostRequstConfigurationSharePoint.site); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java index d285a522e..242ae7d9d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -30,7 +29,7 @@ /** PipelinePostRequstConfigurationSharePointSite */ @Beta // CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePointSite +public class PipelinePostRequstConfigurationSharePointSite // CHECKSTYLE:ON { @JsonProperty("name") @@ -189,8 +188,7 @@ public boolean equals(@Nullable final java.lang.Object o) { pipelinePostRequstConfigurationSharePointSite.cloudSdkCustomFields) && Objects.equals(this.name, pipelinePostRequstConfigurationSharePointSite.name) && Objects.equals( - this.includePaths, pipelinePostRequstConfigurationSharePointSite.includePaths) - && super.equals(o); + this.includePaths, pipelinePostRequstConfigurationSharePointSite.includePaths); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java index 3a7840847..fcf8727a4 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** Limit scope of search to certain DataRepositories, Documents or Chunks. */ @Beta // CHECKSTYLE:OFF -public class RetrievalSearchFilter +public class RetrievalSearchFilter // CHECKSTYLE:ON { @JsonProperty("id") @@ -423,8 +422,7 @@ public boolean equals(@Nullable final java.lang.Object o) { && Objects.equals(this.dataRepositoryType, retrievalSearchFilter.dataRepositoryType) && Objects.equals(this.dataRepositoryMetadata, retrievalSearchFilter.dataRepositoryMetadata) && Objects.equals(this.documentMetadata, retrievalSearchFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, retrievalSearchFilter.chunkMetadata) - && super.equals(o); + && Objects.equals(this.chunkMetadata, retrievalSearchFilter.chunkMetadata); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java index a99f9a10f..9f6a77bfb 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** RetrievalSearchInput */ @Beta // CHECKSTYLE:OFF -public class RetrievalSearchInput +public class RetrievalSearchInput // CHECKSTYLE:ON { @JsonProperty("query") @@ -175,8 +174,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final RetrievalSearchInput retrievalSearchInput = (RetrievalSearchInput) o; return Objects.equals(this.cloudSdkCustomFields, retrievalSearchInput.cloudSdkCustomFields) && Objects.equals(this.query, retrievalSearchInput.query) - && Objects.equals(this.filters, retrievalSearchInput.filters) - && super.equals(o); + && Objects.equals(this.filters, retrievalSearchInput.filters); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java index 6ecfc212d..d5d81cb89 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -28,7 +27,7 @@ /** SearchConfiguration */ @Beta // CHECKSTYLE:OFF -public class SearchConfiguration +public class SearchConfiguration // CHECKSTYLE:ON { @JsonProperty("maxChunkCount") @@ -168,8 +167,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final SearchConfiguration searchConfiguration = (SearchConfiguration) o; return Objects.equals(this.cloudSdkCustomFields, searchConfiguration.cloudSdkCustomFields) && Objects.equals(this.maxChunkCount, searchConfiguration.maxChunkCount) - && Objects.equals(this.maxDocumentCount, searchConfiguration.maxDocumentCount) - && super.equals(o); + && Objects.equals(this.maxDocumentCount, searchConfiguration.maxDocumentCount); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java index b62814d7d..9f0e66b8a 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** SearchDocumentKeyValueListPair */ @Beta // CHECKSTYLE:OFF -public class SearchDocumentKeyValueListPair +public class SearchDocumentKeyValueListPair // CHECKSTYLE:ON { @JsonProperty("key") @@ -234,8 +233,7 @@ public boolean equals(@Nullable final java.lang.Object o) { this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) && Objects.equals(this.key, searchDocumentKeyValueListPair.key) && Objects.equals(this.value, searchDocumentKeyValueListPair.value) - && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode) - && super.equals(o); + && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java index 7dda18d21..9651740d1 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** SearchFilter */ @Beta // CHECKSTYLE:OFF -public class SearchFilter +public class SearchFilter // CHECKSTYLE:ON { @JsonProperty("id") @@ -369,8 +368,7 @@ public boolean equals(@Nullable final java.lang.Object o) { && Objects.equals(this._configuration, searchFilter._configuration) && Objects.equals(this.collectionMetadata, searchFilter.collectionMetadata) && Objects.equals(this.documentMetadata, searchFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, searchFilter.chunkMetadata) - && super.equals(o); + && Objects.equals(this.chunkMetadata, searchFilter.chunkMetadata); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java index c60b410bd..c23a41cf2 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** TextOnlyBaseChunk */ @Beta // CHECKSTYLE:OFF -public class TextOnlyBaseChunk +public class TextOnlyBaseChunk // CHECKSTYLE:ON { @JsonProperty("content") @@ -174,8 +173,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final TextOnlyBaseChunk textOnlyBaseChunk = (TextOnlyBaseChunk) o; return Objects.equals(this.cloudSdkCustomFields, textOnlyBaseChunk.cloudSdkCustomFields) && Objects.equals(this.content, textOnlyBaseChunk.content) - && Objects.equals(this.metadata, textOnlyBaseChunk.metadata) - && super.equals(o); + && Objects.equals(this.metadata, textOnlyBaseChunk.metadata); } @Override diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java index 0ec6de989..5f94a882f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java @@ -19,7 +19,6 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,7 @@ /** TextSearchRequest */ @Beta // CHECKSTYLE:OFF -public class TextSearchRequest +public class TextSearchRequest // CHECKSTYLE:ON { @JsonProperty("query") @@ -174,8 +173,7 @@ public boolean equals(@Nullable final java.lang.Object o) { final TextSearchRequest textSearchRequest = (TextSearchRequest) o; return Objects.equals(this.cloudSdkCustomFields, textSearchRequest.cloudSdkCustomFields) && Objects.equals(this.query, textSearchRequest.query) - && Objects.equals(this.filters, textSearchRequest.filters) - && super.equals(o); + && Objects.equals(this.filters, textSearchRequest.filters); } @Override diff --git a/grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java b/grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java deleted file mode 100644 index fcc92689a..000000000 --- a/grounding/src/main/resources/openapi/grounding/api/PipelinesApi.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -package openapi.grounding.api; - -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Pipeline; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineId; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequst; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineStatus; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Pipelines; -import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; -import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; - -/** - * Document Grounding Pipeline API in version 0.1.0. - * - *

SAP AI Core - API Specification AI Data Management api's - */ -public class PipelinesApi extends AbstractOpenApiService { - /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. - * - * @param httpDestination The destination that API should be used with - */ - public PipelinesApi(@Nonnull final Destination httpDestination) { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based - * on a given {@link ApiClient}. - * - * @param apiClient ApiClient to invoke the API on - */ - @Beta - public PipelinesApi(@Nonnull final ApiClient apiClient) { - super(apiClient); - } - - /** - * Create a pipeline - * - *

201 - Returns pipelineId on successful creation. - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param pipelinePostRequst The value for the parameter pipelinePostRequst - * @return PipelineId - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public PipelineId createPipeline( - @Nonnull final String aiResourceGroup, @Nonnull final PipelinePostRequst pipelinePostRequst) - throws OpenApiRequestException { - final Object localVarPostBody = pipelinePostRequst; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling createPipeline"); - } - - // verify the required parameter 'pipelinePostRequst' is set - if (pipelinePostRequst == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'pipelinePostRequst' when calling pipelineV1PipelineEndpointsCreatePipeline"); - } - - final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.POST, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Delete a pipeline by pipeline id - * - *

204 - No Content - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param pipelineId The ID of the pipeline to delete. - * @return An OpenApiResponse containing the status code of the HttpResponse. - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public OpenApiResponse deletePipelineById( - @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling deletePipelineById"); - } - - // verify the required parameter 'pipelineId' is set - if (pipelineId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling deletePipelineById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("pipelineId", pipelineId); - final String localVarPath = - UriComponentsBuilder.fromPath("/pipelines/{pipelineId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - apiClient.invokeAPI( - localVarPath, - HttpMethod.DELETE, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - return new OpenApiResponse(apiClient); - } - - /** - * Get all pipelines - * - *

200 - Returns all pipelines for the tenant. - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup - * @param $top (optional) Number of results to display - * @param $skip (optional) Number of results to be skipped from the ordered list of results - * @param $count (optional) When the $count field is set to false, the response contains a count - * of the items present in the response. When the $count field is set to true, the response - * contains a count of all the items present on the server, and not just the ones in the - * response. When the $count field is not passed, it is false by default. - * @return Pipelines - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Pipelines getAllPipelines( - @Nonnull final String aiResourceGroup, - @Nullable final Integer $top, - @Nullable final Integer $skip, - @Nullable final Boolean $count) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getAllPipelines"); - } - - final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get all pipelines - * - *

200 - Returns all pipelines for the tenant. - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @return Pipelines - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Pipelines getAllPipelines(@Nonnull final String aiResourceGroup) - throws OpenApiRequestException { - return getAllPipelines(aiResourceGroup, null, null, null); - } - - /** - * Get details of a pipeline by pipeline id - * - *

200 - Returns the pipeline for an pipelineId - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param pipelineId The ID of the pipeline to get. - * @return Pipeline - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Pipeline getPipelineById( - @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getPipelineById"); - } - - // verify the required parameter 'pipelineId' is set - if (pipelineId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling getPipelineById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("pipelineId", pipelineId); - final String localVarPath = - UriComponentsBuilder.fromPath("/pipelines/{pipelineId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get pipeline status by pipeline id - * - *

200 - Returns the pipeline status for an pipelineId. - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param pipelineId The ID of the pipeline to get status. - * @return PipelineStatus - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public PipelineStatus getPipelineStatus( - @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatus"); - } - - // verify the required parameter 'pipelineId' is set - if (pipelineId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling getPipelineStatus"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("pipelineId", pipelineId); - final String localVarPath = - UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/status") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java b/grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java deleted file mode 100644 index 8a2a2e5f9..000000000 --- a/grounding/src/main/resources/openapi/grounding/api/RetrievalApi.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -package openapi.grounding.api; - -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositories; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepository; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetievalSearchResults; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetrievalSearchInput; -import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; -import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; - -/** - * Document Grounding Pipeline API in version 0.1.0. - * - *

SAP AI Core - API Specification AI Data Management api's - */ -public class RetrievalApi extends AbstractOpenApiService { - /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. - * - * @param httpDestination The destination that API should be used with - */ - public RetrievalApi(@Nonnull final Destination httpDestination) { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based - * on a given {@link ApiClient}. - * - * @param apiClient ApiClient to invoke the API on - */ - @Beta - public RetrievalApi(@Nonnull final ApiClient apiClient) { - super(apiClient); - } - - /** - * List all DataRepository objects. - * - *

List all DataRepository objects. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup - * @param $top (optional) Number of results to display - * @param $skip (optional) Number of results to be skipped from the ordered list of results - * @param $count (optional) When the $count field is set to false, the response contains a count - * of the items present in the response. When the $count field is set to true, the response - * contains a count of all the items present on the server, and not just the ones in the - * response. When the $count field is not passed, it is false by default. - * @return DataRepositories - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DataRepositories getDataRepositories( - @Nonnull final String aiResourceGroup, - @Nullable final Integer $top, - @Nullable final Integer $skip, - @Nullable final Boolean $count) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getDataRepositories"); - } - - final String localVarPath = - UriComponentsBuilder.fromPath("/retrieval/dataRepositories").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * List all DataRepository objects. - * - *

List all DataRepository objects. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @return DataRepositories - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DataRepositories getDataRepositories(@Nonnull final String aiResourceGroup) - throws OpenApiRequestException { - return getDataRepositories(aiResourceGroup, null, null, null); - } - - /** - * List single DataRepository object. - * - *

List single DataRepository object. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - *

404 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param repositoryId The value for the parameter repositoryId - * @return DataRepository - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DataRepository getDataRepositoryById( - @Nonnull final String aiResourceGroup, @Nonnull final UUID repositoryId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getDataRepositoryById"); - } - - // verify the required parameter 'repositoryId' is set - if (repositoryId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'repositoryId' when calling getDataRepositoryById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("repositoryId", repositoryId); - final String localVarPath = - UriComponentsBuilder.fromPath("/retrieval/dataRepositories/{repositoryId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Retrieve relevant content given a query string. - * - *

Retrieve relevant content given a query string. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param retrievalSearchInput The value for the parameter retrievalSearchInput - * @return RetievalSearchResults - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public RetievalSearchResults search( - @Nonnull final String aiResourceGroup, - @Nonnull final RetrievalSearchInput retrievalSearchInput) - throws OpenApiRequestException { - final Object localVarPostBody = retrievalSearchInput; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling search"); - } - - // verify the required parameter 'retrievalSearchInput' is set - if (retrievalSearchInput == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'retrievalSearchInput' when calling retrievalV1RetrievalEndpointsSearch"); - } - - final String localVarPath = - UriComponentsBuilder.fromPath("/retrieval/search").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.POST, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/api/VectorApi.java b/grounding/src/main/resources/openapi/grounding/api/VectorApi.java deleted file mode 100644 index 1909586a2..000000000 --- a/grounding/src/main/resources/openapi/grounding/api/VectorApi.java +++ /dev/null @@ -1,1055 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -package openapi.grounding.api; - -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Collection; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.CollectionRequest; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.CollectionsListResponse; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentCreateRequest; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentResponse; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentUpdateRequest; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Documents; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentsListResponse; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchResults; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextSearchRequest; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.VectorV1VectorEndpointsGetCollectionCreationStatus200Response; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.VectorV1VectorEndpointsGetCollectionDeletionStatus200Response; -import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; -import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; - -/** - * Document Grounding Pipeline API in version 0.1.0. - * - *

SAP AI Core - API Specification AI Data Management api's - */ -public class VectorApi extends AbstractOpenApiService { - /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. - * - * @param httpDestination The destination that API should be used with - */ - public VectorApi(@Nonnull final Destination httpDestination) { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based - * on a given {@link ApiClient}. - * - * @param apiClient ApiClient to invoke the API on - */ - @Beta - public VectorApi(@Nonnull final ApiClient apiClient) { - super(apiClient); - } - - /** - * Create collection - * - *

Creates a collection. This operation is asynchronous. Poll the collection resource and check - * the status field to understand creation status. - * - *

202 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionRequest The value for the parameter collectionRequest - * @return An OpenApiResponse containing the status code of the HttpResponse. - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public OpenApiResponse createCollection( - @Nonnull final String aiResourceGroup, @Nonnull final CollectionRequest collectionRequest) - throws OpenApiRequestException { - final Object localVarPostBody = collectionRequest; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling createCollection"); - } - - // verify the required parameter 'collectionRequest' is set - if (collectionRequest == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionRequest' when calling vectorV1VectorEndpointsCreateCollection"); - } - - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - apiClient.invokeAPI( - localVarPath, - HttpMethod.POST, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - return new OpenApiResponse(apiClient); - } - - /** - * Create documents in collection - * - *

Create and stores one or multiple documents into a collection. If omitted, 'id' will - * be auto-generated. - * - *

201 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @param documentCreateRequest The value for the parameter documentCreateRequest - * @return DocumentsListResponse - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DocumentsListResponse createDocuments( - @Nonnull final String aiResourceGroup, - @Nonnull final UUID collectionId, - @Nonnull final DocumentCreateRequest documentCreateRequest) - throws OpenApiRequestException { - final Object localVarPostBody = documentCreateRequest; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling createDocuments"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling createDocuments"); - } - - // verify the required parameter 'documentCreateRequest' is set - if (documentCreateRequest == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'documentCreateRequest' when calling vectorV1VectorEndpointsCreateDocuments"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.POST, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Delete collection by ID - * - *

Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for - * a 404 status code. - * - *

202 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @return An OpenApiResponse containing the status code of the HttpResponse. - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public OpenApiResponse deleteCollectionById( - @Nonnull final String aiResourceGroup, @Nonnull final String collectionId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling deleteCollectionById"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling deleteCollectionById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - apiClient.invokeAPI( - localVarPath, - HttpMethod.DELETE, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - return new OpenApiResponse(apiClient); - } - - /** - * Delete a document - * - *

Deletes a specific document of a collection. - * - *

204 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @param documentId The value for the parameter documentId - * @return An OpenApiResponse containing the status code of the HttpResponse. - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public OpenApiResponse deleteDocumentById( - @Nonnull final String aiResourceGroup, - @Nonnull final UUID collectionId, - @Nonnull final UUID documentId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling deleteDocumentById"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling deleteDocumentById"); - } - - // verify the required parameter 'documentId' is set - if (documentId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'documentId' when calling deleteDocumentById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - localVarPathParams.put("documentId", documentId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents/{documentId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - apiClient.invokeAPI( - localVarPath, - HttpMethod.DELETE, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - return new OpenApiResponse(apiClient); - } - - /** - * Get collections - * - *

Gets a list of collections. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup - * @param $top (optional) Number of results to display - * @param $skip (optional) Number of results to be skipped from the ordered list of results - * @param $count (optional) When the $count field is set to false, the response contains a count - * of the items present in the response. When the $count field is set to true, the response - * contains a count of all the items present on the server, and not just the ones in the - * response. When the $count field is not passed, it is false by default. - * @return CollectionsListResponse - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CollectionsListResponse getAllCollections( - @Nonnull final String aiResourceGroup, - @Nullable final Integer $top, - @Nullable final Integer $skip, - @Nullable final Boolean $count) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getAllCollections"); - } - - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get collections - * - *

Gets a list of collections. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @return CollectionsListResponse - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CollectionsListResponse getAllCollections(@Nonnull final String aiResourceGroup) - throws OpenApiRequestException { - return getAllCollections(aiResourceGroup, null, null, null); - } - - /** - * Get documents - * - *

Gets a list of documents of a collection. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup - * @param collectionId (required) The value for the parameter collectionId - * @param $top (optional) Number of results to display - * @param $skip (optional) Number of results to be skipped from the ordered list of results - * @param $count (optional) When the $count field is set to false, the response contains a count - * of the items present in the response. When the $count field is set to true, the response - * contains a count of all the items present on the server, and not just the ones in the - * response. When the $count field is not passed, it is false by default. - * @return Documents - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Documents getAllDocuments( - @Nonnull final String aiResourceGroup, - @Nonnull final UUID collectionId, - @Nullable final Integer $top, - @Nullable final Integer $skip, - @Nullable final Boolean $count) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getAllDocuments"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getAllDocuments"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); - localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get documents - * - *

Gets a list of documents of a collection. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @return Documents - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Documents getAllDocuments( - @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) - throws OpenApiRequestException { - return getAllDocuments(aiResourceGroup, collectionId, null, null, null); - } - - /** - * Get collection by ID - * - *

Gets a specific collection by ID. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @return Collection - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Collection getCollectionById( - @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getCollectionById"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getCollectionById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get collection status by ID - * - *

Gets a specific collection status from monitor by ID. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param id The value for the parameter id - * @return VectorV1VectorEndpointsGetCollectionCreationStatus200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionCreationStatus( - @Nonnull final String aiResourceGroup, @Nonnull final UUID id) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getCollectionCreationStatus"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'id' when calling getCollectionCreationStatus"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("id", id); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{id}/creationStatus") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference - localVarReturnType = - new ParameterizedTypeReference< - VectorV1VectorEndpointsGetCollectionCreationStatus200Response>() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get collection status by ID - * - *

Gets a specific collection status from monitor by ID. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param id The value for the parameter id - * @return VectorV1VectorEndpointsGetCollectionDeletionStatus200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response getCollectionDeletionStatus( - @Nonnull final String aiResourceGroup, @Nonnull final UUID id) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getCollectionDeletionStatus"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'id' when calling getCollectionDeletionStatus"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("id", id); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{id}/deletionStatus") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference - localVarReturnType = - new ParameterizedTypeReference< - VectorV1VectorEndpointsGetCollectionDeletionStatus200Response>() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get document by ID - * - *

Gets a specific document in a collection by ID. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @param documentId The value for the parameter documentId - * @return DocumentResponse - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DocumentResponse getDocumentById( - @Nonnull final String aiResourceGroup, - @Nonnull final UUID collectionId, - @Nonnull final UUID documentId) - throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getDocumentById"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getDocumentById"); - } - - // verify the required parameter 'documentId' is set - if (documentId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'documentId' when calling getDocumentById"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - localVarPathParams.put("documentId", documentId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents/{documentId}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Search chunk by vector - * - *

Search chunk by vector - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param textSearchRequest The value for the parameter textSearchRequest - * @return SearchResults - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public SearchResults search( - @Nonnull final String aiResourceGroup, @Nonnull final TextSearchRequest textSearchRequest) - throws OpenApiRequestException { - final Object localVarPostBody = textSearchRequest; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling search"); - } - - // verify the required parameter 'textSearchRequest' is set - if (textSearchRequest == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'textSearchRequest' when calling vectorV1VectorEndpointsSearch"); - } - - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/search").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.POST, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Upsert documents in collection - * - *

Upserts the data of multiple documents into a collection. - * - *

200 - Successful Response - * - *

400 - The specification of the resource was incorrect - * - *

404 - The specification of the resource was incorrect - * - *

422 - There are validation issues with the data. - * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @param documentUpdateRequest The value for the parameter documentUpdateRequest - * @return DocumentsListResponse - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DocumentsListResponse updateDocuments( - @Nonnull final String aiResourceGroup, - @Nonnull final UUID collectionId, - @Nonnull final DocumentUpdateRequest documentUpdateRequest) - throws OpenApiRequestException { - final Object localVarPostBody = documentUpdateRequest; - - // verify the required parameter 'aiResourceGroup' is set - if (aiResourceGroup == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling updateDocuments"); - } - - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling updateDocuments"); - } - - // verify the required parameter 'documentUpdateRequest' is set - if (documentUpdateRequest == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'documentUpdateRequest' when calling vectorV1VectorEndpointsUpdateDocuments"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("collectionId", collectionId); - final String localVarPath = - UriComponentsBuilder.fromPath("/vector/collections/{collectionId}/documents") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - if (aiResourceGroup != null) - localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.PATCH, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/ApiError.java b/grounding/src/main/resources/openapi/grounding/model/ApiError.java deleted file mode 100644 index 92441759f..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/ApiError.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DetailsErrorResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** ApiError */ -// CHECKSTYLE:OFF -public class ApiError -// CHECKSTYLE:ON -{ - @JsonProperty("code") - private String code; - - @JsonProperty("message") - private String message; - - @JsonProperty("requestId") - private String requestId; - - @JsonProperty("target") - private String target; - - @JsonProperty("details") - private List details = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for ApiError. */ - private ApiError() {} - - /** - * Set the code of this {@link ApiError} instance and return the same instance. - * - * @param code Descriptive error code (not http status code). - * @return The same instance of this {@link ApiError} class - */ - @Nonnull - public ApiError code(@Nonnull final String code) { - this.code = code; - return this; - } - - /** - * Descriptive error code (not http status code). - * - * @return code The code of this {@link ApiError} instance. - */ - @Nonnull - public String getCode() { - return code; - } - - /** - * Set the code of this {@link ApiError} instance. - * - * @param code Descriptive error code (not http status code). - */ - public void setCode(@Nonnull final String code) { - this.code = code; - } - - /** - * Set the message of this {@link ApiError} instance and return the same instance. - * - * @param message plaintext error description - * @return The same instance of this {@link ApiError} class - */ - @Nonnull - public ApiError message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * plaintext error description - * - * @return message The message of this {@link ApiError} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link ApiError} instance. - * - * @param message plaintext error description - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Set the requestId of this {@link ApiError} instance and return the same instance. - * - * @param requestId id of individual request - * @return The same instance of this {@link ApiError} class - */ - @Nonnull - public ApiError requestId(@Nullable final String requestId) { - this.requestId = requestId; - return this; - } - - /** - * id of individual request - * - * @return requestId The requestId of this {@link ApiError} instance. - */ - @Nonnull - public String getRequestId() { - return requestId; - } - - /** - * Set the requestId of this {@link ApiError} instance. - * - * @param requestId id of individual request - */ - public void setRequestId(@Nullable final String requestId) { - this.requestId = requestId; - } - - /** - * Set the target of this {@link ApiError} instance and return the same instance. - * - * @param target url that has been called - * @return The same instance of this {@link ApiError} class - */ - @Nonnull - public ApiError target(@Nullable final String target) { - this.target = target; - return this; - } - - /** - * url that has been called - * - * @return target The target of this {@link ApiError} instance. - */ - @Nonnull - public String getTarget() { - return target; - } - - /** - * Set the target of this {@link ApiError} instance. - * - * @param target url that has been called - */ - public void setTarget(@Nullable final String target) { - this.target = target; - } - - /** - * Set the details of this {@link ApiError} instance and return the same instance. - * - * @param details The details of this {@link ApiError} - * @return The same instance of this {@link ApiError} class - */ - @Nonnull - public ApiError details(@Nullable final List details) { - this.details = details; - return this; - } - - /** - * Add one details instance to this {@link ApiError}. - * - * @param detailsItem The details that should be added - * @return The same instance of type {@link ApiError} - */ - @Nonnull - public ApiError addDetailsItem(@Nonnull final DetailsErrorResponse detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * Get details - * - * @return details The details of this {@link ApiError} instance. - */ - @Nonnull - public List getDetails() { - return details; - } - - /** - * Set the details of this {@link ApiError} instance. - * - * @param details The details of this {@link ApiError} - */ - public void setDetails(@Nullable final List details) { - this.details = details; - } - - /** - * Get the names of the unrecognizable properties of the {@link ApiError}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ApiError} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("ApiError has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link ApiError} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final ApiError apiError = (ApiError) o; - return Objects.equals(this.cloudSdkCustomFields, apiError.cloudSdkCustomFields) - && Objects.equals(this.code, apiError.code) - && Objects.equals(this.message, apiError.message) - && Objects.equals(this.requestId, apiError.requestId) - && Objects.equals(this.target, apiError.target) - && Objects.equals(this.details, apiError.details); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, requestId, target, details, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class ApiError {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); - sb.append(" target: ").append(toIndentedString(target)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link ApiError} instance with - * all required arguments. - */ - public static Builder builder() { - return (code) -> (message) -> () -> new ApiError().code(code).message(message); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the code of this {@link ApiError} instance. - * - * @param code Descriptive error code (not http status code). - * @return The ApiError builder. - */ - Builder1 code(@Nonnull final String code); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link ApiError} instance. - * - * @param message plaintext error description - * @return The ApiError instance. - */ - Builder2 message(@Nonnull final String message); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link ApiError} instance. - * - * @return The ApiError instance. - */ - ApiError build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/BaseDocument.java b/grounding/src/main/resources/openapi/grounding/model/BaseDocument.java deleted file mode 100644 index 958a1d531..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/BaseDocument.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextOnlyBaseChunk; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Base class for documents, document requests and responses. */ -// CHECKSTYLE:OFF -public class BaseDocument -// CHECKSTYLE:ON -{ - @JsonProperty("chunks") - private List chunks = new ArrayList<>(); - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for BaseDocument. */ - private BaseDocument() {} - - /** - * Set the chunks of this {@link BaseDocument} instance and return the same instance. - * - * @param chunks The chunks of this {@link BaseDocument} - * @return The same instance of this {@link BaseDocument} class - */ - @Nonnull - public BaseDocument chunks(@Nonnull final List chunks) { - this.chunks = chunks; - return this; - } - - /** - * Add one chunks instance to this {@link BaseDocument}. - * - * @param chunksItem The chunks that should be added - * @return The same instance of type {@link BaseDocument} - */ - @Nonnull - public BaseDocument addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { - if (this.chunks == null) { - this.chunks = new ArrayList<>(); - } - this.chunks.add(chunksItem); - return this; - } - - /** - * Get chunks - * - * @return chunks The chunks of this {@link BaseDocument} instance. - */ - @Nonnull - public List getChunks() { - return chunks; - } - - /** - * Set the chunks of this {@link BaseDocument} instance. - * - * @param chunks The chunks of this {@link BaseDocument} - */ - public void setChunks(@Nonnull final List chunks) { - this.chunks = chunks; - } - - /** - * Set the metadata of this {@link BaseDocument} instance and return the same instance. - * - * @param metadata The metadata of this {@link BaseDocument} - * @return The same instance of this {@link BaseDocument} class - */ - @Nonnull - public BaseDocument metadata(@Nonnull final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link BaseDocument}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link BaseDocument} - */ - @Nonnull - public BaseDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link BaseDocument} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link BaseDocument} instance. - * - * @param metadata The metadata of this {@link BaseDocument} - */ - public void setMetadata(@Nonnull final List metadata) { - this.metadata = metadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link BaseDocument}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link BaseDocument} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("BaseDocument has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link BaseDocument} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final BaseDocument baseDocument = (BaseDocument) o; - return Objects.equals(this.cloudSdkCustomFields, baseDocument.cloudSdkCustomFields) - && Objects.equals(this.chunks, baseDocument.chunks) - && Objects.equals(this.metadata, baseDocument.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(chunks, metadata, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class BaseDocument {\n"); - sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link BaseDocument} instance - * with all required arguments. - */ - public static Builder builder() { - return (chunks) -> (metadata) -> () -> new BaseDocument().chunks(chunks).metadata(metadata); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the chunks of this {@link BaseDocument} instance. - * - * @param chunks The chunks of this {@link BaseDocument} - * @return The BaseDocument builder. - */ - Builder1 chunks(@Nonnull final List chunks); - - /** - * Set the chunks of this {@link BaseDocument} instance. - * - * @param chunks The chunks of this {@link BaseDocument} - * @return The BaseDocument builder. - */ - default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { - return chunks(Arrays.asList(chunks)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the metadata of this {@link BaseDocument} instance. - * - * @param metadata The metadata of this {@link BaseDocument} - * @return The BaseDocument instance. - */ - Builder2 metadata(@Nonnull final List metadata); - - /** - * Set the metadata of this {@link BaseDocument} instance. - * - * @param metadata The metadata of this {@link BaseDocument} - * @return The BaseDocument instance. - */ - default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { - return metadata(Arrays.asList(metadata)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link BaseDocument} instance. - * - * @return The BaseDocument instance. - */ - BaseDocument build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/Chunk.java b/grounding/src/main/resources/openapi/grounding/model/Chunk.java deleted file mode 100644 index e30a235d0..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/Chunk.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Chunk */ -// CHECKSTYLE:OFF -public class Chunk -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("content") - private String content; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Chunk. */ - private Chunk() {} - - /** - * Set the id of this {@link Chunk} instance and return the same instance. - * - * @param id The id of this {@link Chunk} - * @return The same instance of this {@link Chunk} class - */ - @Nonnull - public Chunk id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link Chunk} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link Chunk} instance. - * - * @param id The id of this {@link Chunk} - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the content of this {@link Chunk} instance and return the same instance. - * - * @param content The content of this {@link Chunk} - * @return The same instance of this {@link Chunk} class - */ - @Nonnull - public Chunk content(@Nonnull final String content) { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link Chunk} instance. - */ - @Nonnull - public String getContent() { - return content; - } - - /** - * Set the content of this {@link Chunk} instance. - * - * @param content The content of this {@link Chunk} - */ - public void setContent(@Nonnull final String content) { - this.content = content; - } - - /** - * Set the metadata of this {@link Chunk} instance and return the same instance. - * - * @param metadata The metadata of this {@link Chunk} - * @return The same instance of this {@link Chunk} class - */ - @Nonnull - public Chunk metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link Chunk}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link Chunk} - */ - @Nonnull - public Chunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link Chunk} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link Chunk} instance. - * - * @param metadata The metadata of this {@link Chunk} - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link Chunk}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Chunk} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Chunk has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Chunk} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Chunk chunk = (Chunk) o; - return Objects.equals(this.cloudSdkCustomFields, chunk.cloudSdkCustomFields) - && Objects.equals(this.id, chunk.id) - && Objects.equals(this.content, chunk.content) - && Objects.equals(this.metadata, chunk.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(id, content, metadata, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Chunk {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link Chunk} instance with - * all required arguments. - */ - public static Builder builder() { - return (id) -> (content) -> () -> new Chunk().id(id).content(content); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link Chunk} instance. - * - * @param id The id of this {@link Chunk} - * @return The Chunk builder. - */ - Builder1 id(@Nonnull final String id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the content of this {@link Chunk} instance. - * - * @param content The content of this {@link Chunk} - * @return The Chunk instance. - */ - Builder2 content(@Nonnull final String content); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link Chunk} instance. - * - * @return The Chunk instance. - */ - Chunk build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/Collection.java b/grounding/src/main/resources/openapi/grounding/model/Collection.java deleted file mode 100644 index fdcf79a8f..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/Collection.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.EmbeddingConfig; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A logical grouping of content. */ -// CHECKSTYLE:OFF -public class Collection -// CHECKSTYLE:ON -{ - @JsonProperty("title") - private String title; - - @JsonProperty("embeddingConfig") - private EmbeddingConfig embeddingConfig; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("id") - private UUID id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Collection. */ - private Collection() {} - - /** - * Set the title of this {@link Collection} instance and return the same instance. - * - * @param title The title of this {@link Collection} - * @return The same instance of this {@link Collection} class - */ - @Nonnull - public Collection title(@Nullable final String title) { - this.title = title; - return this; - } - - /** - * Get title - * - * @return title The title of this {@link Collection} instance. - */ - @Nonnull - public String getTitle() { - return title; - } - - /** - * Set the title of this {@link Collection} instance. - * - * @param title The title of this {@link Collection} - */ - public void setTitle(@Nullable final String title) { - this.title = title; - } - - /** - * Set the embeddingConfig of this {@link Collection} instance and return the same instance. - * - * @param embeddingConfig The embeddingConfig of this {@link Collection} - * @return The same instance of this {@link Collection} class - */ - @Nonnull - public Collection embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { - this.embeddingConfig = embeddingConfig; - return this; - } - - /** - * Get embeddingConfig - * - * @return embeddingConfig The embeddingConfig of this {@link Collection} instance. - */ - @Nonnull - public EmbeddingConfig getEmbeddingConfig() { - return embeddingConfig; - } - - /** - * Set the embeddingConfig of this {@link Collection} instance. - * - * @param embeddingConfig The embeddingConfig of this {@link Collection} - */ - public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { - this.embeddingConfig = embeddingConfig; - } - - /** - * Set the metadata of this {@link Collection} instance and return the same instance. - * - * @param metadata Metadata attached to collection. Useful to restrict search to a subset of - * collections. - * @return The same instance of this {@link Collection} class - */ - @Nonnull - public Collection metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link Collection}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link Collection} - */ - @Nonnull - public Collection addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Metadata attached to collection. Useful to restrict search to a subset of collections. - * - * @return metadata The metadata of this {@link Collection} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link Collection} instance. - * - * @param metadata Metadata attached to collection. Useful to restrict search to a subset of - * collections. - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Set the id of this {@link Collection} instance and return the same instance. - * - * @param id Unique identifier of a collection. - * @return The same instance of this {@link Collection} class - */ - @Nonnull - public Collection id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a collection. - * - * @return id The id of this {@link Collection} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link Collection} instance. - * - * @param id Unique identifier of a collection. - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link Collection}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Collection} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Collection has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Collection} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Collection collection = (Collection) o; - return Objects.equals(this.cloudSdkCustomFields, collection.cloudSdkCustomFields) - && Objects.equals(this.title, collection.title) - && Objects.equals(this.embeddingConfig, collection.embeddingConfig) - && Objects.equals(this.metadata, collection.metadata) - && Objects.equals(this.id, collection.id); - } - - @Override - public int hashCode() { - return Objects.hash(title, embeddingConfig, metadata, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Collection {\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link Collection} instance - * with all required arguments. - */ - public static Builder builder() { - return (embeddingConfig) -> - (id) -> () -> new Collection().embeddingConfig(embeddingConfig).id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the embeddingConfig of this {@link Collection} instance. - * - * @param embeddingConfig The embeddingConfig of this {@link Collection} - * @return The Collection builder. - */ - Builder1 embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the id of this {@link Collection} instance. - * - * @param id Unique identifier of a collection. - * @return The Collection instance. - */ - Builder2 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link Collection} instance. - * - * @return The Collection instance. - */ - Collection build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java deleted file mode 100644 index 7ca418652..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/CollectionCreatedResponse.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** CollectionCreatedResponse */ -// CHECKSTYLE:OFF -public class CollectionCreatedResponse -// CHECKSTYLE:ON -{ - @JsonProperty("collectionURL") - private String collectionURL; - - @JsonProperty("status") - private String status; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CollectionCreatedResponse. */ - private CollectionCreatedResponse() {} - - /** - * Set the collectionURL of this {@link CollectionCreatedResponse} instance and return the same - * instance. - * - * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} - * @return The same instance of this {@link CollectionCreatedResponse} class - */ - @Nonnull - public CollectionCreatedResponse collectionURL(@Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - return this; - } - - /** - * Get collectionURL - * - * @return collectionURL The collectionURL of this {@link CollectionCreatedResponse} instance. - */ - @Nonnull - public String getCollectionURL() { - return collectionURL; - } - - /** - * Set the collectionURL of this {@link CollectionCreatedResponse} instance. - * - * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} - */ - public void setCollectionURL(@Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - } - - /** - * Set the status of this {@link CollectionCreatedResponse} instance and return the same instance. - * - * @param status The status of this {@link CollectionCreatedResponse} - * @return The same instance of this {@link CollectionCreatedResponse} class - */ - @Nonnull - public CollectionCreatedResponse status(@Nonnull final String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status The status of this {@link CollectionCreatedResponse} instance. - */ - @Nonnull - public String getStatus() { - return status; - } - - /** - * Set the status of this {@link CollectionCreatedResponse} instance. - * - * @param status The status of this {@link CollectionCreatedResponse} - */ - public void setStatus(@Nonnull final String status) { - this.status = status; - } - - /** - * Get the names of the unrecognizable properties of the {@link CollectionCreatedResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CollectionCreatedResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CollectionCreatedResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link CollectionCreatedResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CollectionCreatedResponse collectionCreatedResponse = (CollectionCreatedResponse) o; - return Objects.equals(this.cloudSdkCustomFields, collectionCreatedResponse.cloudSdkCustomFields) - && Objects.equals(this.collectionURL, collectionCreatedResponse.collectionURL) - && Objects.equals(this.status, collectionCreatedResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(collectionURL, status, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CollectionCreatedResponse {\n"); - sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * CollectionCreatedResponse} instance with all required arguments. - */ - public static Builder builder() { - return (collectionURL) -> - (status) -> - () -> new CollectionCreatedResponse().collectionURL(collectionURL).status(status); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the collectionURL of this {@link CollectionCreatedResponse} instance. - * - * @param collectionURL The collectionURL of this {@link CollectionCreatedResponse} - * @return The CollectionCreatedResponse builder. - */ - Builder1 collectionURL(@Nonnull final String collectionURL); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the status of this {@link CollectionCreatedResponse} instance. - * - * @param status The status of this {@link CollectionCreatedResponse} - * @return The CollectionCreatedResponse instance. - */ - Builder2 status(@Nonnull final String status); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link CollectionCreatedResponse} instance. - * - * @return The CollectionCreatedResponse instance. - */ - CollectionCreatedResponse build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java deleted file mode 100644 index 729e940b5..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/CollectionDeletedResponse.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** CollectionDeletedResponse */ -// CHECKSTYLE:OFF -public class CollectionDeletedResponse -// CHECKSTYLE:ON -{ - @JsonProperty("collectionURL") - private String collectionURL; - - @JsonProperty("status") - private String status; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CollectionDeletedResponse. */ - private CollectionDeletedResponse() {} - - /** - * Set the collectionURL of this {@link CollectionDeletedResponse} instance and return the same - * instance. - * - * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} - * @return The same instance of this {@link CollectionDeletedResponse} class - */ - @Nonnull - public CollectionDeletedResponse collectionURL(@Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - return this; - } - - /** - * Get collectionURL - * - * @return collectionURL The collectionURL of this {@link CollectionDeletedResponse} instance. - */ - @Nonnull - public String getCollectionURL() { - return collectionURL; - } - - /** - * Set the collectionURL of this {@link CollectionDeletedResponse} instance. - * - * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} - */ - public void setCollectionURL(@Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - } - - /** - * Set the status of this {@link CollectionDeletedResponse} instance and return the same instance. - * - * @param status The status of this {@link CollectionDeletedResponse} - * @return The same instance of this {@link CollectionDeletedResponse} class - */ - @Nonnull - public CollectionDeletedResponse status(@Nonnull final String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status The status of this {@link CollectionDeletedResponse} instance. - */ - @Nonnull - public String getStatus() { - return status; - } - - /** - * Set the status of this {@link CollectionDeletedResponse} instance. - * - * @param status The status of this {@link CollectionDeletedResponse} - */ - public void setStatus(@Nonnull final String status) { - this.status = status; - } - - /** - * Get the names of the unrecognizable properties of the {@link CollectionDeletedResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CollectionDeletedResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CollectionDeletedResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link CollectionDeletedResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CollectionDeletedResponse collectionDeletedResponse = (CollectionDeletedResponse) o; - return Objects.equals(this.cloudSdkCustomFields, collectionDeletedResponse.cloudSdkCustomFields) - && Objects.equals(this.collectionURL, collectionDeletedResponse.collectionURL) - && Objects.equals(this.status, collectionDeletedResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(collectionURL, status, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CollectionDeletedResponse {\n"); - sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * CollectionDeletedResponse} instance with all required arguments. - */ - public static Builder builder() { - return (collectionURL) -> - (status) -> - () -> new CollectionDeletedResponse().collectionURL(collectionURL).status(status); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the collectionURL of this {@link CollectionDeletedResponse} instance. - * - * @param collectionURL The collectionURL of this {@link CollectionDeletedResponse} - * @return The CollectionDeletedResponse builder. - */ - Builder1 collectionURL(@Nonnull final String collectionURL); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the status of this {@link CollectionDeletedResponse} instance. - * - * @param status The status of this {@link CollectionDeletedResponse} - * @return The CollectionDeletedResponse instance. - */ - Builder2 status(@Nonnull final String status); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link CollectionDeletedResponse} instance. - * - * @return The CollectionDeletedResponse instance. - */ - CollectionDeletedResponse build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java deleted file mode 100644 index 2bb4ecca9..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/CollectionPendingResponse.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.net.URI; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** CollectionPendingResponse */ -// CHECKSTYLE:OFF -public class CollectionPendingResponse -// CHECKSTYLE:ON -{ - @JsonProperty("Location") - private URI location; - - @JsonProperty("status") - private String status; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CollectionPendingResponse. */ - private CollectionPendingResponse() {} - - /** - * Set the location of this {@link CollectionPendingResponse} instance and return the same - * instance. - * - * @param location The location of this {@link CollectionPendingResponse} - * @return The same instance of this {@link CollectionPendingResponse} class - */ - @Nonnull - public CollectionPendingResponse location(@Nonnull final URI location) { - this.location = location; - return this; - } - - /** - * Get location - * - * @return location The location of this {@link CollectionPendingResponse} instance. - */ - @Nonnull - public URI getLocation() { - return location; - } - - /** - * Set the location of this {@link CollectionPendingResponse} instance. - * - * @param location The location of this {@link CollectionPendingResponse} - */ - public void setLocation(@Nonnull final URI location) { - this.location = location; - } - - /** - * Set the status of this {@link CollectionPendingResponse} instance and return the same instance. - * - * @param status The status of this {@link CollectionPendingResponse} - * @return The same instance of this {@link CollectionPendingResponse} class - */ - @Nonnull - public CollectionPendingResponse status(@Nonnull final String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status The status of this {@link CollectionPendingResponse} instance. - */ - @Nonnull - public String getStatus() { - return status; - } - - /** - * Set the status of this {@link CollectionPendingResponse} instance. - * - * @param status The status of this {@link CollectionPendingResponse} - */ - public void setStatus(@Nonnull final String status) { - this.status = status; - } - - /** - * Get the names of the unrecognizable properties of the {@link CollectionPendingResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CollectionPendingResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CollectionPendingResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link CollectionPendingResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CollectionPendingResponse collectionPendingResponse = (CollectionPendingResponse) o; - return Objects.equals(this.cloudSdkCustomFields, collectionPendingResponse.cloudSdkCustomFields) - && Objects.equals(this.location, collectionPendingResponse.location) - && Objects.equals(this.status, collectionPendingResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(location, status, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CollectionPendingResponse {\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * CollectionPendingResponse} instance with all required arguments. - */ - public static Builder builder() { - return (location) -> - (status) -> () -> new CollectionPendingResponse().location(location).status(status); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the location of this {@link CollectionPendingResponse} instance. - * - * @param location The location of this {@link CollectionPendingResponse} - * @return The CollectionPendingResponse builder. - */ - Builder1 location(@Nonnull final URI location); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the status of this {@link CollectionPendingResponse} instance. - * - * @param status The status of this {@link CollectionPendingResponse} - * @return The CollectionPendingResponse instance. - */ - Builder2 status(@Nonnull final String status); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link CollectionPendingResponse} instance. - * - * @return The CollectionPendingResponse instance. - */ - CollectionPendingResponse build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java b/grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java deleted file mode 100644 index de375980a..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/CollectionRequest.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.EmbeddingConfig; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A request for creating a new, single collection. */ -// CHECKSTYLE:OFF -public class CollectionRequest -// CHECKSTYLE:ON -{ - @JsonProperty("title") - private String title; - - @JsonProperty("embeddingConfig") - private EmbeddingConfig embeddingConfig; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CollectionRequest. */ - private CollectionRequest() {} - - /** - * Set the title of this {@link CollectionRequest} instance and return the same instance. - * - * @param title The title of this {@link CollectionRequest} - * @return The same instance of this {@link CollectionRequest} class - */ - @Nonnull - public CollectionRequest title(@Nullable final String title) { - this.title = title; - return this; - } - - /** - * Get title - * - * @return title The title of this {@link CollectionRequest} instance. - */ - @Nonnull - public String getTitle() { - return title; - } - - /** - * Set the title of this {@link CollectionRequest} instance. - * - * @param title The title of this {@link CollectionRequest} - */ - public void setTitle(@Nullable final String title) { - this.title = title; - } - - /** - * Set the embeddingConfig of this {@link CollectionRequest} instance and return the same - * instance. - * - * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} - * @return The same instance of this {@link CollectionRequest} class - */ - @Nonnull - public CollectionRequest embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { - this.embeddingConfig = embeddingConfig; - return this; - } - - /** - * Get embeddingConfig - * - * @return embeddingConfig The embeddingConfig of this {@link CollectionRequest} instance. - */ - @Nonnull - public EmbeddingConfig getEmbeddingConfig() { - return embeddingConfig; - } - - /** - * Set the embeddingConfig of this {@link CollectionRequest} instance. - * - * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} - */ - public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { - this.embeddingConfig = embeddingConfig; - } - - /** - * Set the metadata of this {@link CollectionRequest} instance and return the same instance. - * - * @param metadata Metadata attached to collection. Useful to restrict search to a subset of - * collections. - * @return The same instance of this {@link CollectionRequest} class - */ - @Nonnull - public CollectionRequest metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link CollectionRequest}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link CollectionRequest} - */ - @Nonnull - public CollectionRequest addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Metadata attached to collection. Useful to restrict search to a subset of collections. - * - * @return metadata The metadata of this {@link CollectionRequest} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link CollectionRequest} instance. - * - * @param metadata Metadata attached to collection. Useful to restrict search to a subset of - * collections. - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link CollectionRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CollectionRequest} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("CollectionRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link CollectionRequest} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CollectionRequest collectionRequest = (CollectionRequest) o; - return Objects.equals(this.cloudSdkCustomFields, collectionRequest.cloudSdkCustomFields) - && Objects.equals(this.title, collectionRequest.title) - && Objects.equals(this.embeddingConfig, collectionRequest.embeddingConfig) - && Objects.equals(this.metadata, collectionRequest.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(title, embeddingConfig, metadata, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CollectionRequest {\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link CollectionRequest} - * instance with all required arguments. - */ - public static Builder builder() { - return (embeddingConfig) -> () -> new CollectionRequest().embeddingConfig(embeddingConfig); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the embeddingConfig of this {@link CollectionRequest} instance. - * - * @param embeddingConfig The embeddingConfig of this {@link CollectionRequest} - * @return The CollectionRequest instance. - */ - Builder1 embeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link CollectionRequest} instance. - * - * @return The CollectionRequest instance. - */ - CollectionRequest build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java b/grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java deleted file mode 100644 index a6bf853bc..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/CollectionsListResponse.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Collection; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A response containing collections retrieved from the server. */ -// CHECKSTYLE:OFF -public class CollectionsListResponse -// CHECKSTYLE:ON -{ - @JsonProperty("resources") - private List resources = new ArrayList<>(); - - @JsonProperty("count") - private Integer count; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CollectionsListResponse. */ - private CollectionsListResponse() {} - - /** - * Set the resources of this {@link CollectionsListResponse} instance and return the same - * instance. - * - * @param resources The resources of this {@link CollectionsListResponse} - * @return The same instance of this {@link CollectionsListResponse} class - */ - @Nonnull - public CollectionsListResponse resources(@Nonnull final List resources) { - this.resources = resources; - return this; - } - - /** - * Add one resources instance to this {@link CollectionsListResponse}. - * - * @param resourcesItem The resources that should be added - * @return The same instance of type {@link CollectionsListResponse} - */ - @Nonnull - public CollectionsListResponse addResourcesItem(@Nonnull final Collection resourcesItem) { - if (this.resources == null) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * - * @return resources The resources of this {@link CollectionsListResponse} instance. - */ - @Nonnull - public List getResources() { - return resources; - } - - /** - * Set the resources of this {@link CollectionsListResponse} instance. - * - * @param resources The resources of this {@link CollectionsListResponse} - */ - public void setResources(@Nonnull final List resources) { - this.resources = resources; - } - - /** - * Set the count of this {@link CollectionsListResponse} instance and return the same instance. - * - * @param count The count of this {@link CollectionsListResponse} - * @return The same instance of this {@link CollectionsListResponse} class - */ - @Nonnull - public CollectionsListResponse count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link CollectionsListResponse} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link CollectionsListResponse} instance. - * - * @param count The count of this {@link CollectionsListResponse} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - - /** - * Get the names of the unrecognizable properties of the {@link CollectionsListResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CollectionsListResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CollectionsListResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link CollectionsListResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CollectionsListResponse collectionsListResponse = (CollectionsListResponse) o; - return Objects.equals(this.cloudSdkCustomFields, collectionsListResponse.cloudSdkCustomFields) - && Objects.equals(this.resources, collectionsListResponse.resources) - && Objects.equals(this.count, collectionsListResponse.count); - } - - @Override - public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CollectionsListResponse {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * CollectionsListResponse} instance with all required arguments. - */ - public static Builder builder() { - return (resources) -> () -> new CollectionsListResponse().resources(resources); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the resources of this {@link CollectionsListResponse} instance. - * - * @param resources The resources of this {@link CollectionsListResponse} - * @return The CollectionsListResponse instance. - */ - Builder1 resources(@Nonnull final List resources); - - /** - * Set the resources of this {@link CollectionsListResponse} instance. - * - * @param resources The resources of this {@link CollectionsListResponse} - * @return The CollectionsListResponse instance. - */ - default Builder1 resources(@Nonnull final Collection... resources) { - return resources(Arrays.asList(resources)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link CollectionsListResponse} instance. - * - * @return The CollectionsListResponse instance. - */ - CollectionsListResponse build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepositories.java b/grounding/src/main/resources/openapi/grounding/model/DataRepositories.java deleted file mode 100644 index d96a81bba..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DataRepositories.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepository; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DataRepositories */ -// CHECKSTYLE:OFF -public class DataRepositories -// CHECKSTYLE:ON -{ - @JsonProperty("resources") - private List resources = new ArrayList<>(); - - @JsonProperty("count") - private Integer count; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DataRepositories. */ - private DataRepositories() {} - - /** - * Set the resources of this {@link DataRepositories} instance and return the same instance. - * - * @param resources The resources of this {@link DataRepositories} - * @return The same instance of this {@link DataRepositories} class - */ - @Nonnull - public DataRepositories resources(@Nonnull final List resources) { - this.resources = resources; - return this; - } - - /** - * Add one resources instance to this {@link DataRepositories}. - * - * @param resourcesItem The resources that should be added - * @return The same instance of type {@link DataRepositories} - */ - @Nonnull - public DataRepositories addResourcesItem(@Nonnull final DataRepository resourcesItem) { - if (this.resources == null) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * - * @return resources The resources of this {@link DataRepositories} instance. - */ - @Nonnull - public List getResources() { - return resources; - } - - /** - * Set the resources of this {@link DataRepositories} instance. - * - * @param resources The resources of this {@link DataRepositories} - */ - public void setResources(@Nonnull final List resources) { - this.resources = resources; - } - - /** - * Set the count of this {@link DataRepositories} instance and return the same instance. - * - * @param count The count of this {@link DataRepositories} - * @return The same instance of this {@link DataRepositories} class - */ - @Nonnull - public DataRepositories count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link DataRepositories} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link DataRepositories} instance. - * - * @param count The count of this {@link DataRepositories} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - - /** - * Get the names of the unrecognizable properties of the {@link DataRepositories}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DataRepositories} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("DataRepositories has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DataRepositories} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DataRepositories dataRepositories = (DataRepositories) o; - return Objects.equals(this.cloudSdkCustomFields, dataRepositories.cloudSdkCustomFields) - && Objects.equals(this.resources, dataRepositories.resources) - && Objects.equals(this.count, dataRepositories.count); - } - - @Override - public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DataRepositories {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DataRepositories} - * instance with all required arguments. - */ - public static Builder builder() { - return (resources) -> () -> new DataRepositories().resources(resources); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the resources of this {@link DataRepositories} instance. - * - * @param resources The resources of this {@link DataRepositories} - * @return The DataRepositories instance. - */ - Builder1 resources(@Nonnull final List resources); - - /** - * Set the resources of this {@link DataRepositories} instance. - * - * @param resources The resources of this {@link DataRepositories} - * @return The DataRepositories instance. - */ - default Builder1 resources(@Nonnull final DataRepository... resources) { - return resources(Arrays.asList(resources)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link DataRepositories} instance. - * - * @return The DataRepositories instance. - */ - DataRepositories build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepository.java b/grounding/src/main/resources/openapi/grounding/model/DataRepository.java deleted file mode 100644 index f787127b4..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DataRepository.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositoryType; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DataRepository schema expected by Retrieval. */ -// CHECKSTYLE:OFF -public class DataRepository -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private UUID id; - - @JsonProperty("title") - private String title; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("type") - private DataRepositoryType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DataRepository. */ - private DataRepository() {} - - /** - * Set the id of this {@link DataRepository} instance and return the same instance. - * - * @param id Unique identifier of this DataRepository. - * @return The same instance of this {@link DataRepository} class - */ - @Nonnull - public DataRepository id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Unique identifier of this DataRepository. - * - * @return id The id of this {@link DataRepository} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DataRepository} instance. - * - * @param id Unique identifier of this DataRepository. - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Set the title of this {@link DataRepository} instance and return the same instance. - * - * @param title The title of this {@link DataRepository} - * @return The same instance of this {@link DataRepository} class - */ - @Nonnull - public DataRepository title(@Nonnull final String title) { - this.title = title; - return this; - } - - /** - * Get title - * - * @return title The title of this {@link DataRepository} instance. - */ - @Nonnull - public String getTitle() { - return title; - } - - /** - * Set the title of this {@link DataRepository} instance. - * - * @param title The title of this {@link DataRepository} - */ - public void setTitle(@Nonnull final String title) { - this.title = title; - } - - /** - * Set the metadata of this {@link DataRepository} instance and return the same instance. - * - * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset - * of DataRepositories. - * @return The same instance of this {@link DataRepository} class - */ - @Nonnull - public DataRepository metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DataRepository}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DataRepository} - */ - @Nonnull - public DataRepository addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Metadata attached to DataRepository. Useful to later limit search to a subset of - * DataRepositories. - * - * @return metadata The metadata of this {@link DataRepository} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DataRepository} instance. - * - * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset - * of DataRepositories. - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Set the type of this {@link DataRepository} instance and return the same instance. - * - * @param type The type of this {@link DataRepository} - * @return The same instance of this {@link DataRepository} class - */ - @Nonnull - public DataRepository type(@Nullable final DataRepositoryType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link DataRepository} instance. - */ - @Nullable - public DataRepositoryType getType() { - return type; - } - - /** - * Set the type of this {@link DataRepository} instance. - * - * @param type The type of this {@link DataRepository} - */ - public void setType(@Nullable final DataRepositoryType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link DataRepository}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DataRepository} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("DataRepository has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DataRepository} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DataRepository dataRepository = (DataRepository) o; - return Objects.equals(this.cloudSdkCustomFields, dataRepository.cloudSdkCustomFields) - && Objects.equals(this.id, dataRepository.id) - && Objects.equals(this.title, dataRepository.title) - && Objects.equals(this.metadata, dataRepository.metadata) - && Objects.equals(this.type, dataRepository.type); - } - - @Override - public int hashCode() { - return Objects.hash(id, title, metadata, type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DataRepository {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DataRepository} - * instance with all required arguments. - */ - public static Builder builder() { - return (id) -> (title) -> (type) -> () -> new DataRepository().id(id).title(title).type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link DataRepository} instance. - * - * @param id Unique identifier of this DataRepository. - * @return The DataRepository builder. - */ - Builder1 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the title of this {@link DataRepository} instance. - * - * @param title The title of this {@link DataRepository} - * @return The DataRepository builder. - */ - Builder2 title(@Nonnull final String title); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the type of this {@link DataRepository} instance. - * - * @param type The type of this {@link DataRepository} - * @return The DataRepository instance. - */ - Builder3 type(@Nullable final DataRepositoryType type); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link DataRepository} instance. - * - * @return The DataRepository instance. - */ - DataRepository build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java b/grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java deleted file mode 100644 index 3e812b202..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DataRepositoryType.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** Gets or Sets DataRepositoryType */ -public enum DataRepositoryType { - VECTOR("vector"); - - private final String value; - - DataRepositoryType(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static DataRepositoryType fromValue(@Nonnull final String value) { - for (final DataRepositoryType b : DataRepositoryType.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java b/grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java deleted file mode 100644 index 8214f2afd..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DataRepositoryWithDocuments.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetrievalDocument; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DataRepository schema returned by the Vector search endpoint */ -// CHECKSTYLE:OFF -public class DataRepositoryWithDocuments -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private UUID id; - - @JsonProperty("title") - private String title; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("documents") - private List documents = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DataRepositoryWithDocuments. */ - private DataRepositoryWithDocuments() {} - - /** - * Set the id of this {@link DataRepositoryWithDocuments} instance and return the same instance. - * - * @param id Unique identifier of this DataRepository. - * @return The same instance of this {@link DataRepositoryWithDocuments} class - */ - @Nonnull - public DataRepositoryWithDocuments id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Unique identifier of this DataRepository. - * - * @return id The id of this {@link DataRepositoryWithDocuments} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DataRepositoryWithDocuments} instance. - * - * @param id Unique identifier of this DataRepository. - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Set the title of this {@link DataRepositoryWithDocuments} instance and return the same - * instance. - * - * @param title The title of this {@link DataRepositoryWithDocuments} - * @return The same instance of this {@link DataRepositoryWithDocuments} class - */ - @Nonnull - public DataRepositoryWithDocuments title(@Nonnull final String title) { - this.title = title; - return this; - } - - /** - * Get title - * - * @return title The title of this {@link DataRepositoryWithDocuments} instance. - */ - @Nonnull - public String getTitle() { - return title; - } - - /** - * Set the title of this {@link DataRepositoryWithDocuments} instance. - * - * @param title The title of this {@link DataRepositoryWithDocuments} - */ - public void setTitle(@Nonnull final String title) { - this.title = title; - } - - /** - * Set the metadata of this {@link DataRepositoryWithDocuments} instance and return the same - * instance. - * - * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset - * of DataRepositories. - * @return The same instance of this {@link DataRepositoryWithDocuments} class - */ - @Nonnull - public DataRepositoryWithDocuments metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DataRepositoryWithDocuments}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DataRepositoryWithDocuments} - */ - @Nonnull - public DataRepositoryWithDocuments addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Metadata attached to DataRepository. Useful to later limit search to a subset of - * DataRepositories. - * - * @return metadata The metadata of this {@link DataRepositoryWithDocuments} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DataRepositoryWithDocuments} instance. - * - * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset - * of DataRepositories. - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Set the documents of this {@link DataRepositoryWithDocuments} instance and return the same - * instance. - * - * @param documents The documents of this {@link DataRepositoryWithDocuments} - * @return The same instance of this {@link DataRepositoryWithDocuments} class - */ - @Nonnull - public DataRepositoryWithDocuments documents(@Nonnull final List documents) { - this.documents = documents; - return this; - } - - /** - * Add one documents instance to this {@link DataRepositoryWithDocuments}. - * - * @param documentsItem The documents that should be added - * @return The same instance of type {@link DataRepositoryWithDocuments} - */ - @Nonnull - public DataRepositoryWithDocuments addDocumentsItem( - @Nonnull final RetrievalDocument documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - - /** - * Get documents - * - * @return documents The documents of this {@link DataRepositoryWithDocuments} instance. - */ - @Nonnull - public List getDocuments() { - return documents; - } - - /** - * Set the documents of this {@link DataRepositoryWithDocuments} instance. - * - * @param documents The documents of this {@link DataRepositoryWithDocuments} - */ - public void setDocuments(@Nonnull final List documents) { - this.documents = documents; - } - - /** - * Get the names of the unrecognizable properties of the {@link DataRepositoryWithDocuments}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DataRepositoryWithDocuments} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DataRepositoryWithDocuments has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DataRepositoryWithDocuments} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DataRepositoryWithDocuments dataRepositoryWithDocuments = (DataRepositoryWithDocuments) o; - return Objects.equals( - this.cloudSdkCustomFields, dataRepositoryWithDocuments.cloudSdkCustomFields) - && Objects.equals(this.id, dataRepositoryWithDocuments.id) - && Objects.equals(this.title, dataRepositoryWithDocuments.title) - && Objects.equals(this.metadata, dataRepositoryWithDocuments.metadata) - && Objects.equals(this.documents, dataRepositoryWithDocuments.documents); - } - - @Override - public int hashCode() { - return Objects.hash(id, title, metadata, documents, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DataRepositoryWithDocuments {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * DataRepositoryWithDocuments} instance with all required arguments. - */ - public static Builder builder() { - return (id) -> - (title) -> - (documents) -> - () -> new DataRepositoryWithDocuments().id(id).title(title).documents(documents); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link DataRepositoryWithDocuments} instance. - * - * @param id Unique identifier of this DataRepository. - * @return The DataRepositoryWithDocuments builder. - */ - Builder1 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the title of this {@link DataRepositoryWithDocuments} instance. - * - * @param title The title of this {@link DataRepositoryWithDocuments} - * @return The DataRepositoryWithDocuments builder. - */ - Builder2 title(@Nonnull final String title); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the documents of this {@link DataRepositoryWithDocuments} instance. - * - * @param documents The documents of this {@link DataRepositoryWithDocuments} - * @return The DataRepositoryWithDocuments instance. - */ - Builder3 documents(@Nonnull final List documents); - - /** - * Set the documents of this {@link DataRepositoryWithDocuments} instance. - * - * @param documents The documents of this {@link DataRepositoryWithDocuments} - * @return The DataRepositoryWithDocuments instance. - */ - default Builder3 documents(@Nonnull final RetrievalDocument... documents) { - return documents(Arrays.asList(documents)); - } - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link DataRepositoryWithDocuments} instance. - * - * @return The DataRepositoryWithDocuments instance. - */ - DataRepositoryWithDocuments build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java b/grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java deleted file mode 100644 index a7326db5e..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DetailsErrorResponse.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DetailsErrorResponse */ -// CHECKSTYLE:OFF -public class DetailsErrorResponse -// CHECKSTYLE:ON -{ - @JsonProperty("code") - private String code; - - @JsonProperty("message") - private String message; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DetailsErrorResponse. */ - private DetailsErrorResponse() {} - - /** - * Set the code of this {@link DetailsErrorResponse} instance and return the same instance. - * - * @param code Descriptive error code (not http status code) - * @return The same instance of this {@link DetailsErrorResponse} class - */ - @Nonnull - public DetailsErrorResponse code(@Nullable final String code) { - this.code = code; - return this; - } - - /** - * Descriptive error code (not http status code) - * - * @return code The code of this {@link DetailsErrorResponse} instance. - */ - @Nonnull - public String getCode() { - return code; - } - - /** - * Set the code of this {@link DetailsErrorResponse} instance. - * - * @param code Descriptive error code (not http status code) - */ - public void setCode(@Nullable final String code) { - this.code = code; - } - - /** - * Set the message of this {@link DetailsErrorResponse} instance and return the same instance. - * - * @param message Plaintext error description - * @return The same instance of this {@link DetailsErrorResponse} class - */ - @Nonnull - public DetailsErrorResponse message(@Nullable final String message) { - this.message = message; - return this; - } - - /** - * Plaintext error description - * - * @return message The message of this {@link DetailsErrorResponse} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link DetailsErrorResponse} instance. - * - * @param message Plaintext error description - */ - public void setMessage(@Nullable final String message) { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link DetailsErrorResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DetailsErrorResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DetailsErrorResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DetailsErrorResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DetailsErrorResponse detailsErrorResponse = (DetailsErrorResponse) o; - return Objects.equals(this.cloudSdkCustomFields, detailsErrorResponse.cloudSdkCustomFields) - && Objects.equals(this.code, detailsErrorResponse.code) - && Objects.equals(this.message, detailsErrorResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DetailsErrorResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link DetailsErrorResponse} instance. No arguments are required. */ - public static DetailsErrorResponse builder() { - return new DetailsErrorResponse(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java b/grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java deleted file mode 100644 index 84a9972be..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentCreateRequest.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.BaseDocument; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A create request containing one or more new documents to create and store in a collection. */ -// CHECKSTYLE:OFF -public class DocumentCreateRequest -// CHECKSTYLE:ON -{ - @JsonProperty("documents") - private List documents = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentCreateRequest. */ - private DocumentCreateRequest() {} - - /** - * Set the documents of this {@link DocumentCreateRequest} instance and return the same instance. - * - * @param documents The documents of this {@link DocumentCreateRequest} - * @return The same instance of this {@link DocumentCreateRequest} class - */ - @Nonnull - public DocumentCreateRequest documents(@Nonnull final List documents) { - this.documents = documents; - return this; - } - - /** - * Add one documents instance to this {@link DocumentCreateRequest}. - * - * @param documentsItem The documents that should be added - * @return The same instance of type {@link DocumentCreateRequest} - */ - @Nonnull - public DocumentCreateRequest addDocumentsItem(@Nonnull final BaseDocument documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - - /** - * Get documents - * - * @return documents The documents of this {@link DocumentCreateRequest} instance. - */ - @Nonnull - public List getDocuments() { - return documents; - } - - /** - * Set the documents of this {@link DocumentCreateRequest} instance. - * - * @param documents The documents of this {@link DocumentCreateRequest} - */ - public void setDocuments(@Nonnull final List documents) { - this.documents = documents; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentCreateRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentCreateRequest} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DocumentCreateRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentCreateRequest} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentCreateRequest documentCreateRequest = (DocumentCreateRequest) o; - return Objects.equals(this.cloudSdkCustomFields, documentCreateRequest.cloudSdkCustomFields) - && Objects.equals(this.documents, documentCreateRequest.documents); - } - - @Override - public int hashCode() { - return Objects.hash(documents, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentCreateRequest {\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentCreateRequest} - * instance with all required arguments. - */ - public static Builder builder() { - return (documents) -> () -> new DocumentCreateRequest().documents(documents); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the documents of this {@link DocumentCreateRequest} instance. - * - * @param documents The documents of this {@link DocumentCreateRequest} - * @return The DocumentCreateRequest instance. - */ - Builder1 documents(@Nonnull final List documents); - - /** - * Set the documents of this {@link DocumentCreateRequest} instance. - * - * @param documents The documents of this {@link DocumentCreateRequest} - * @return The DocumentCreateRequest instance. - */ - default Builder1 documents(@Nonnull final BaseDocument... documents) { - return documents(Arrays.asList(documents)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link DocumentCreateRequest} instance. - * - * @return The DocumentCreateRequest instance. - */ - DocumentCreateRequest build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentInput.java b/grounding/src/main/resources/openapi/grounding/model/DocumentInput.java deleted file mode 100644 index 31fbbf13c..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentInput.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextOnlyBaseChunk; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A single document stored in a collection by ID. */ -// CHECKSTYLE:OFF -public class DocumentInput -// CHECKSTYLE:ON -{ - @JsonProperty("chunks") - private List chunks = new ArrayList<>(); - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("id") - private UUID id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentInput. */ - private DocumentInput() {} - - /** - * Set the chunks of this {@link DocumentInput} instance and return the same instance. - * - * @param chunks The chunks of this {@link DocumentInput} - * @return The same instance of this {@link DocumentInput} class - */ - @Nonnull - public DocumentInput chunks(@Nonnull final List chunks) { - this.chunks = chunks; - return this; - } - - /** - * Add one chunks instance to this {@link DocumentInput}. - * - * @param chunksItem The chunks that should be added - * @return The same instance of type {@link DocumentInput} - */ - @Nonnull - public DocumentInput addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { - if (this.chunks == null) { - this.chunks = new ArrayList<>(); - } - this.chunks.add(chunksItem); - return this; - } - - /** - * Get chunks - * - * @return chunks The chunks of this {@link DocumentInput} instance. - */ - @Nonnull - public List getChunks() { - return chunks; - } - - /** - * Set the chunks of this {@link DocumentInput} instance. - * - * @param chunks The chunks of this {@link DocumentInput} - */ - public void setChunks(@Nonnull final List chunks) { - this.chunks = chunks; - } - - /** - * Set the metadata of this {@link DocumentInput} instance and return the same instance. - * - * @param metadata The metadata of this {@link DocumentInput} - * @return The same instance of this {@link DocumentInput} class - */ - @Nonnull - public DocumentInput metadata(@Nonnull final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DocumentInput}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DocumentInput} - */ - @Nonnull - public DocumentInput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link DocumentInput} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DocumentInput} instance. - * - * @param metadata The metadata of this {@link DocumentInput} - */ - public void setMetadata(@Nonnull final List metadata) { - this.metadata = metadata; - } - - /** - * Set the id of this {@link DocumentInput} instance and return the same instance. - * - * @param id Unique identifier of a document. - * @return The same instance of this {@link DocumentInput} class - */ - @Nonnull - public DocumentInput id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a document. - * - * @return id The id of this {@link DocumentInput} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DocumentInput} instance. - * - * @param id Unique identifier of a document. - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentInput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentInput} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("DocumentInput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentInput} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentInput documentInput = (DocumentInput) o; - return Objects.equals(this.cloudSdkCustomFields, documentInput.cloudSdkCustomFields) - && Objects.equals(this.chunks, documentInput.chunks) - && Objects.equals(this.metadata, documentInput.metadata) - && Objects.equals(this.id, documentInput.id); - } - - @Override - public int hashCode() { - return Objects.hash(chunks, metadata, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentInput {\n"); - sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentInput} instance - * with all required arguments. - */ - public static Builder builder() { - return (chunks) -> - (metadata) -> (id) -> () -> new DocumentInput().chunks(chunks).metadata(metadata).id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the chunks of this {@link DocumentInput} instance. - * - * @param chunks The chunks of this {@link DocumentInput} - * @return The DocumentInput builder. - */ - Builder1 chunks(@Nonnull final List chunks); - - /** - * Set the chunks of this {@link DocumentInput} instance. - * - * @param chunks The chunks of this {@link DocumentInput} - * @return The DocumentInput builder. - */ - default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { - return chunks(Arrays.asList(chunks)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the metadata of this {@link DocumentInput} instance. - * - * @param metadata The metadata of this {@link DocumentInput} - * @return The DocumentInput builder. - */ - Builder2 metadata(@Nonnull final List metadata); - - /** - * Set the metadata of this {@link DocumentInput} instance. - * - * @param metadata The metadata of this {@link DocumentInput} - * @return The DocumentInput builder. - */ - default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { - return metadata(Arrays.asList(metadata)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the id of this {@link DocumentInput} instance. - * - * @param id Unique identifier of a document. - * @return The DocumentInput instance. - */ - Builder3 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link DocumentInput} instance. - * - * @return The DocumentInput instance. - */ - DocumentInput build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java deleted file mode 100644 index 6d3cdf45e..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentKeyValueListPair.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DocumentKeyValueListPair */ -// CHECKSTYLE:OFF -public class DocumentKeyValueListPair -// CHECKSTYLE:ON -{ - @JsonProperty("key") - private String key; - - @JsonProperty("value") - private List value = new ArrayList<>(); - - /** Gets or Sets matchMode */ - public enum MatchModeEnum { - /** The ANY option of this DocumentKeyValueListPair */ - ANY("ANY"), - - /** The ALL option of this DocumentKeyValueListPair */ - ALL("ALL"); - - private String value; - - MatchModeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type DocumentKeyValueListPair - */ - @JsonCreator - @Nonnull - public static MatchModeEnum fromValue(@Nonnull final String value) { - for (MatchModeEnum b : MatchModeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("matchMode") - private MatchModeEnum matchMode; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentKeyValueListPair. */ - private DocumentKeyValueListPair() {} - - /** - * Set the key of this {@link DocumentKeyValueListPair} instance and return the same instance. - * - * @param key The key of this {@link DocumentKeyValueListPair} - * @return The same instance of this {@link DocumentKeyValueListPair} class - */ - @Nonnull - public DocumentKeyValueListPair key(@Nonnull final String key) { - this.key = key; - return this; - } - - /** - * Get key - * - * @return key The key of this {@link DocumentKeyValueListPair} instance. - */ - @Nonnull - public String getKey() { - return key; - } - - /** - * Set the key of this {@link DocumentKeyValueListPair} instance. - * - * @param key The key of this {@link DocumentKeyValueListPair} - */ - public void setKey(@Nonnull final String key) { - this.key = key; - } - - /** - * Set the value of this {@link DocumentKeyValueListPair} instance and return the same instance. - * - * @param value The value of this {@link DocumentKeyValueListPair} - * @return The same instance of this {@link DocumentKeyValueListPair} class - */ - @Nonnull - public DocumentKeyValueListPair value(@Nonnull final List value) { - this.value = value; - return this; - } - - /** - * Add one value instance to this {@link DocumentKeyValueListPair}. - * - * @param valueItem The value that should be added - * @return The same instance of type {@link DocumentKeyValueListPair} - */ - @Nonnull - public DocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { - if (this.value == null) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); - return this; - } - - /** - * Get value - * - * @return value The value of this {@link DocumentKeyValueListPair} instance. - */ - @Nonnull - public List getValue() { - return value; - } - - /** - * Set the value of this {@link DocumentKeyValueListPair} instance. - * - * @param value The value of this {@link DocumentKeyValueListPair} - */ - public void setValue(@Nonnull final List value) { - this.value = value; - } - - /** - * Set the matchMode of this {@link DocumentKeyValueListPair} instance and return the same - * instance. - * - * @param matchMode The matchMode of this {@link DocumentKeyValueListPair} - * @return The same instance of this {@link DocumentKeyValueListPair} class - */ - @Nonnull - public DocumentKeyValueListPair matchMode(@Nullable final MatchModeEnum matchMode) { - this.matchMode = matchMode; - return this; - } - - /** - * Get matchMode - * - * @return matchMode The matchMode of this {@link DocumentKeyValueListPair} instance. - */ - @Nullable - public MatchModeEnum getMatchMode() { - return matchMode; - } - - /** - * Set the matchMode of this {@link DocumentKeyValueListPair} instance. - * - * @param matchMode The matchMode of this {@link DocumentKeyValueListPair} - */ - public void setMatchMode(@Nullable final MatchModeEnum matchMode) { - this.matchMode = matchMode; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentKeyValueListPair}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentKeyValueListPair} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DocumentKeyValueListPair has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentKeyValueListPair} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentKeyValueListPair documentKeyValueListPair = (DocumentKeyValueListPair) o; - return Objects.equals(this.cloudSdkCustomFields, documentKeyValueListPair.cloudSdkCustomFields) - && Objects.equals(this.key, documentKeyValueListPair.key) - && Objects.equals(this.value, documentKeyValueListPair.value) - && Objects.equals(this.matchMode, documentKeyValueListPair.matchMode); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, matchMode, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentKeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" matchMode: ").append(toIndentedString(matchMode)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * DocumentKeyValueListPair} instance with all required arguments. - */ - public static Builder builder() { - return (key) -> (value) -> () -> new DocumentKeyValueListPair().key(key).value(value); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the key of this {@link DocumentKeyValueListPair} instance. - * - * @param key The key of this {@link DocumentKeyValueListPair} - * @return The DocumentKeyValueListPair builder. - */ - Builder1 key(@Nonnull final String key); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the value of this {@link DocumentKeyValueListPair} instance. - * - * @param value The value of this {@link DocumentKeyValueListPair} - * @return The DocumentKeyValueListPair instance. - */ - Builder2 value(@Nonnull final List value); - - /** - * Set the value of this {@link DocumentKeyValueListPair} instance. - * - * @param value The value of this {@link DocumentKeyValueListPair} - * @return The DocumentKeyValueListPair instance. - */ - default Builder2 value(@Nonnull final String... value) { - return value(Arrays.asList(value)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link DocumentKeyValueListPair} instance. - * - * @return The DocumentKeyValueListPair instance. - */ - DocumentKeyValueListPair build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java b/grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java deleted file mode 100644 index 93bf8c4a6..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentOutput.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Chunk; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DocumentOutput */ -// CHECKSTYLE:OFF -public class DocumentOutput -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private UUID id; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("chunks") - private List chunks = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentOutput. */ - private DocumentOutput() {} - - /** - * Set the id of this {@link DocumentOutput} instance and return the same instance. - * - * @param id The id of this {@link DocumentOutput} - * @return The same instance of this {@link DocumentOutput} class - */ - @Nonnull - public DocumentOutput id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link DocumentOutput} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DocumentOutput} instance. - * - * @param id The id of this {@link DocumentOutput} - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Set the metadata of this {@link DocumentOutput} instance and return the same instance. - * - * @param metadata The metadata of this {@link DocumentOutput} - * @return The same instance of this {@link DocumentOutput} class - */ - @Nonnull - public DocumentOutput metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DocumentOutput}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DocumentOutput} - */ - @Nonnull - public DocumentOutput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link DocumentOutput} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DocumentOutput} instance. - * - * @param metadata The metadata of this {@link DocumentOutput} - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Set the chunks of this {@link DocumentOutput} instance and return the same instance. - * - * @param chunks The chunks of this {@link DocumentOutput} - * @return The same instance of this {@link DocumentOutput} class - */ - @Nonnull - public DocumentOutput chunks(@Nonnull final List chunks) { - this.chunks = chunks; - return this; - } - - /** - * Add one chunks instance to this {@link DocumentOutput}. - * - * @param chunksItem The chunks that should be added - * @return The same instance of type {@link DocumentOutput} - */ - @Nonnull - public DocumentOutput addChunksItem(@Nonnull final Chunk chunksItem) { - if (this.chunks == null) { - this.chunks = new ArrayList<>(); - } - this.chunks.add(chunksItem); - return this; - } - - /** - * Get chunks - * - * @return chunks The chunks of this {@link DocumentOutput} instance. - */ - @Nonnull - public List getChunks() { - return chunks; - } - - /** - * Set the chunks of this {@link DocumentOutput} instance. - * - * @param chunks The chunks of this {@link DocumentOutput} - */ - public void setChunks(@Nonnull final List chunks) { - this.chunks = chunks; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentOutput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentOutput} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("DocumentOutput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentOutput} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentOutput documentOutput = (DocumentOutput) o; - return Objects.equals(this.cloudSdkCustomFields, documentOutput.cloudSdkCustomFields) - && Objects.equals(this.id, documentOutput.id) - && Objects.equals(this.metadata, documentOutput.metadata) - && Objects.equals(this.chunks, documentOutput.chunks); - } - - @Override - public int hashCode() { - return Objects.hash(id, metadata, chunks, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentOutput {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentOutput} - * instance with all required arguments. - */ - public static Builder builder() { - return (id) -> (chunks) -> () -> new DocumentOutput().id(id).chunks(chunks); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link DocumentOutput} instance. - * - * @param id The id of this {@link DocumentOutput} - * @return The DocumentOutput builder. - */ - Builder1 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the chunks of this {@link DocumentOutput} instance. - * - * @param chunks The chunks of this {@link DocumentOutput} - * @return The DocumentOutput instance. - */ - Builder2 chunks(@Nonnull final List chunks); - - /** - * Set the chunks of this {@link DocumentOutput} instance. - * - * @param chunks The chunks of this {@link DocumentOutput} - * @return The DocumentOutput instance. - */ - default Builder2 chunks(@Nonnull final Chunk... chunks) { - return chunks(Arrays.asList(chunks)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link DocumentOutput} instance. - * - * @return The DocumentOutput instance. - */ - DocumentOutput build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java b/grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java deleted file mode 100644 index ebdb571e2..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentResponse.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.TextOnlyBaseChunk; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A response containing information about a newly created, single document. */ -// CHECKSTYLE:OFF -public class DocumentResponse -// CHECKSTYLE:ON -{ - @JsonProperty("chunks") - private List chunks = new ArrayList<>(); - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("id") - private UUID id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentResponse. */ - private DocumentResponse() {} - - /** - * Set the chunks of this {@link DocumentResponse} instance and return the same instance. - * - * @param chunks The chunks of this {@link DocumentResponse} - * @return The same instance of this {@link DocumentResponse} class - */ - @Nonnull - public DocumentResponse chunks(@Nonnull final List chunks) { - this.chunks = chunks; - return this; - } - - /** - * Add one chunks instance to this {@link DocumentResponse}. - * - * @param chunksItem The chunks that should be added - * @return The same instance of type {@link DocumentResponse} - */ - @Nonnull - public DocumentResponse addChunksItem(@Nonnull final TextOnlyBaseChunk chunksItem) { - if (this.chunks == null) { - this.chunks = new ArrayList<>(); - } - this.chunks.add(chunksItem); - return this; - } - - /** - * Get chunks - * - * @return chunks The chunks of this {@link DocumentResponse} instance. - */ - @Nonnull - public List getChunks() { - return chunks; - } - - /** - * Set the chunks of this {@link DocumentResponse} instance. - * - * @param chunks The chunks of this {@link DocumentResponse} - */ - public void setChunks(@Nonnull final List chunks) { - this.chunks = chunks; - } - - /** - * Set the metadata of this {@link DocumentResponse} instance and return the same instance. - * - * @param metadata The metadata of this {@link DocumentResponse} - * @return The same instance of this {@link DocumentResponse} class - */ - @Nonnull - public DocumentResponse metadata(@Nonnull final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DocumentResponse}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DocumentResponse} - */ - @Nonnull - public DocumentResponse addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link DocumentResponse} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DocumentResponse} instance. - * - * @param metadata The metadata of this {@link DocumentResponse} - */ - public void setMetadata(@Nonnull final List metadata) { - this.metadata = metadata; - } - - /** - * Set the id of this {@link DocumentResponse} instance and return the same instance. - * - * @param id Unique identifier of a document. - * @return The same instance of this {@link DocumentResponse} class - */ - @Nonnull - public DocumentResponse id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a document. - * - * @return id The id of this {@link DocumentResponse} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DocumentResponse} instance. - * - * @param id Unique identifier of a document. - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("DocumentResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentResponse} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentResponse documentResponse = (DocumentResponse) o; - return Objects.equals(this.cloudSdkCustomFields, documentResponse.cloudSdkCustomFields) - && Objects.equals(this.chunks, documentResponse.chunks) - && Objects.equals(this.metadata, documentResponse.metadata) - && Objects.equals(this.id, documentResponse.id); - } - - @Override - public int hashCode() { - return Objects.hash(chunks, metadata, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentResponse {\n"); - sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentResponse} - * instance with all required arguments. - */ - public static Builder builder() { - return (chunks) -> - (metadata) -> (id) -> () -> new DocumentResponse().chunks(chunks).metadata(metadata).id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the chunks of this {@link DocumentResponse} instance. - * - * @param chunks The chunks of this {@link DocumentResponse} - * @return The DocumentResponse builder. - */ - Builder1 chunks(@Nonnull final List chunks); - - /** - * Set the chunks of this {@link DocumentResponse} instance. - * - * @param chunks The chunks of this {@link DocumentResponse} - * @return The DocumentResponse builder. - */ - default Builder1 chunks(@Nonnull final TextOnlyBaseChunk... chunks) { - return chunks(Arrays.asList(chunks)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the metadata of this {@link DocumentResponse} instance. - * - * @param metadata The metadata of this {@link DocumentResponse} - * @return The DocumentResponse builder. - */ - Builder2 metadata(@Nonnull final List metadata); - - /** - * Set the metadata of this {@link DocumentResponse} instance. - * - * @param metadata The metadata of this {@link DocumentResponse} - * @return The DocumentResponse builder. - */ - default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { - return metadata(Arrays.asList(metadata)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the id of this {@link DocumentResponse} instance. - * - * @param id Unique identifier of a document. - * @return The DocumentResponse instance. - */ - Builder3 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link DocumentResponse} instance. - * - * @return The DocumentResponse instance. - */ - DocumentResponse build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java deleted file mode 100644 index 59e28985e..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentUpdateRequest.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentInput; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * An update request containing one or more documents to update existing documents in a collection - * by ID. - */ -// CHECKSTYLE:OFF -public class DocumentUpdateRequest -// CHECKSTYLE:ON -{ - @JsonProperty("documents") - private List documents = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentUpdateRequest. */ - private DocumentUpdateRequest() {} - - /** - * Set the documents of this {@link DocumentUpdateRequest} instance and return the same instance. - * - * @param documents The documents of this {@link DocumentUpdateRequest} - * @return The same instance of this {@link DocumentUpdateRequest} class - */ - @Nonnull - public DocumentUpdateRequest documents(@Nonnull final List documents) { - this.documents = documents; - return this; - } - - /** - * Add one documents instance to this {@link DocumentUpdateRequest}. - * - * @param documentsItem The documents that should be added - * @return The same instance of type {@link DocumentUpdateRequest} - */ - @Nonnull - public DocumentUpdateRequest addDocumentsItem(@Nonnull final DocumentInput documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - - /** - * Get documents - * - * @return documents The documents of this {@link DocumentUpdateRequest} instance. - */ - @Nonnull - public List getDocuments() { - return documents; - } - - /** - * Set the documents of this {@link DocumentUpdateRequest} instance. - * - * @param documents The documents of this {@link DocumentUpdateRequest} - */ - public void setDocuments(@Nonnull final List documents) { - this.documents = documents; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentUpdateRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentUpdateRequest} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DocumentUpdateRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentUpdateRequest} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentUpdateRequest documentUpdateRequest = (DocumentUpdateRequest) o; - return Objects.equals(this.cloudSdkCustomFields, documentUpdateRequest.cloudSdkCustomFields) - && Objects.equals(this.documents, documentUpdateRequest.documents); - } - - @Override - public int hashCode() { - return Objects.hash(documents, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentUpdateRequest {\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentUpdateRequest} - * instance with all required arguments. - */ - public static Builder builder() { - return (documents) -> () -> new DocumentUpdateRequest().documents(documents); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the documents of this {@link DocumentUpdateRequest} instance. - * - * @param documents The documents of this {@link DocumentUpdateRequest} - * @return The DocumentUpdateRequest instance. - */ - Builder1 documents(@Nonnull final List documents); - - /** - * Set the documents of this {@link DocumentUpdateRequest} instance. - * - * @param documents The documents of this {@link DocumentUpdateRequest} - * @return The DocumentUpdateRequest instance. - */ - default Builder1 documents(@Nonnull final DocumentInput... documents) { - return documents(Arrays.asList(documents)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link DocumentUpdateRequest} instance. - * - * @return The DocumentUpdateRequest instance. - */ - DocumentUpdateRequest build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java b/grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java deleted file mode 100644 index 82a449fc6..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentWithoutChunks.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A single document stored in a collection by ID without exposing its chunks. */ -// CHECKSTYLE:OFF -public class DocumentWithoutChunks -// CHECKSTYLE:ON -{ - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("id") - private UUID id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentWithoutChunks. */ - private DocumentWithoutChunks() {} - - /** - * Set the metadata of this {@link DocumentWithoutChunks} instance and return the same instance. - * - * @param metadata The metadata of this {@link DocumentWithoutChunks} - * @return The same instance of this {@link DocumentWithoutChunks} class - */ - @Nonnull - public DocumentWithoutChunks metadata(@Nonnull final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DocumentWithoutChunks}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DocumentWithoutChunks} - */ - @Nonnull - public DocumentWithoutChunks addMetadataItem( - @Nonnull final DocumentKeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link DocumentWithoutChunks} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DocumentWithoutChunks} instance. - * - * @param metadata The metadata of this {@link DocumentWithoutChunks} - */ - public void setMetadata(@Nonnull final List metadata) { - this.metadata = metadata; - } - - /** - * Set the id of this {@link DocumentWithoutChunks} instance and return the same instance. - * - * @param id Unique identifier of a document. - * @return The same instance of this {@link DocumentWithoutChunks} class - */ - @Nonnull - public DocumentWithoutChunks id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a document. - * - * @return id The id of this {@link DocumentWithoutChunks} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DocumentWithoutChunks} instance. - * - * @param id Unique identifier of a document. - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentWithoutChunks}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentWithoutChunks} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DocumentWithoutChunks has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentWithoutChunks} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentWithoutChunks documentWithoutChunks = (DocumentWithoutChunks) o; - return Objects.equals(this.cloudSdkCustomFields, documentWithoutChunks.cloudSdkCustomFields) - && Objects.equals(this.metadata, documentWithoutChunks.metadata) - && Objects.equals(this.id, documentWithoutChunks.id); - } - - @Override - public int hashCode() { - return Objects.hash(metadata, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentWithoutChunks {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentWithoutChunks} - * instance with all required arguments. - */ - public static Builder builder() { - return (metadata) -> (id) -> () -> new DocumentWithoutChunks().metadata(metadata).id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the metadata of this {@link DocumentWithoutChunks} instance. - * - * @param metadata The metadata of this {@link DocumentWithoutChunks} - * @return The DocumentWithoutChunks builder. - */ - Builder1 metadata(@Nonnull final List metadata); - - /** - * Set the metadata of this {@link DocumentWithoutChunks} instance. - * - * @param metadata The metadata of this {@link DocumentWithoutChunks} - * @return The DocumentWithoutChunks builder. - */ - default Builder1 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { - return metadata(Arrays.asList(metadata)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the id of this {@link DocumentWithoutChunks} instance. - * - * @param id Unique identifier of a document. - * @return The DocumentWithoutChunks instance. - */ - Builder2 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link DocumentWithoutChunks} instance. - * - * @return The DocumentWithoutChunks instance. - */ - DocumentWithoutChunks build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/Documents.java b/grounding/src/main/resources/openapi/grounding/model/Documents.java deleted file mode 100644 index 3751d298d..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/Documents.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentWithoutChunks; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A response containing documents retrieved from the server. */ -// CHECKSTYLE:OFF -public class Documents -// CHECKSTYLE:ON -{ - @JsonProperty("resources") - private List resources = new ArrayList<>(); - - @JsonProperty("count") - private Integer count; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Documents. */ - private Documents() {} - - /** - * Set the resources of this {@link Documents} instance and return the same instance. - * - * @param resources The resources of this {@link Documents} - * @return The same instance of this {@link Documents} class - */ - @Nonnull - public Documents resources(@Nonnull final List resources) { - this.resources = resources; - return this; - } - - /** - * Add one resources instance to this {@link Documents}. - * - * @param resourcesItem The resources that should be added - * @return The same instance of type {@link Documents} - */ - @Nonnull - public Documents addResourcesItem(@Nonnull final DocumentWithoutChunks resourcesItem) { - if (this.resources == null) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * - * @return resources The resources of this {@link Documents} instance. - */ - @Nonnull - public List getResources() { - return resources; - } - - /** - * Set the resources of this {@link Documents} instance. - * - * @param resources The resources of this {@link Documents} - */ - public void setResources(@Nonnull final List resources) { - this.resources = resources; - } - - /** - * Set the count of this {@link Documents} instance and return the same instance. - * - * @param count The count of this {@link Documents} - * @return The same instance of this {@link Documents} class - */ - @Nonnull - public Documents count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link Documents} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link Documents} instance. - * - * @param count The count of this {@link Documents} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - - /** - * Get the names of the unrecognizable properties of the {@link Documents}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Documents} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Documents has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Documents} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Documents documents = (Documents) o; - return Objects.equals(this.cloudSdkCustomFields, documents.cloudSdkCustomFields) - && Objects.equals(this.resources, documents.resources) - && Objects.equals(this.count, documents.count); - } - - @Override - public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Documents {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link Documents} instance - * with all required arguments. - */ - public static Builder builder() { - return (resources) -> () -> new Documents().resources(resources); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the resources of this {@link Documents} instance. - * - * @param resources The resources of this {@link Documents} - * @return The Documents instance. - */ - Builder1 resources(@Nonnull final List resources); - - /** - * Set the resources of this {@link Documents} instance. - * - * @param resources The resources of this {@link Documents} - * @return The Documents instance. - */ - default Builder1 resources(@Nonnull final DocumentWithoutChunks... resources) { - return resources(Arrays.asList(resources)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link Documents} instance. - * - * @return The Documents instance. - */ - Documents build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java b/grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java deleted file mode 100644 index 48117de68..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentsChunk.java +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentOutput; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DocumentsChunk */ -// CHECKSTYLE:OFF -public class DocumentsChunk -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private UUID id; - - @JsonProperty("title") - private String title; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("documents") - private List documents = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentsChunk. */ - private DocumentsChunk() {} - - /** - * Set the id of this {@link DocumentsChunk} instance and return the same instance. - * - * @param id The id of this {@link DocumentsChunk} - * @return The same instance of this {@link DocumentsChunk} class - */ - @Nonnull - public DocumentsChunk id(@Nonnull final UUID id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link DocumentsChunk} instance. - */ - @Nonnull - public UUID getId() { - return id; - } - - /** - * Set the id of this {@link DocumentsChunk} instance. - * - * @param id The id of this {@link DocumentsChunk} - */ - public void setId(@Nonnull final UUID id) { - this.id = id; - } - - /** - * Set the title of this {@link DocumentsChunk} instance and return the same instance. - * - * @param title The title of this {@link DocumentsChunk} - * @return The same instance of this {@link DocumentsChunk} class - */ - @Nonnull - public DocumentsChunk title(@Nonnull final String title) { - this.title = title; - return this; - } - - /** - * Get title - * - * @return title The title of this {@link DocumentsChunk} instance. - */ - @Nonnull - public String getTitle() { - return title; - } - - /** - * Set the title of this {@link DocumentsChunk} instance. - * - * @param title The title of this {@link DocumentsChunk} - */ - public void setTitle(@Nonnull final String title) { - this.title = title; - } - - /** - * Set the metadata of this {@link DocumentsChunk} instance and return the same instance. - * - * @param metadata The metadata of this {@link DocumentsChunk} - * @return The same instance of this {@link DocumentsChunk} class - */ - @Nonnull - public DocumentsChunk metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link DocumentsChunk}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link DocumentsChunk} - */ - @Nonnull - public DocumentsChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link DocumentsChunk} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link DocumentsChunk} instance. - * - * @param metadata The metadata of this {@link DocumentsChunk} - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Set the documents of this {@link DocumentsChunk} instance and return the same instance. - * - * @param documents The documents of this {@link DocumentsChunk} - * @return The same instance of this {@link DocumentsChunk} class - */ - @Nonnull - public DocumentsChunk documents(@Nonnull final List documents) { - this.documents = documents; - return this; - } - - /** - * Add one documents instance to this {@link DocumentsChunk}. - * - * @param documentsItem The documents that should be added - * @return The same instance of type {@link DocumentsChunk} - */ - @Nonnull - public DocumentsChunk addDocumentsItem(@Nonnull final DocumentOutput documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - - /** - * Get documents - * - * @return documents The documents of this {@link DocumentsChunk} instance. - */ - @Nonnull - public List getDocuments() { - return documents; - } - - /** - * Set the documents of this {@link DocumentsChunk} instance. - * - * @param documents The documents of this {@link DocumentsChunk} - */ - public void setDocuments(@Nonnull final List documents) { - this.documents = documents; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentsChunk}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentsChunk} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("DocumentsChunk has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentsChunk} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentsChunk documentsChunk = (DocumentsChunk) o; - return Objects.equals(this.cloudSdkCustomFields, documentsChunk.cloudSdkCustomFields) - && Objects.equals(this.id, documentsChunk.id) - && Objects.equals(this.title, documentsChunk.title) - && Objects.equals(this.metadata, documentsChunk.metadata) - && Objects.equals(this.documents, documentsChunk.documents); - } - - @Override - public int hashCode() { - return Objects.hash(id, title, metadata, documents, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentsChunk {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentsChunk} - * instance with all required arguments. - */ - public static Builder builder() { - return (id) -> - (title) -> - (documents) -> () -> new DocumentsChunk().id(id).title(title).documents(documents); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link DocumentsChunk} instance. - * - * @param id The id of this {@link DocumentsChunk} - * @return The DocumentsChunk builder. - */ - Builder1 id(@Nonnull final UUID id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the title of this {@link DocumentsChunk} instance. - * - * @param title The title of this {@link DocumentsChunk} - * @return The DocumentsChunk builder. - */ - Builder2 title(@Nonnull final String title); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the documents of this {@link DocumentsChunk} instance. - * - * @param documents The documents of this {@link DocumentsChunk} - * @return The DocumentsChunk instance. - */ - Builder3 documents(@Nonnull final List documents); - - /** - * Set the documents of this {@link DocumentsChunk} instance. - * - * @param documents The documents of this {@link DocumentsChunk} - * @return The DocumentsChunk instance. - */ - default Builder3 documents(@Nonnull final DocumentOutput... documents) { - return documents(Arrays.asList(documents)); - } - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link DocumentsChunk} instance. - * - * @return The DocumentsChunk instance. - */ - DocumentsChunk build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java b/grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java deleted file mode 100644 index 053a75b22..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/DocumentsListResponse.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentWithoutChunks; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A response containing documents created or updated, retrieved from the server. */ -// CHECKSTYLE:OFF -public class DocumentsListResponse -// CHECKSTYLE:ON -{ - @JsonProperty("documents") - private List documents = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DocumentsListResponse. */ - private DocumentsListResponse() {} - - /** - * Set the documents of this {@link DocumentsListResponse} instance and return the same instance. - * - * @param documents The documents of this {@link DocumentsListResponse} - * @return The same instance of this {@link DocumentsListResponse} class - */ - @Nonnull - public DocumentsListResponse documents(@Nonnull final List documents) { - this.documents = documents; - return this; - } - - /** - * Add one documents instance to this {@link DocumentsListResponse}. - * - * @param documentsItem The documents that should be added - * @return The same instance of type {@link DocumentsListResponse} - */ - @Nonnull - public DocumentsListResponse addDocumentsItem( - @Nonnull final DocumentWithoutChunks documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - - /** - * Get documents - * - * @return documents The documents of this {@link DocumentsListResponse} instance. - */ - @Nonnull - public List getDocuments() { - return documents; - } - - /** - * Set the documents of this {@link DocumentsListResponse} instance. - * - * @param documents The documents of this {@link DocumentsListResponse} - */ - public void setDocuments(@Nonnull final List documents) { - this.documents = documents; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentsListResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentsListResponse} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DocumentsListResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link DocumentsListResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DocumentsListResponse documentsListResponse = (DocumentsListResponse) o; - return Objects.equals(this.cloudSdkCustomFields, documentsListResponse.cloudSdkCustomFields) - && Objects.equals(this.documents, documentsListResponse.documents); - } - - @Override - public int hashCode() { - return Objects.hash(documents, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentsListResponse {\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link DocumentsListResponse} - * instance with all required arguments. - */ - public static Builder builder() { - return (documents) -> () -> new DocumentsListResponse().documents(documents); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the documents of this {@link DocumentsListResponse} instance. - * - * @param documents The documents of this {@link DocumentsListResponse} - * @return The DocumentsListResponse instance. - */ - Builder1 documents(@Nonnull final List documents); - - /** - * Set the documents of this {@link DocumentsListResponse} instance. - * - * @param documents The documents of this {@link DocumentsListResponse} - * @return The DocumentsListResponse instance. - */ - default Builder1 documents(@Nonnull final DocumentWithoutChunks... documents) { - return documents(Arrays.asList(documents)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link DocumentsListResponse} instance. - * - * @return The DocumentsListResponse instance. - */ - DocumentsListResponse build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java b/grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java deleted file mode 100644 index e19ef541c..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/EmbeddingConfig.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** EmbeddingConfig */ -// CHECKSTYLE:OFF -public class EmbeddingConfig -// CHECKSTYLE:ON -{ - @JsonProperty("modelName") - private String modelName = "text-embedding-ada-002"; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for EmbeddingConfig. */ - private EmbeddingConfig() {} - - /** - * Set the modelName of this {@link EmbeddingConfig} instance and return the same instance. - * - * @param modelName The modelName of this {@link EmbeddingConfig} - * @return The same instance of this {@link EmbeddingConfig} class - */ - @Nonnull - public EmbeddingConfig modelName(@Nullable final String modelName) { - this.modelName = modelName; - return this; - } - - /** - * Get modelName - * - * @return modelName The modelName of this {@link EmbeddingConfig} instance. - */ - @Nonnull - public String getModelName() { - return modelName; - } - - /** - * Set the modelName of this {@link EmbeddingConfig} instance. - * - * @param modelName The modelName of this {@link EmbeddingConfig} - */ - public void setModelName(@Nullable final String modelName) { - this.modelName = modelName; - } - - /** - * Get the names of the unrecognizable properties of the {@link EmbeddingConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link EmbeddingConfig} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("EmbeddingConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link EmbeddingConfig} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final EmbeddingConfig embeddingConfig = (EmbeddingConfig) o; - return Objects.equals(this.cloudSdkCustomFields, embeddingConfig.cloudSdkCustomFields) - && Objects.equals(this.modelName, embeddingConfig.modelName); - } - - @Override - public int hashCode() { - return Objects.hash(modelName, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddingConfig {\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link EmbeddingConfig} instance. No arguments are required. */ - public static EmbeddingConfig builder() { - return new EmbeddingConfig(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/InlineObject.java b/grounding/src/main/resources/openapi/grounding/model/InlineObject.java deleted file mode 100644 index 6764489da..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/InlineObject.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.ApiError; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** InlineObject */ -// CHECKSTYLE:OFF -public class InlineObject -// CHECKSTYLE:ON -{ - @JsonProperty("error") - private ApiError error; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for InlineObject. */ - private InlineObject() {} - - /** - * Set the error of this {@link InlineObject} instance and return the same instance. - * - * @param error The error of this {@link InlineObject} - * @return The same instance of this {@link InlineObject} class - */ - @Nonnull - public InlineObject error(@Nullable final ApiError error) { - this.error = error; - return this; - } - - /** - * Get error - * - * @return error The error of this {@link InlineObject} instance. - */ - @Nonnull - public ApiError getError() { - return error; - } - - /** - * Set the error of this {@link InlineObject} instance. - * - * @param error The error of this {@link InlineObject} - */ - public void setError(@Nullable final ApiError error) { - this.error = error; - } - - /** - * Get the names of the unrecognizable properties of the {@link InlineObject}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link InlineObject} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("InlineObject has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link InlineObject} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final InlineObject inlineObject = (InlineObject) o; - return Objects.equals(this.cloudSdkCustomFields, inlineObject.cloudSdkCustomFields) - && Objects.equals(this.error, inlineObject.error); - } - - @Override - public int hashCode() { - return Objects.hash(error, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class InlineObject {\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link InlineObject} instance. No arguments are required. */ - public static InlineObject builder() { - return new InlineObject(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java b/grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java deleted file mode 100644 index 77f9f1a64..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/KeyValueListPair.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** KeyValueListPair */ -// CHECKSTYLE:OFF -public class KeyValueListPair -// CHECKSTYLE:ON -{ - @JsonProperty("key") - private String key; - - @JsonProperty("value") - private List value = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for KeyValueListPair. */ - private KeyValueListPair() {} - - /** - * Set the key of this {@link KeyValueListPair} instance and return the same instance. - * - * @param key The key of this {@link KeyValueListPair} - * @return The same instance of this {@link KeyValueListPair} class - */ - @Nonnull - public KeyValueListPair key(@Nonnull final String key) { - this.key = key; - return this; - } - - /** - * Get key - * - * @return key The key of this {@link KeyValueListPair} instance. - */ - @Nonnull - public String getKey() { - return key; - } - - /** - * Set the key of this {@link KeyValueListPair} instance. - * - * @param key The key of this {@link KeyValueListPair} - */ - public void setKey(@Nonnull final String key) { - this.key = key; - } - - /** - * Set the value of this {@link KeyValueListPair} instance and return the same instance. - * - * @param value The value of this {@link KeyValueListPair} - * @return The same instance of this {@link KeyValueListPair} class - */ - @Nonnull - public KeyValueListPair value(@Nonnull final List value) { - this.value = value; - return this; - } - - /** - * Add one value instance to this {@link KeyValueListPair}. - * - * @param valueItem The value that should be added - * @return The same instance of type {@link KeyValueListPair} - */ - @Nonnull - public KeyValueListPair addValueItem(@Nonnull final String valueItem) { - if (this.value == null) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); - return this; - } - - /** - * Get value - * - * @return value The value of this {@link KeyValueListPair} instance. - */ - @Nonnull - public List getValue() { - return value; - } - - /** - * Set the value of this {@link KeyValueListPair} instance. - * - * @param value The value of this {@link KeyValueListPair} - */ - public void setValue(@Nonnull final List value) { - this.value = value; - } - - /** - * Get the names of the unrecognizable properties of the {@link KeyValueListPair}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link KeyValueListPair} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("KeyValueListPair has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link KeyValueListPair} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final KeyValueListPair keyValueListPair = (KeyValueListPair) o; - return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) - && Objects.equals(this.key, keyValueListPair.key) - && Objects.equals(this.value, keyValueListPair.value); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class KeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link KeyValueListPair} - * instance with all required arguments. - */ - public static Builder builder() { - return (key) -> (value) -> () -> new KeyValueListPair().key(key).value(value); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the key of this {@link KeyValueListPair} instance. - * - * @param key The key of this {@link KeyValueListPair} - * @return The KeyValueListPair builder. - */ - Builder1 key(@Nonnull final String key); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the value of this {@link KeyValueListPair} instance. - * - * @param value The value of this {@link KeyValueListPair} - * @return The KeyValueListPair instance. - */ - Builder2 value(@Nonnull final List value); - - /** - * Set the value of this {@link KeyValueListPair} instance. - * - * @param value The value of this {@link KeyValueListPair} - * @return The KeyValueListPair instance. - */ - default Builder2 value(@Nonnull final String... value) { - return value(Arrays.asList(value)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link KeyValueListPair} instance. - * - * @return The KeyValueListPair instance. - */ - KeyValueListPair build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java b/grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java deleted file mode 100644 index 200cd6652..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PerFilterSearchResult.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentsChunk; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PerFilterSearchResult */ -// CHECKSTYLE:OFF -public class PerFilterSearchResult -// CHECKSTYLE:ON -{ - @JsonProperty("filterId") - private String filterId; - - @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PerFilterSearchResult. */ - private PerFilterSearchResult() {} - - /** - * Set the filterId of this {@link PerFilterSearchResult} instance and return the same instance. - * - * @param filterId The filterId of this {@link PerFilterSearchResult} - * @return The same instance of this {@link PerFilterSearchResult} class - */ - @Nonnull - public PerFilterSearchResult filterId(@Nonnull final String filterId) { - this.filterId = filterId; - return this; - } - - /** - * Get filterId - * - * @return filterId The filterId of this {@link PerFilterSearchResult} instance. - */ - @Nonnull - public String getFilterId() { - return filterId; - } - - /** - * Set the filterId of this {@link PerFilterSearchResult} instance. - * - * @param filterId The filterId of this {@link PerFilterSearchResult} - */ - public void setFilterId(@Nonnull final String filterId) { - this.filterId = filterId; - } - - /** - * Set the results of this {@link PerFilterSearchResult} instance and return the same instance. - * - * @param results The results of this {@link PerFilterSearchResult} - * @return The same instance of this {@link PerFilterSearchResult} class - */ - @Nonnull - public PerFilterSearchResult results(@Nonnull final List results) { - this.results = results; - return this; - } - - /** - * Add one results instance to this {@link PerFilterSearchResult}. - * - * @param resultsItem The results that should be added - * @return The same instance of type {@link PerFilterSearchResult} - */ - @Nonnull - public PerFilterSearchResult addResultsItem(@Nonnull final DocumentsChunk resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Get results - * - * @return results The results of this {@link PerFilterSearchResult} instance. - */ - @Nonnull - public List getResults() { - return results; - } - - /** - * Set the results of this {@link PerFilterSearchResult} instance. - * - * @param results The results of this {@link PerFilterSearchResult} - */ - public void setResults(@Nonnull final List results) { - this.results = results; - } - - /** - * Get the names of the unrecognizable properties of the {@link PerFilterSearchResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PerFilterSearchResult} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PerFilterSearchResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PerFilterSearchResult} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PerFilterSearchResult perFilterSearchResult = (PerFilterSearchResult) o; - return Objects.equals(this.cloudSdkCustomFields, perFilterSearchResult.cloudSdkCustomFields) - && Objects.equals(this.filterId, perFilterSearchResult.filterId) - && Objects.equals(this.results, perFilterSearchResult.results); - } - - @Override - public int hashCode() { - return Objects.hash(filterId, results, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PerFilterSearchResult {\n"); - sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link PerFilterSearchResult} - * instance with all required arguments. - */ - public static Builder builder() { - return (filterId) -> - (results) -> () -> new PerFilterSearchResult().filterId(filterId).results(results); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filterId of this {@link PerFilterSearchResult} instance. - * - * @param filterId The filterId of this {@link PerFilterSearchResult} - * @return The PerFilterSearchResult builder. - */ - Builder1 filterId(@Nonnull final String filterId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the results of this {@link PerFilterSearchResult} instance. - * - * @param results The results of this {@link PerFilterSearchResult} - * @return The PerFilterSearchResult instance. - */ - Builder2 results(@Nonnull final List results); - - /** - * Set the results of this {@link PerFilterSearchResult} instance. - * - * @param results The results of this {@link PerFilterSearchResult} - * @return The PerFilterSearchResult instance. - */ - default Builder2 results(@Nonnull final DocumentsChunk... results) { - return results(Arrays.asList(results)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link PerFilterSearchResult} instance. - * - * @return The PerFilterSearchResult instance. - */ - PerFilterSearchResult build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/Pipeline.java b/grounding/src/main/resources/openapi/grounding/model/Pipeline.java deleted file mode 100644 index 27a73abca..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/Pipeline.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineConfiguration; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Pipeline */ -// CHECKSTYLE:OFF -public class Pipeline -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("type") - private String type; - - @JsonProperty("configuration") - private PipelineConfiguration _configuration; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Pipeline. */ - private Pipeline() {} - - /** - * Set the id of this {@link Pipeline} instance and return the same instance. - * - * @param id The id of this {@link Pipeline} - * @return The same instance of this {@link Pipeline} class - */ - @Nonnull - public Pipeline id(@Nullable final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link Pipeline} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link Pipeline} instance. - * - * @param id The id of this {@link Pipeline} - */ - public void setId(@Nullable final String id) { - this.id = id; - } - - /** - * Set the type of this {@link Pipeline} instance and return the same instance. - * - * @param type The type of this {@link Pipeline} - * @return The same instance of this {@link Pipeline} class - */ - @Nonnull - public Pipeline type(@Nullable final String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link Pipeline} instance. - */ - @Nonnull - public String getType() { - return type; - } - - /** - * Set the type of this {@link Pipeline} instance. - * - * @param type The type of this {@link Pipeline} - */ - public void setType(@Nullable final String type) { - this.type = type; - } - - /** - * Set the _configuration of this {@link Pipeline} instance and return the same instance. - * - * @param _configuration The _configuration of this {@link Pipeline} - * @return The same instance of this {@link Pipeline} class - */ - @Nonnull - public Pipeline _configuration(@Nullable final PipelineConfiguration _configuration) { - this._configuration = _configuration; - return this; - } - - /** - * Get _configuration - * - * @return _configuration The _configuration of this {@link Pipeline} instance. - */ - @Nonnull - public PipelineConfiguration getConfiguration() { - return _configuration; - } - - /** - * Set the _configuration of this {@link Pipeline} instance. - * - * @param _configuration The _configuration of this {@link Pipeline} - */ - public void setConfiguration(@Nullable final PipelineConfiguration _configuration) { - this._configuration = _configuration; - } - - /** - * Get the names of the unrecognizable properties of the {@link Pipeline}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Pipeline} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Pipeline has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Pipeline} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Pipeline pipeline = (Pipeline) o; - return Objects.equals(this.cloudSdkCustomFields, pipeline.cloudSdkCustomFields) - && Objects.equals(this.id, pipeline.id) - && Objects.equals(this.type, pipeline.type) - && Objects.equals(this._configuration, pipeline._configuration); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, _configuration, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Pipeline {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link Pipeline} instance. No arguments are required. */ - public static Pipeline builder() { - return new Pipeline(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java b/grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java deleted file mode 100644 index 70d9fd868..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelineConfiguration.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineConfigurationSharePoint; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelineConfiguration */ -// CHECKSTYLE:OFF -public class PipelineConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty("destination") - private String destination; - - @JsonProperty("sharePoint") - private PipelineConfigurationSharePoint sharePoint; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelineConfiguration. */ - private PipelineConfiguration() {} - - /** - * Set the destination of this {@link PipelineConfiguration} instance and return the same - * instance. - * - * @param destination The destination of this {@link PipelineConfiguration} - * @return The same instance of this {@link PipelineConfiguration} class - */ - @Nonnull - public PipelineConfiguration destination(@Nullable final String destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination The destination of this {@link PipelineConfiguration} instance. - */ - @Nonnull - public String getDestination() { - return destination; - } - - /** - * Set the destination of this {@link PipelineConfiguration} instance. - * - * @param destination The destination of this {@link PipelineConfiguration} - */ - public void setDestination(@Nullable final String destination) { - this.destination = destination; - } - - /** - * Set the sharePoint of this {@link PipelineConfiguration} instance and return the same instance. - * - * @param sharePoint The sharePoint of this {@link PipelineConfiguration} - * @return The same instance of this {@link PipelineConfiguration} class - */ - @Nonnull - public PipelineConfiguration sharePoint( - @Nullable final PipelineConfigurationSharePoint sharePoint) { - this.sharePoint = sharePoint; - return this; - } - - /** - * Get sharePoint - * - * @return sharePoint The sharePoint of this {@link PipelineConfiguration} instance. - */ - @Nonnull - public PipelineConfigurationSharePoint getSharePoint() { - return sharePoint; - } - - /** - * Set the sharePoint of this {@link PipelineConfiguration} instance. - * - * @param sharePoint The sharePoint of this {@link PipelineConfiguration} - */ - public void setSharePoint(@Nullable final PipelineConfigurationSharePoint sharePoint) { - this.sharePoint = sharePoint; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelineConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelineConfiguration} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelineConfiguration has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelineConfiguration} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelineConfiguration pipelineConfiguration = (PipelineConfiguration) o; - return Objects.equals(this.cloudSdkCustomFields, pipelineConfiguration.cloudSdkCustomFields) - && Objects.equals(this.destination, pipelineConfiguration.destination) - && Objects.equals(this.sharePoint, pipelineConfiguration.sharePoint); - } - - @Override - public int hashCode() { - return Objects.hash(destination, sharePoint, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineConfiguration {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link PipelineConfiguration} instance. No arguments are required. */ - public static PipelineConfiguration builder() { - return new PipelineConfiguration(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java b/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java deleted file mode 100644 index 26846da4a..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePoint.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelineConfigurationSharePointSite; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelineConfigurationSharePoint */ -// CHECKSTYLE:OFF -public class PipelineConfigurationSharePoint -// CHECKSTYLE:ON -{ - @JsonProperty("site") - private PipelineConfigurationSharePointSite site; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelineConfigurationSharePoint. */ - private PipelineConfigurationSharePoint() {} - - /** - * Set the site of this {@link PipelineConfigurationSharePoint} instance and return the same - * instance. - * - * @param site The site of this {@link PipelineConfigurationSharePoint} - * @return The same instance of this {@link PipelineConfigurationSharePoint} class - */ - @Nonnull - public PipelineConfigurationSharePoint site( - @Nullable final PipelineConfigurationSharePointSite site) { - this.site = site; - return this; - } - - /** - * Get site - * - * @return site The site of this {@link PipelineConfigurationSharePoint} instance. - */ - @Nonnull - public PipelineConfigurationSharePointSite getSite() { - return site; - } - - /** - * Set the site of this {@link PipelineConfigurationSharePoint} instance. - * - * @param site The site of this {@link PipelineConfigurationSharePoint} - */ - public void setSite(@Nullable final PipelineConfigurationSharePointSite site) { - this.site = site; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelineConfigurationSharePoint}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePoint} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelineConfigurationSharePoint has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelineConfigurationSharePoint} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelineConfigurationSharePoint pipelineConfigurationSharePoint = - (PipelineConfigurationSharePoint) o; - return Objects.equals( - this.cloudSdkCustomFields, pipelineConfigurationSharePoint.cloudSdkCustomFields) - && Objects.equals(this.site, pipelineConfigurationSharePoint.site); - } - - @Override - public int hashCode() { - return Objects.hash(site, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineConfigurationSharePoint {\n"); - sb.append(" site: ").append(toIndentedString(site)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link PipelineConfigurationSharePoint} instance. No arguments are required. */ - public static PipelineConfigurationSharePoint builder() { - return new PipelineConfigurationSharePoint(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java b/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java deleted file mode 100644 index 8ab4902ca..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelineConfigurationSharePointSite.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelineConfigurationSharePointSite */ -// CHECKSTYLE:OFF -public class PipelineConfigurationSharePointSite -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("name") - private String name; - - @JsonProperty("includePaths") - private List includePaths = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelineConfigurationSharePointSite. */ - private PipelineConfigurationSharePointSite() {} - - /** - * Set the id of this {@link PipelineConfigurationSharePointSite} instance and return the same - * instance. - * - * @param id The id of this {@link PipelineConfigurationSharePointSite} - * @return The same instance of this {@link PipelineConfigurationSharePointSite} class - */ - @Nonnull - public PipelineConfigurationSharePointSite id(@Nullable final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link PipelineConfigurationSharePointSite} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link PipelineConfigurationSharePointSite} instance. - * - * @param id The id of this {@link PipelineConfigurationSharePointSite} - */ - public void setId(@Nullable final String id) { - this.id = id; - } - - /** - * Set the name of this {@link PipelineConfigurationSharePointSite} instance and return the same - * instance. - * - * @param name The name of this {@link PipelineConfigurationSharePointSite} - * @return The same instance of this {@link PipelineConfigurationSharePointSite} class - */ - @Nonnull - public PipelineConfigurationSharePointSite name(@Nullable final String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link PipelineConfigurationSharePointSite} instance. - */ - @Nonnull - public String getName() { - return name; - } - - /** - * Set the name of this {@link PipelineConfigurationSharePointSite} instance. - * - * @param name The name of this {@link PipelineConfigurationSharePointSite} - */ - public void setName(@Nullable final String name) { - this.name = name; - } - - /** - * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance and return - * the same instance. - * - * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} - * @return The same instance of this {@link PipelineConfigurationSharePointSite} class - */ - @Nonnull - public PipelineConfigurationSharePointSite includePaths( - @Nullable final List includePaths) { - this.includePaths = includePaths; - return this; - } - - /** - * Add one includePaths instance to this {@link PipelineConfigurationSharePointSite}. - * - * @param includePathsItem The includePaths that should be added - * @return The same instance of type {@link PipelineConfigurationSharePointSite} - */ - @Nonnull - public PipelineConfigurationSharePointSite addIncludePathsItem( - @Nonnull final String includePathsItem) { - if (this.includePaths == null) { - this.includePaths = new ArrayList<>(); - } - this.includePaths.add(includePathsItem); - return this; - } - - /** - * Get includePaths - * - * @return includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} - * instance. - */ - @Nonnull - public List getIncludePaths() { - return includePaths; - } - - /** - * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance. - * - * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} - */ - public void setIncludePaths(@Nullable final List includePaths) { - this.includePaths = includePaths; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * PipelineConfigurationSharePointSite}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePointSite} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelineConfigurationSharePointSite has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelineConfigurationSharePointSite} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelineConfigurationSharePointSite pipelineConfigurationSharePointSite = - (PipelineConfigurationSharePointSite) o; - return Objects.equals( - this.cloudSdkCustomFields, pipelineConfigurationSharePointSite.cloudSdkCustomFields) - && Objects.equals(this.id, pipelineConfigurationSharePointSite.id) - && Objects.equals(this.name, pipelineConfigurationSharePointSite.name) - && Objects.equals(this.includePaths, pipelineConfigurationSharePointSite.includePaths); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, includePaths, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineConfigurationSharePointSite {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a new {@link PipelineConfigurationSharePointSite} instance. No arguments are required. - */ - public static PipelineConfigurationSharePointSite builder() { - return new PipelineConfigurationSharePointSite(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineId.java b/grounding/src/main/resources/openapi/grounding/model/PipelineId.java deleted file mode 100644 index ff666cd11..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelineId.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelineId */ -// CHECKSTYLE:OFF -public class PipelineId -// CHECKSTYLE:ON -{ - @JsonProperty("pipelineId") - private String pipelineId; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelineId. */ - private PipelineId() {} - - /** - * Set the pipelineId of this {@link PipelineId} instance and return the same instance. - * - * @param pipelineId The pipelineId of this {@link PipelineId} - * @return The same instance of this {@link PipelineId} class - */ - @Nonnull - public PipelineId pipelineId(@Nullable final String pipelineId) { - this.pipelineId = pipelineId; - return this; - } - - /** - * Get pipelineId - * - * @return pipelineId The pipelineId of this {@link PipelineId} instance. - */ - @Nonnull - public String getPipelineId() { - return pipelineId; - } - - /** - * Set the pipelineId of this {@link PipelineId} instance. - * - * @param pipelineId The pipelineId of this {@link PipelineId} - */ - public void setPipelineId(@Nullable final String pipelineId) { - this.pipelineId = pipelineId; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelineId}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelineId} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("PipelineId has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelineId} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelineId pipelineId = (PipelineId) o; - return Objects.equals(this.cloudSdkCustomFields, pipelineId.cloudSdkCustomFields) - && Objects.equals(this.pipelineId, pipelineId.pipelineId); - } - - @Override - public int hashCode() { - return Objects.hash(pipelineId, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineId {\n"); - sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link PipelineId} instance. No arguments are required. */ - public static PipelineId builder() { - return new PipelineId(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java deleted file mode 100644 index 920736b1a..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequst.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequstConfiguration; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelinePostRequst */ -// CHECKSTYLE:OFF -public class PipelinePostRequst -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private String type; - - @JsonProperty("configuration") - private PipelinePostRequstConfiguration _configuration; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelinePostRequst. */ - private PipelinePostRequst() {} - - /** - * Set the type of this {@link PipelinePostRequst} instance and return the same instance. - * - * @param type The type of this {@link PipelinePostRequst} - * @return The same instance of this {@link PipelinePostRequst} class - */ - @Nonnull - public PipelinePostRequst type(@Nonnull final String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link PipelinePostRequst} instance. - */ - @Nonnull - public String getType() { - return type; - } - - /** - * Set the type of this {@link PipelinePostRequst} instance. - * - * @param type The type of this {@link PipelinePostRequst} - */ - public void setType(@Nonnull final String type) { - this.type = type; - } - - /** - * Set the _configuration of this {@link PipelinePostRequst} instance and return the same - * instance. - * - * @param _configuration The _configuration of this {@link PipelinePostRequst} - * @return The same instance of this {@link PipelinePostRequst} class - */ - @Nonnull - public PipelinePostRequst _configuration( - @Nonnull final PipelinePostRequstConfiguration _configuration) { - this._configuration = _configuration; - return this; - } - - /** - * Get _configuration - * - * @return _configuration The _configuration of this {@link PipelinePostRequst} instance. - */ - @Nonnull - public PipelinePostRequstConfiguration getConfiguration() { - return _configuration; - } - - /** - * Set the _configuration of this {@link PipelinePostRequst} instance. - * - * @param _configuration The _configuration of this {@link PipelinePostRequst} - */ - public void setConfiguration(@Nonnull final PipelinePostRequstConfiguration _configuration) { - this._configuration = _configuration; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelinePostRequst}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelinePostRequst} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("PipelinePostRequst has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelinePostRequst} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelinePostRequst pipelinePostRequst = (PipelinePostRequst) o; - return Objects.equals(this.cloudSdkCustomFields, pipelinePostRequst.cloudSdkCustomFields) - && Objects.equals(this.type, pipelinePostRequst.type) - && Objects.equals(this._configuration, pipelinePostRequst._configuration); - } - - @Override - public int hashCode() { - return Objects.hash(type, _configuration, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequst {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link PipelinePostRequst} - * instance with all required arguments. - */ - public static Builder builder() { - return (type) -> - (_configuration) -> - () -> new PipelinePostRequst().type(type)._configuration(_configuration); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link PipelinePostRequst} instance. - * - * @param type The type of this {@link PipelinePostRequst} - * @return The PipelinePostRequst builder. - */ - Builder1 type(@Nonnull final String type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the _configuration of this {@link PipelinePostRequst} instance. - * - * @param _configuration The _configuration of this {@link PipelinePostRequst} - * @return The PipelinePostRequst instance. - */ - Builder2 _configuration(@Nonnull final PipelinePostRequstConfiguration _configuration); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link PipelinePostRequst} instance. - * - * @return The PipelinePostRequst instance. - */ - PipelinePostRequst build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java deleted file mode 100644 index 7f6f55b8f..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfiguration.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequstConfigurationSharePoint; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelinePostRequstConfiguration */ -// CHECKSTYLE:OFF -public class PipelinePostRequstConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty("destination") - private String destination; - - @JsonProperty("sharePoint") - private PipelinePostRequstConfigurationSharePoint sharePoint; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelinePostRequstConfiguration. */ - private PipelinePostRequstConfiguration() {} - - /** - * Set the destination of this {@link PipelinePostRequstConfiguration} instance and return the - * same instance. - * - * @param destination The destination of this {@link PipelinePostRequstConfiguration} - * @return The same instance of this {@link PipelinePostRequstConfiguration} class - */ - @Nonnull - public PipelinePostRequstConfiguration destination(@Nonnull final String destination) { - this.destination = destination; - return this; - } - - /** - * Get destination - * - * @return destination The destination of this {@link PipelinePostRequstConfiguration} instance. - */ - @Nonnull - public String getDestination() { - return destination; - } - - /** - * Set the destination of this {@link PipelinePostRequstConfiguration} instance. - * - * @param destination The destination of this {@link PipelinePostRequstConfiguration} - */ - public void setDestination(@Nonnull final String destination) { - this.destination = destination; - } - - /** - * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance and return the same - * instance. - * - * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} - * @return The same instance of this {@link PipelinePostRequstConfiguration} class - */ - @Nonnull - public PipelinePostRequstConfiguration sharePoint( - @Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { - this.sharePoint = sharePoint; - return this; - } - - /** - * Get sharePoint - * - * @return sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} instance. - */ - @Nonnull - public PipelinePostRequstConfigurationSharePoint getSharePoint() { - return sharePoint; - } - - /** - * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance. - * - * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} - */ - public void setSharePoint(@Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { - this.sharePoint = sharePoint; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelinePostRequstConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelinePostRequstConfiguration} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelinePostRequstConfiguration has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelinePostRequstConfiguration} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelinePostRequstConfiguration pipelinePostRequstConfiguration = - (PipelinePostRequstConfiguration) o; - return Objects.equals( - this.cloudSdkCustomFields, pipelinePostRequstConfiguration.cloudSdkCustomFields) - && Objects.equals(this.destination, pipelinePostRequstConfiguration.destination) - && Objects.equals(this.sharePoint, pipelinePostRequstConfiguration.sharePoint); - } - - @Override - public int hashCode() { - return Objects.hash(destination, sharePoint, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequstConfiguration {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * PipelinePostRequstConfiguration} instance with all required arguments. - */ - public static Builder builder() { - return (destination) -> () -> new PipelinePostRequstConfiguration().destination(destination); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the destination of this {@link PipelinePostRequstConfiguration} instance. - * - * @param destination The destination of this {@link PipelinePostRequstConfiguration} - * @return The PipelinePostRequstConfiguration instance. - */ - Builder1 destination(@Nonnull final String destination); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link PipelinePostRequstConfiguration} instance. - * - * @return The PipelinePostRequstConfiguration instance. - */ - PipelinePostRequstConfiguration build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java deleted file mode 100644 index 7dfc5b449..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePoint.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.PipelinePostRequstConfigurationSharePointSite; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelinePostRequstConfigurationSharePoint */ -// CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePoint -// CHECKSTYLE:ON -{ - @JsonProperty("site") - private PipelinePostRequstConfigurationSharePointSite site; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelinePostRequstConfigurationSharePoint. */ - private PipelinePostRequstConfigurationSharePoint() {} - - /** - * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance and return the - * same instance. - * - * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} - * @return The same instance of this {@link PipelinePostRequstConfigurationSharePoint} class - */ - @Nonnull - public PipelinePostRequstConfigurationSharePoint site( - @Nullable final PipelinePostRequstConfigurationSharePointSite site) { - this.site = site; - return this; - } - - /** - * Get site - * - * @return site The site of this {@link PipelinePostRequstConfigurationSharePoint} instance. - */ - @Nonnull - public PipelinePostRequstConfigurationSharePointSite getSite() { - return site; - } - - /** - * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance. - * - * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} - */ - public void setSite(@Nullable final PipelinePostRequstConfigurationSharePointSite site) { - this.site = site; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * PipelinePostRequstConfigurationSharePoint}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * PipelinePostRequstConfigurationSharePoint} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelinePostRequstConfigurationSharePoint has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePoint} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelinePostRequstConfigurationSharePoint pipelinePostRequstConfigurationSharePoint = - (PipelinePostRequstConfigurationSharePoint) o; - return Objects.equals( - this.cloudSdkCustomFields, - pipelinePostRequstConfigurationSharePoint.cloudSdkCustomFields) - && Objects.equals(this.site, pipelinePostRequstConfigurationSharePoint.site); - } - - @Override - public int hashCode() { - return Objects.hash(site, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequstConfigurationSharePoint {\n"); - sb.append(" site: ").append(toIndentedString(site)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a new {@link PipelinePostRequstConfigurationSharePoint} instance. No arguments are - * required. - */ - public static PipelinePostRequstConfigurationSharePoint builder() { - return new PipelinePostRequstConfigurationSharePoint(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java deleted file mode 100644 index dfe797770..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelinePostRequstConfigurationSharePointSite.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelinePostRequstConfigurationSharePointSite */ -// CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePointSite -// CHECKSTYLE:ON -{ - @JsonProperty("name") - private String name; - - @JsonProperty("includePaths") - private List includePaths = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelinePostRequstConfigurationSharePointSite. */ - private PipelinePostRequstConfigurationSharePointSite() {} - - /** - * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance and return - * the same instance. - * - * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} - * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class - */ - @Nonnull - public PipelinePostRequstConfigurationSharePointSite name(@Nullable final String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. - */ - @Nonnull - public String getName() { - return name; - } - - /** - * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. - * - * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} - */ - public void setName(@Nullable final String name) { - this.name = name; - } - - /** - * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance and - * return the same instance. - * - * @param includePaths The includePaths of this {@link - * PipelinePostRequstConfigurationSharePointSite} - * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class - */ - @Nonnull - public PipelinePostRequstConfigurationSharePointSite includePaths( - @Nullable final List includePaths) { - this.includePaths = includePaths; - return this; - } - - /** - * Add one includePaths instance to this {@link PipelinePostRequstConfigurationSharePointSite}. - * - * @param includePathsItem The includePaths that should be added - * @return The same instance of type {@link PipelinePostRequstConfigurationSharePointSite} - */ - @Nonnull - public PipelinePostRequstConfigurationSharePointSite addIncludePathsItem( - @Nonnull final String includePathsItem) { - if (this.includePaths == null) { - this.includePaths = new ArrayList<>(); - } - this.includePaths.add(includePathsItem); - return this; - } - - /** - * Get includePaths - * - * @return includePaths The includePaths of this {@link - * PipelinePostRequstConfigurationSharePointSite} instance. - */ - @Nonnull - public List getIncludePaths() { - return includePaths; - } - - /** - * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance. - * - * @param includePaths The includePaths of this {@link - * PipelinePostRequstConfigurationSharePointSite} - */ - public void setIncludePaths(@Nullable final List includePaths) { - this.includePaths = includePaths; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * PipelinePostRequstConfigurationSharePointSite}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * PipelinePostRequstConfigurationSharePointSite} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelinePostRequstConfigurationSharePointSite has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePointSite} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelinePostRequstConfigurationSharePointSite - pipelinePostRequstConfigurationSharePointSite = - (PipelinePostRequstConfigurationSharePointSite) o; - return Objects.equals( - this.cloudSdkCustomFields, - pipelinePostRequstConfigurationSharePointSite.cloudSdkCustomFields) - && Objects.equals(this.name, pipelinePostRequstConfigurationSharePointSite.name) - && Objects.equals( - this.includePaths, pipelinePostRequstConfigurationSharePointSite.includePaths); - } - - @Override - public int hashCode() { - return Objects.hash(name, includePaths, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequstConfigurationSharePointSite {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a new {@link PipelinePostRequstConfigurationSharePointSite} instance. No arguments are - * required. - */ - public static PipelinePostRequstConfigurationSharePointSite builder() { - return new PipelinePostRequstConfigurationSharePointSite(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java b/grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java deleted file mode 100644 index 55f6f6b89..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/PipelineStatus.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelineStatus */ -// CHECKSTYLE:OFF -public class PipelineStatus -// CHECKSTYLE:ON -{ - @JsonProperty("lastStarted") - private OffsetDateTime lastStarted; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelineStatus. */ - private PipelineStatus() {} - - /** - * Set the lastStarted of this {@link PipelineStatus} instance and return the same instance. - * - * @param lastStarted The lastStarted of this {@link PipelineStatus} - * @return The same instance of this {@link PipelineStatus} class - */ - @Nonnull - public PipelineStatus lastStarted(@Nullable final OffsetDateTime lastStarted) { - this.lastStarted = lastStarted; - return this; - } - - /** - * Get lastStarted - * - * @return lastStarted The lastStarted of this {@link PipelineStatus} instance. - */ - @Nonnull - public OffsetDateTime getLastStarted() { - return lastStarted; - } - - /** - * Set the lastStarted of this {@link PipelineStatus} instance. - * - * @param lastStarted The lastStarted of this {@link PipelineStatus} - */ - public void setLastStarted(@Nullable final OffsetDateTime lastStarted) { - this.lastStarted = lastStarted; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelineStatus}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelineStatus} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("PipelineStatus has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link PipelineStatus} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelineStatus pipelineStatus = (PipelineStatus) o; - return Objects.equals(this.cloudSdkCustomFields, pipelineStatus.cloudSdkCustomFields) - && Objects.equals(this.lastStarted, pipelineStatus.lastStarted); - } - - @Override - public int hashCode() { - return Objects.hash(lastStarted, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineStatus {\n"); - sb.append(" lastStarted: ").append(toIndentedString(lastStarted)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link PipelineStatus} instance. No arguments are required. */ - public static PipelineStatus builder() { - return new PipelineStatus(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/Pipelines.java b/grounding/src/main/resources/openapi/grounding/model/Pipelines.java deleted file mode 100644 index 944a62c46..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/Pipelines.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Pipeline; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Pipelines */ -// CHECKSTYLE:OFF -public class Pipelines -// CHECKSTYLE:ON -{ - @JsonProperty("resources") - private List resources = new ArrayList<>(); - - @JsonProperty("count") - private Integer count; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Pipelines. */ - private Pipelines() {} - - /** - * Set the resources of this {@link Pipelines} instance and return the same instance. - * - * @param resources The resources of this {@link Pipelines} - * @return The same instance of this {@link Pipelines} class - */ - @Nonnull - public Pipelines resources(@Nonnull final List resources) { - this.resources = resources; - return this; - } - - /** - * Add one resources instance to this {@link Pipelines}. - * - * @param resourcesItem The resources that should be added - * @return The same instance of type {@link Pipelines} - */ - @Nonnull - public Pipelines addResourcesItem(@Nonnull final Pipeline resourcesItem) { - if (this.resources == null) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * - * @return resources The resources of this {@link Pipelines} instance. - */ - @Nonnull - public List getResources() { - return resources; - } - - /** - * Set the resources of this {@link Pipelines} instance. - * - * @param resources The resources of this {@link Pipelines} - */ - public void setResources(@Nonnull final List resources) { - this.resources = resources; - } - - /** - * Set the count of this {@link Pipelines} instance and return the same instance. - * - * @param count The count of this {@link Pipelines} - * @return The same instance of this {@link Pipelines} class - */ - @Nonnull - public Pipelines count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link Pipelines} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link Pipelines} instance. - * - * @param count The count of this {@link Pipelines} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - - /** - * Get the names of the unrecognizable properties of the {@link Pipelines}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Pipelines} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Pipelines has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Pipelines} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Pipelines pipelines = (Pipelines) o; - return Objects.equals(this.cloudSdkCustomFields, pipelines.cloudSdkCustomFields) - && Objects.equals(this.resources, pipelines.resources) - && Objects.equals(this.count, pipelines.count); - } - - @Override - public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Pipelines {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link Pipelines} instance - * with all required arguments. - */ - public static Builder builder() { - return (resources) -> () -> new Pipelines().resources(resources); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the resources of this {@link Pipelines} instance. - * - * @param resources The resources of this {@link Pipelines} - * @return The Pipelines instance. - */ - Builder1 resources(@Nonnull final List resources); - - /** - * Set the resources of this {@link Pipelines} instance. - * - * @param resources The resources of this {@link Pipelines} - * @return The Pipelines instance. - */ - default Builder1 resources(@Nonnull final Pipeline... resources) { - return resources(Arrays.asList(resources)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link Pipelines} instance. - * - * @return The Pipelines instance. - */ - Pipelines build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/ResultsInner.java b/grounding/src/main/resources/openapi/grounding/model/ResultsInner.java deleted file mode 100644 index ae70c7ebd..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/ResultsInner.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentsChunk; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** ResultsInner */ -// CHECKSTYLE:OFF -public class ResultsInner -// CHECKSTYLE:ON -{ - @JsonProperty("filterId") - private String filterId; - - @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for ResultsInner. */ - private ResultsInner() {} - - /** - * Set the filterId of this {@link ResultsInner} instance and return the same instance. - * - * @param filterId The filterId of this {@link ResultsInner} - * @return The same instance of this {@link ResultsInner} class - */ - @Nonnull - public ResultsInner filterId(@Nonnull final String filterId) { - this.filterId = filterId; - return this; - } - - /** - * Get filterId - * - * @return filterId The filterId of this {@link ResultsInner} instance. - */ - @Nonnull - public String getFilterId() { - return filterId; - } - - /** - * Set the filterId of this {@link ResultsInner} instance. - * - * @param filterId The filterId of this {@link ResultsInner} - */ - public void setFilterId(@Nonnull final String filterId) { - this.filterId = filterId; - } - - /** - * Set the results of this {@link ResultsInner} instance and return the same instance. - * - * @param results The results of this {@link ResultsInner} - * @return The same instance of this {@link ResultsInner} class - */ - @Nonnull - public ResultsInner results(@Nonnull final List results) { - this.results = results; - return this; - } - - /** - * Add one results instance to this {@link ResultsInner}. - * - * @param resultsItem The results that should be added - * @return The same instance of type {@link ResultsInner} - */ - @Nonnull - public ResultsInner addResultsItem(@Nonnull final DocumentsChunk resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Get results - * - * @return results The results of this {@link ResultsInner} instance. - */ - @Nonnull - public List getResults() { - return results; - } - - /** - * Set the results of this {@link ResultsInner} instance. - * - * @param results The results of this {@link ResultsInner} - */ - public void setResults(@Nonnull final List results) { - this.results = results; - } - - /** - * Get the names of the unrecognizable properties of the {@link ResultsInner}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ResultsInner} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("ResultsInner has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link ResultsInner} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final ResultsInner resultsInner = (ResultsInner) o; - return Objects.equals(this.cloudSdkCustomFields, resultsInner.cloudSdkCustomFields) - && Objects.equals(this.filterId, resultsInner.filterId) - && Objects.equals(this.results, resultsInner.results); - } - - @Override - public int hashCode() { - return Objects.hash(filterId, results, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class ResultsInner {\n"); - sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner} instance - * with all required arguments. - */ - public static Builder builder() { - return (filterId) -> (results) -> () -> new ResultsInner().filterId(filterId).results(results); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filterId of this {@link ResultsInner} instance. - * - * @param filterId The filterId of this {@link ResultsInner} - * @return The ResultsInner builder. - */ - Builder1 filterId(@Nonnull final String filterId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the results of this {@link ResultsInner} instance. - * - * @param results The results of this {@link ResultsInner} - * @return The ResultsInner instance. - */ - Builder2 results(@Nonnull final List results); - - /** - * Set the results of this {@link ResultsInner} instance. - * - * @param results The results of this {@link ResultsInner} - * @return The ResultsInner instance. - */ - default Builder2 results(@Nonnull final DocumentsChunk... results) { - return results(Arrays.asList(results)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link ResultsInner} instance. - * - * @return The ResultsInner instance. - */ - ResultsInner build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java b/grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java deleted file mode 100644 index 06a89b87c..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/ResultsInner1.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetievalDataRepositorySearchResult; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** ResultsInner1 */ -// CHECKSTYLE:OFF -public class ResultsInner1 -// CHECKSTYLE:ON -{ - @JsonProperty("filterId") - private String filterId; - - @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonProperty("message") - private String message; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for ResultsInner1. */ - private ResultsInner1() {} - - /** - * Set the filterId of this {@link ResultsInner1} instance and return the same instance. - * - * @param filterId The filterId of this {@link ResultsInner1} - * @return The same instance of this {@link ResultsInner1} class - */ - @Nonnull - public ResultsInner1 filterId(@Nonnull final String filterId) { - this.filterId = filterId; - return this; - } - - /** - * Get filterId - * - * @return filterId The filterId of this {@link ResultsInner1} instance. - */ - @Nonnull - public String getFilterId() { - return filterId; - } - - /** - * Set the filterId of this {@link ResultsInner1} instance. - * - * @param filterId The filterId of this {@link ResultsInner1} - */ - public void setFilterId(@Nonnull final String filterId) { - this.filterId = filterId; - } - - /** - * Set the results of this {@link ResultsInner1} instance and return the same instance. - * - * @param results List of returned results. - * @return The same instance of this {@link ResultsInner1} class - */ - @Nonnull - public ResultsInner1 results(@Nullable final List results) { - this.results = results; - return this; - } - - /** - * Add one results instance to this {@link ResultsInner1}. - * - * @param resultsItem The results that should be added - * @return The same instance of type {@link ResultsInner1} - */ - @Nonnull - public ResultsInner1 addResultsItem( - @Nonnull final RetievalDataRepositorySearchResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * List of returned results. - * - * @return results The results of this {@link ResultsInner1} instance. - */ - @Nonnull - public List getResults() { - return results; - } - - /** - * Set the results of this {@link ResultsInner1} instance. - * - * @param results List of returned results. - */ - public void setResults(@Nullable final List results) { - this.results = results; - } - - /** - * Set the message of this {@link ResultsInner1} instance and return the same instance. - * - * @param message The message of this {@link ResultsInner1} - * @return The same instance of this {@link ResultsInner1} class - */ - @Nonnull - public ResultsInner1 message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link ResultsInner1} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link ResultsInner1} instance. - * - * @param message The message of this {@link ResultsInner1} - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link ResultsInner1}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ResultsInner1} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("ResultsInner1 has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link ResultsInner1} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final ResultsInner1 resultsInner1 = (ResultsInner1) o; - return Objects.equals(this.cloudSdkCustomFields, resultsInner1.cloudSdkCustomFields) - && Objects.equals(this.filterId, resultsInner1.filterId) - && Objects.equals(this.results, resultsInner1.results) - && Objects.equals(this.message, resultsInner1.message); - } - - @Override - public int hashCode() { - return Objects.hash(filterId, results, message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class ResultsInner1 {\n"); - sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner1} instance - * with all required arguments. - */ - public static Builder builder() { - return (filterId) -> (message) -> () -> new ResultsInner1().filterId(filterId).message(message); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filterId of this {@link ResultsInner1} instance. - * - * @param filterId The filterId of this {@link ResultsInner1} - * @return The ResultsInner1 builder. - */ - Builder1 filterId(@Nonnull final String filterId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link ResultsInner1} instance. - * - * @param message The message of this {@link ResultsInner1} - * @return The ResultsInner1 instance. - */ - Builder2 message(@Nonnull final String message); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link ResultsInner1} instance. - * - * @return The ResultsInner1 instance. - */ - ResultsInner1 build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java b/grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java deleted file mode 100644 index 9ad9d4226..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetievalDataRepositorySearchResult.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositoryWithDocuments; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetievalDataRepositorySearchResult */ -// CHECKSTYLE:OFF -public class RetievalDataRepositorySearchResult -// CHECKSTYLE:ON -{ - @JsonProperty("dataRepository") - private DataRepositoryWithDocuments dataRepository; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetievalDataRepositorySearchResult. */ - private RetievalDataRepositorySearchResult() {} - - /** - * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance and return - * the same instance. - * - * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - * @return The same instance of this {@link RetievalDataRepositorySearchResult} class - */ - @Nonnull - public RetievalDataRepositorySearchResult dataRepository( - @Nonnull final DataRepositoryWithDocuments dataRepository) { - this.dataRepository = dataRepository; - return this; - } - - /** - * Get dataRepository - * - * @return dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - * instance. - */ - @Nonnull - public DataRepositoryWithDocuments getDataRepository() { - return dataRepository; - } - - /** - * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. - * - * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - */ - public void setDataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository) { - this.dataRepository = dataRepository; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * RetievalDataRepositorySearchResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetievalDataRepositorySearchResult} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetievalDataRepositorySearchResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetievalDataRepositorySearchResult} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetievalDataRepositorySearchResult retievalDataRepositorySearchResult = - (RetievalDataRepositorySearchResult) o; - return Objects.equals( - this.cloudSdkCustomFields, retievalDataRepositorySearchResult.cloudSdkCustomFields) - && Objects.equals(this.dataRepository, retievalDataRepositorySearchResult.dataRepository); - } - - @Override - public int hashCode() { - return Objects.hash(dataRepository, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalDataRepositorySearchResult {\n"); - sb.append(" dataRepository: ").append(toIndentedString(dataRepository)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * RetievalDataRepositorySearchResult} instance with all required arguments. - */ - public static Builder builder() { - return (dataRepository) -> - () -> new RetievalDataRepositorySearchResult().dataRepository(dataRepository); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. - * - * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - * @return The RetievalDataRepositorySearchResult instance. - */ - Builder1 dataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link RetievalDataRepositorySearchResult} instance. - * - * @return The RetievalDataRepositorySearchResult instance. - */ - RetievalDataRepositorySearchResult build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java b/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java deleted file mode 100644 index eaa5e3839..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResult.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetievalDataRepositorySearchResult; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetievalPerFilterSearchResult */ -// CHECKSTYLE:OFF -public class RetievalPerFilterSearchResult -// CHECKSTYLE:ON -{ - @JsonProperty("filterId") - private String filterId; - - @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetievalPerFilterSearchResult. */ - private RetievalPerFilterSearchResult() {} - - /** - * Set the filterId of this {@link RetievalPerFilterSearchResult} instance and return the same - * instance. - * - * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} - * @return The same instance of this {@link RetievalPerFilterSearchResult} class - */ - @Nonnull - public RetievalPerFilterSearchResult filterId(@Nonnull final String filterId) { - this.filterId = filterId; - return this; - } - - /** - * Get filterId - * - * @return filterId The filterId of this {@link RetievalPerFilterSearchResult} instance. - */ - @Nonnull - public String getFilterId() { - return filterId; - } - - /** - * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. - * - * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} - */ - public void setFilterId(@Nonnull final String filterId) { - this.filterId = filterId; - } - - /** - * Set the results of this {@link RetievalPerFilterSearchResult} instance and return the same - * instance. - * - * @param results List of returned results. - * @return The same instance of this {@link RetievalPerFilterSearchResult} class - */ - @Nonnull - public RetievalPerFilterSearchResult results( - @Nullable final List results) { - this.results = results; - return this; - } - - /** - * Add one results instance to this {@link RetievalPerFilterSearchResult}. - * - * @param resultsItem The results that should be added - * @return The same instance of type {@link RetievalPerFilterSearchResult} - */ - @Nonnull - public RetievalPerFilterSearchResult addResultsItem( - @Nonnull final RetievalDataRepositorySearchResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * List of returned results. - * - * @return results The results of this {@link RetievalPerFilterSearchResult} instance. - */ - @Nonnull - public List getResults() { - return results; - } - - /** - * Set the results of this {@link RetievalPerFilterSearchResult} instance. - * - * @param results List of returned results. - */ - public void setResults(@Nullable final List results) { - this.results = results; - } - - /** - * Get the names of the unrecognizable properties of the {@link RetievalPerFilterSearchResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetievalPerFilterSearchResult} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetievalPerFilterSearchResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetievalPerFilterSearchResult} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetievalPerFilterSearchResult retievalPerFilterSearchResult = - (RetievalPerFilterSearchResult) o; - return Objects.equals( - this.cloudSdkCustomFields, retievalPerFilterSearchResult.cloudSdkCustomFields) - && Objects.equals(this.filterId, retievalPerFilterSearchResult.filterId) - && Objects.equals(this.results, retievalPerFilterSearchResult.results); - } - - @Override - public int hashCode() { - return Objects.hash(filterId, results, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalPerFilterSearchResult {\n"); - sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * RetievalPerFilterSearchResult} instance with all required arguments. - */ - public static Builder builder() { - return (filterId) -> () -> new RetievalPerFilterSearchResult().filterId(filterId); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. - * - * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} - * @return The RetievalPerFilterSearchResult instance. - */ - Builder1 filterId(@Nonnull final String filterId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link RetievalPerFilterSearchResult} instance. - * - * @return The RetievalPerFilterSearchResult instance. - */ - RetievalPerFilterSearchResult build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java b/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java deleted file mode 100644 index 0cc2b13be..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetievalPerFilterSearchResultWithError.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetievalPerFilterSearchResultWithError */ -// CHECKSTYLE:OFF -public class RetievalPerFilterSearchResultWithError -// CHECKSTYLE:ON -{ - @JsonProperty("message") - private String message; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetievalPerFilterSearchResultWithError. */ - private RetievalPerFilterSearchResultWithError() {} - - /** - * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance and return the - * same instance. - * - * @param message The message of this {@link RetievalPerFilterSearchResultWithError} - * @return The same instance of this {@link RetievalPerFilterSearchResultWithError} class - */ - @Nonnull - public RetievalPerFilterSearchResultWithError message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link RetievalPerFilterSearchResultWithError} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. - * - * @param message The message of this {@link RetievalPerFilterSearchResultWithError} - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * RetievalPerFilterSearchResultWithError}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * RetievalPerFilterSearchResultWithError} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetievalPerFilterSearchResultWithError has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetievalPerFilterSearchResultWithError} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetievalPerFilterSearchResultWithError retievalPerFilterSearchResultWithError = - (RetievalPerFilterSearchResultWithError) o; - return Objects.equals( - this.cloudSdkCustomFields, retievalPerFilterSearchResultWithError.cloudSdkCustomFields) - && Objects.equals(this.message, retievalPerFilterSearchResultWithError.message); - } - - @Override - public int hashCode() { - return Objects.hash(message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalPerFilterSearchResultWithError {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * RetievalPerFilterSearchResultWithError} instance with all required arguments. - */ - public static Builder builder() { - return (message) -> () -> new RetievalPerFilterSearchResultWithError().message(message); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. - * - * @param message The message of this {@link RetievalPerFilterSearchResultWithError} - * @return The RetievalPerFilterSearchResultWithError instance. - */ - Builder1 message(@Nonnull final String message); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link RetievalPerFilterSearchResultWithError} instance. - * - * @return The RetievalPerFilterSearchResultWithError instance. - */ - RetievalPerFilterSearchResultWithError build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java b/grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java deleted file mode 100644 index 6dfb0b111..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetievalSearchResults.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.ResultsInner1; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetievalSearchResults */ -// CHECKSTYLE:OFF -public class RetievalSearchResults -// CHECKSTYLE:ON -{ - @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetievalSearchResults. */ - private RetievalSearchResults() {} - - /** - * Set the results of this {@link RetievalSearchResults} instance and return the same instance. - * - * @param results List of returned results. - * @return The same instance of this {@link RetievalSearchResults} class - */ - @Nonnull - public RetievalSearchResults results(@Nonnull final List results) { - this.results = results; - return this; - } - - /** - * Add one results instance to this {@link RetievalSearchResults}. - * - * @param resultsItem The results that should be added - * @return The same instance of type {@link RetievalSearchResults} - */ - @Nonnull - public RetievalSearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * List of returned results. - * - * @return results The results of this {@link RetievalSearchResults} instance. - */ - @Nonnull - public List getResults() { - return results; - } - - /** - * Set the results of this {@link RetievalSearchResults} instance. - * - * @param results List of returned results. - */ - public void setResults(@Nonnull final List results) { - this.results = results; - } - - /** - * Get the names of the unrecognizable properties of the {@link RetievalSearchResults}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetievalSearchResults} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetievalSearchResults has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetievalSearchResults} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetievalSearchResults retievalSearchResults = (RetievalSearchResults) o; - return Objects.equals(this.cloudSdkCustomFields, retievalSearchResults.cloudSdkCustomFields) - && Objects.equals(this.results, retievalSearchResults.results); - } - - @Override - public int hashCode() { - return Objects.hash(results, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalSearchResults {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetievalSearchResults} - * instance with all required arguments. - */ - public static Builder builder() { - return (results) -> () -> new RetievalSearchResults().results(results); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the results of this {@link RetievalSearchResults} instance. - * - * @param results List of returned results. - * @return The RetievalSearchResults instance. - */ - Builder1 results(@Nonnull final List results); - - /** - * Set the results of this {@link RetievalSearchResults} instance. - * - * @param results List of returned results. - * @return The RetievalSearchResults instance. - */ - default Builder1 results(@Nonnull final ResultsInner1... results) { - return results(Arrays.asList(results)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link RetievalSearchResults} instance. - * - * @return The RetievalSearchResults instance. - */ - RetievalSearchResults build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java b/grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java deleted file mode 100644 index ad2dc2271..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetrievalDocument.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.Chunk; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DocumentKeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetrievalDocument */ -// CHECKSTYLE:OFF -public class RetrievalDocument -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonProperty("chunks") - private List chunks = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetrievalDocument. */ - private RetrievalDocument() {} - - /** - * Set the id of this {@link RetrievalDocument} instance and return the same instance. - * - * @param id The id of this {@link RetrievalDocument} - * @return The same instance of this {@link RetrievalDocument} class - */ - @Nonnull - public RetrievalDocument id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link RetrievalDocument} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link RetrievalDocument} instance. - * - * @param id The id of this {@link RetrievalDocument} - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the metadata of this {@link RetrievalDocument} instance and return the same instance. - * - * @param metadata The metadata of this {@link RetrievalDocument} - * @return The same instance of this {@link RetrievalDocument} class - */ - @Nonnull - public RetrievalDocument metadata(@Nullable final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link RetrievalDocument}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link RetrievalDocument} - */ - @Nonnull - public RetrievalDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link RetrievalDocument} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link RetrievalDocument} instance. - * - * @param metadata The metadata of this {@link RetrievalDocument} - */ - public void setMetadata(@Nullable final List metadata) { - this.metadata = metadata; - } - - /** - * Set the chunks of this {@link RetrievalDocument} instance and return the same instance. - * - * @param chunks The chunks of this {@link RetrievalDocument} - * @return The same instance of this {@link RetrievalDocument} class - */ - @Nonnull - public RetrievalDocument chunks(@Nonnull final List chunks) { - this.chunks = chunks; - return this; - } - - /** - * Add one chunks instance to this {@link RetrievalDocument}. - * - * @param chunksItem The chunks that should be added - * @return The same instance of type {@link RetrievalDocument} - */ - @Nonnull - public RetrievalDocument addChunksItem(@Nonnull final Chunk chunksItem) { - if (this.chunks == null) { - this.chunks = new ArrayList<>(); - } - this.chunks.add(chunksItem); - return this; - } - - /** - * Get chunks - * - * @return chunks The chunks of this {@link RetrievalDocument} instance. - */ - @Nonnull - public List getChunks() { - return chunks; - } - - /** - * Set the chunks of this {@link RetrievalDocument} instance. - * - * @param chunks The chunks of this {@link RetrievalDocument} - */ - public void setChunks(@Nonnull final List chunks) { - this.chunks = chunks; - } - - /** - * Get the names of the unrecognizable properties of the {@link RetrievalDocument}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetrievalDocument} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("RetrievalDocument has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetrievalDocument} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetrievalDocument retrievalDocument = (RetrievalDocument) o; - return Objects.equals(this.cloudSdkCustomFields, retrievalDocument.cloudSdkCustomFields) - && Objects.equals(this.id, retrievalDocument.id) - && Objects.equals(this.metadata, retrievalDocument.metadata) - && Objects.equals(this.chunks, retrievalDocument.chunks); - } - - @Override - public int hashCode() { - return Objects.hash(id, metadata, chunks, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetrievalDocument {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalDocument} - * instance with all required arguments. - */ - public static Builder builder() { - return (id) -> (chunks) -> () -> new RetrievalDocument().id(id).chunks(chunks); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link RetrievalDocument} instance. - * - * @param id The id of this {@link RetrievalDocument} - * @return The RetrievalDocument builder. - */ - Builder1 id(@Nonnull final String id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the chunks of this {@link RetrievalDocument} instance. - * - * @param chunks The chunks of this {@link RetrievalDocument} - * @return The RetrievalDocument instance. - */ - Builder2 chunks(@Nonnull final List chunks); - - /** - * Set the chunks of this {@link RetrievalDocument} instance. - * - * @param chunks The chunks of this {@link RetrievalDocument} - * @return The RetrievalDocument instance. - */ - default Builder2 chunks(@Nonnull final Chunk... chunks) { - return chunks(Arrays.asList(chunks)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link RetrievalDocument} instance. - * - * @return The RetrievalDocument instance. - */ - RetrievalDocument build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java deleted file mode 100644 index 52854207f..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchFilter.java +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.DataRepositoryType; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchConfiguration; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchDocumentKeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Limit scope of search to certain DataRepositories, Documents or Chunks. */ -// CHECKSTYLE:OFF -public class RetrievalSearchFilter -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("searchConfiguration") - private SearchConfiguration searchConfiguration; - - @JsonProperty("dataRepositories") - private List dataRepositories = new ArrayList<>(Arrays.asList("*")); - - @JsonProperty("dataRepositoryType") - private DataRepositoryType dataRepositoryType; - - @JsonProperty("dataRepositoryMetadata") - private List dataRepositoryMetadata = new ArrayList<>(); - - @JsonProperty("documentMetadata") - private List documentMetadata = new ArrayList<>(); - - @JsonProperty("chunkMetadata") - private List chunkMetadata = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetrievalSearchFilter. */ - private RetrievalSearchFilter() {} - - /** - * Set the id of this {@link RetrievalSearchFilter} instance and return the same instance. - * - * @param id Identifier of this SearchFilter - unique per request. - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * Identifier of this SearchFilter - unique per request. - * - * @return id The id of this {@link RetrievalSearchFilter} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link RetrievalSearchFilter} instance. - * - * @param id Identifier of this SearchFilter - unique per request. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the searchConfiguration of this {@link RetrievalSearchFilter} instance and return the same - * instance. - * - * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter searchConfiguration( - @Nullable final SearchConfiguration searchConfiguration) { - this.searchConfiguration = searchConfiguration; - return this; - } - - /** - * Get searchConfiguration - * - * @return searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} - * instance. - */ - @Nonnull - public SearchConfiguration getSearchConfiguration() { - return searchConfiguration; - } - - /** - * Set the searchConfiguration of this {@link RetrievalSearchFilter} instance. - * - * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} - */ - public void setSearchConfiguration(@Nullable final SearchConfiguration searchConfiguration) { - this.searchConfiguration = searchConfiguration; - } - - /** - * Set the dataRepositories of this {@link RetrievalSearchFilter} instance and return the same - * instance. - * - * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a - * specific list of DataRepository ids. - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter dataRepositories(@Nullable final List dataRepositories) { - this.dataRepositories = dataRepositories; - return this; - } - - /** - * Add one dataRepositories instance to this {@link RetrievalSearchFilter}. - * - * @param dataRepositoriesItem The dataRepositories that should be added - * @return The same instance of type {@link RetrievalSearchFilter} - */ - @Nonnull - public RetrievalSearchFilter addDataRepositoriesItem(@Nonnull final String dataRepositoriesItem) { - if (this.dataRepositories == null) { - this.dataRepositories = new ArrayList<>(Arrays.asList("*")); - } - this.dataRepositories.add(dataRepositoriesItem); - return this; - } - - /** - * Specify ['*'] to search across all DataRepositories or give a specific list of - * DataRepository ids. - * - * @return dataRepositories The dataRepositories of this {@link RetrievalSearchFilter} instance. - */ - @Nonnull - public List getDataRepositories() { - return dataRepositories; - } - - /** - * Set the dataRepositories of this {@link RetrievalSearchFilter} instance. - * - * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a - * specific list of DataRepository ids. - */ - public void setDataRepositories(@Nullable final List dataRepositories) { - this.dataRepositories = dataRepositories; - } - - /** - * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance and return the same - * instance. - * - * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter dataRepositoryType( - @Nullable final DataRepositoryType dataRepositoryType) { - this.dataRepositoryType = dataRepositoryType; - return this; - } - - /** - * Get dataRepositoryType - * - * @return dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} - * instance. - */ - @Nullable - public DataRepositoryType getDataRepositoryType() { - return dataRepositoryType; - } - - /** - * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance. - * - * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} - */ - public void setDataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType) { - this.dataRepositoryType = dataRepositoryType; - } - - /** - * Set the dataRepositoryMetadata of this {@link RetrievalSearchFilter} instance and return the - * same instance. - * - * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those - * annotated with the given metadata. Useful when combined with - * dataRepositories=['*'] - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter dataRepositoryMetadata( - @Nullable final List dataRepositoryMetadata) { - this.dataRepositoryMetadata = dataRepositoryMetadata; - return this; - } - - /** - * Add one dataRepositoryMetadata instance to this {@link RetrievalSearchFilter}. - * - * @param dataRepositoryMetadataItem The dataRepositoryMetadata that should be added - * @return The same instance of type {@link RetrievalSearchFilter} - */ - @Nonnull - public RetrievalSearchFilter addDataRepositoryMetadataItem( - @Nonnull final KeyValueListPair dataRepositoryMetadataItem) { - if (this.dataRepositoryMetadata == null) { - this.dataRepositoryMetadata = new ArrayList<>(); - } - this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); - return this; - } - - /** - * Restrict DataRepositories considered during search to those annotated with the given metadata. - * Useful when combined with dataRepositories=['*'] - * - * @return dataRepositoryMetadata The dataRepositoryMetadata of this {@link RetrievalSearchFilter} - * instance. - */ - @Nonnull - public List getDataRepositoryMetadata() { - return dataRepositoryMetadata; - } - - /** - * Set the dataRepositoryMetadata of this {@link RetrievalSearchFilter} instance. - * - * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those - * annotated with the given metadata. Useful when combined with - * dataRepositories=['*'] - */ - public void setDataRepositoryMetadata( - @Nullable final List dataRepositoryMetadata) { - this.dataRepositoryMetadata = dataRepositoryMetadata; - } - - /** - * Set the documentMetadata of this {@link RetrievalSearchFilter} instance and return the same - * instance. - * - * @param documentMetadata Restrict documents considered during search to those annotated with the - * given metadata. - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter documentMetadata( - @Nullable final List documentMetadata) { - this.documentMetadata = documentMetadata; - return this; - } - - /** - * Add one documentMetadata instance to this {@link RetrievalSearchFilter}. - * - * @param documentMetadataItem The documentMetadata that should be added - * @return The same instance of type {@link RetrievalSearchFilter} - */ - @Nonnull - public RetrievalSearchFilter addDocumentMetadataItem( - @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { - if (this.documentMetadata == null) { - this.documentMetadata = new ArrayList<>(); - } - this.documentMetadata.add(documentMetadataItem); - return this; - } - - /** - * Restrict documents considered during search to those annotated with the given metadata. - * - * @return documentMetadata The documentMetadata of this {@link RetrievalSearchFilter} instance. - */ - @Nonnull - public List getDocumentMetadata() { - return documentMetadata; - } - - /** - * Set the documentMetadata of this {@link RetrievalSearchFilter} instance. - * - * @param documentMetadata Restrict documents considered during search to those annotated with the - * given metadata. - */ - public void setDocumentMetadata( - @Nullable final List documentMetadata) { - this.documentMetadata = documentMetadata; - } - - /** - * Set the chunkMetadata of this {@link RetrievalSearchFilter} instance and return the same - * instance. - * - * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. - * @return The same instance of this {@link RetrievalSearchFilter} class - */ - @Nonnull - public RetrievalSearchFilter chunkMetadata(@Nullable final List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - return this; - } - - /** - * Add one chunkMetadata instance to this {@link RetrievalSearchFilter}. - * - * @param chunkMetadataItem The chunkMetadata that should be added - * @return The same instance of type {@link RetrievalSearchFilter} - */ - @Nonnull - public RetrievalSearchFilter addChunkMetadataItem( - @Nonnull final KeyValueListPair chunkMetadataItem) { - if (this.chunkMetadata == null) { - this.chunkMetadata = new ArrayList<>(); - } - this.chunkMetadata.add(chunkMetadataItem); - return this; - } - - /** - * Restrict chunks considered during search to those with the given metadata. - * - * @return chunkMetadata The chunkMetadata of this {@link RetrievalSearchFilter} instance. - */ - @Nonnull - public List getChunkMetadata() { - return chunkMetadata; - } - - /** - * Set the chunkMetadata of this {@link RetrievalSearchFilter} instance. - * - * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. - */ - public void setChunkMetadata(@Nullable final List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link RetrievalSearchFilter}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetrievalSearchFilter} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetrievalSearchFilter has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetrievalSearchFilter} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetrievalSearchFilter retrievalSearchFilter = (RetrievalSearchFilter) o; - return Objects.equals(this.cloudSdkCustomFields, retrievalSearchFilter.cloudSdkCustomFields) - && Objects.equals(this.id, retrievalSearchFilter.id) - && Objects.equals(this.searchConfiguration, retrievalSearchFilter.searchConfiguration) - && Objects.equals(this.dataRepositories, retrievalSearchFilter.dataRepositories) - && Objects.equals(this.dataRepositoryType, retrievalSearchFilter.dataRepositoryType) - && Objects.equals(this.dataRepositoryMetadata, retrievalSearchFilter.dataRepositoryMetadata) - && Objects.equals(this.documentMetadata, retrievalSearchFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, retrievalSearchFilter.chunkMetadata); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - searchConfiguration, - dataRepositories, - dataRepositoryType, - dataRepositoryMetadata, - documentMetadata, - chunkMetadata, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetrievalSearchFilter {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" searchConfiguration: ") - .append(toIndentedString(searchConfiguration)) - .append("\n"); - sb.append(" dataRepositories: ").append(toIndentedString(dataRepositories)).append("\n"); - sb.append(" dataRepositoryType: ").append(toIndentedString(dataRepositoryType)).append("\n"); - sb.append(" dataRepositoryMetadata: ") - .append(toIndentedString(dataRepositoryMetadata)) - .append("\n"); - sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); - sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchFilter} - * instance with all required arguments. - */ - public static Builder builder() { - return (id) -> - (dataRepositoryType) -> - () -> new RetrievalSearchFilter().id(id).dataRepositoryType(dataRepositoryType); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link RetrievalSearchFilter} instance. - * - * @param id Identifier of this SearchFilter - unique per request. - * @return The RetrievalSearchFilter builder. - */ - Builder1 id(@Nonnull final String id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the dataRepositoryType of this {@link RetrievalSearchFilter} instance. - * - * @param dataRepositoryType The dataRepositoryType of this {@link RetrievalSearchFilter} - * @return The RetrievalSearchFilter instance. - */ - Builder2 dataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link RetrievalSearchFilter} instance. - * - * @return The RetrievalSearchFilter instance. - */ - RetrievalSearchFilter build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java b/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java deleted file mode 100644 index 396e01ff7..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/RetrievalSearchInput.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.RetrievalSearchFilter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetrievalSearchInput */ -// CHECKSTYLE:OFF -public class RetrievalSearchInput -// CHECKSTYLE:ON -{ - @JsonProperty("query") - private String query; - - @JsonProperty("filters") - private List filters = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetrievalSearchInput. */ - private RetrievalSearchInput() {} - - /** - * Set the query of this {@link RetrievalSearchInput} instance and return the same instance. - * - * @param query Query string - * @return The same instance of this {@link RetrievalSearchInput} class - */ - @Nonnull - public RetrievalSearchInput query(@Nonnull final String query) { - this.query = query; - return this; - } - - /** - * Query string - * - * @return query The query of this {@link RetrievalSearchInput} instance. - */ - @Nonnull - public String getQuery() { - return query; - } - - /** - * Set the query of this {@link RetrievalSearchInput} instance. - * - * @param query Query string - */ - public void setQuery(@Nonnull final String query) { - this.query = query; - } - - /** - * Set the filters of this {@link RetrievalSearchInput} instance and return the same instance. - * - * @param filters The filters of this {@link RetrievalSearchInput} - * @return The same instance of this {@link RetrievalSearchInput} class - */ - @Nonnull - public RetrievalSearchInput filters(@Nonnull final List filters) { - this.filters = filters; - return this; - } - - /** - * Add one filters instance to this {@link RetrievalSearchInput}. - * - * @param filtersItem The filters that should be added - * @return The same instance of type {@link RetrievalSearchInput} - */ - @Nonnull - public RetrievalSearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { - if (this.filters == null) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - - /** - * Get filters - * - * @return filters The filters of this {@link RetrievalSearchInput} instance. - */ - @Nonnull - public List getFilters() { - return filters; - } - - /** - * Set the filters of this {@link RetrievalSearchInput} instance. - * - * @param filters The filters of this {@link RetrievalSearchInput} - */ - public void setFilters(@Nonnull final List filters) { - this.filters = filters; - } - - /** - * Get the names of the unrecognizable properties of the {@link RetrievalSearchInput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetrievalSearchInput} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetrievalSearchInput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link RetrievalSearchInput} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetrievalSearchInput retrievalSearchInput = (RetrievalSearchInput) o; - return Objects.equals(this.cloudSdkCustomFields, retrievalSearchInput.cloudSdkCustomFields) - && Objects.equals(this.query, retrievalSearchInput.query) - && Objects.equals(this.filters, retrievalSearchInput.filters); - } - - @Override - public int hashCode() { - return Objects.hash(query, filters, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetrievalSearchInput {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchInput} - * instance with all required arguments. - */ - public static Builder builder() { - return (query) -> (filters) -> () -> new RetrievalSearchInput().query(query).filters(filters); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the query of this {@link RetrievalSearchInput} instance. - * - * @param query Query string - * @return The RetrievalSearchInput builder. - */ - Builder1 query(@Nonnull final String query); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the filters of this {@link RetrievalSearchInput} instance. - * - * @param filters The filters of this {@link RetrievalSearchInput} - * @return The RetrievalSearchInput instance. - */ - Builder2 filters(@Nonnull final List filters); - - /** - * Set the filters of this {@link RetrievalSearchInput} instance. - * - * @param filters The filters of this {@link RetrievalSearchInput} - * @return The RetrievalSearchInput instance. - */ - default Builder2 filters(@Nonnull final RetrievalSearchFilter... filters) { - return filters(Arrays.asList(filters)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link RetrievalSearchInput} instance. - * - * @return The RetrievalSearchInput instance. - */ - RetrievalSearchInput build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java b/grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java deleted file mode 100644 index c95706529..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/SearchConfiguration.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** SearchConfiguration */ -// CHECKSTYLE:OFF -public class SearchConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty("maxChunkCount") - private Integer maxChunkCount; - - @JsonProperty("maxDocumentCount") - private Integer maxDocumentCount; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for SearchConfiguration. */ - private SearchConfiguration() {} - - /** - * Set the maxChunkCount of this {@link SearchConfiguration} instance and return the same - * instance. - * - * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with - * 'maxDocumentCount'. Minimum: 0 Maximum: 0 - * @return The same instance of this {@link SearchConfiguration} class - */ - @Nonnull - public SearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) { - this.maxChunkCount = maxChunkCount; - return this; - } - - /** - * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. - * minimum: 0 maximum: 0 - * - * @return maxChunkCount The maxChunkCount of this {@link SearchConfiguration} instance. - */ - @Nonnull - public Integer getMaxChunkCount() { - return maxChunkCount; - } - - /** - * Set the maxChunkCount of this {@link SearchConfiguration} instance. - * - * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with - * 'maxDocumentCount'. Minimum: 0 Maximum: 0 - */ - public void setMaxChunkCount(@Nullable final Integer maxChunkCount) { - this.maxChunkCount = maxChunkCount; - } - - /** - * Set the maxDocumentCount of this {@link SearchConfiguration} instance and return the same - * instance. - * - * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of - * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount - * is given, then only one chunk per document is returned. Minimum: 0 Maximum: 0 - * @return The same instance of this {@link SearchConfiguration} class - */ - @Nonnull - public SearchConfiguration maxDocumentCount(@Nullable final Integer maxDocumentCount) { - this.maxDocumentCount = maxDocumentCount; - return this; - } - - /** - * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be - * returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only - * one chunk per document is returned. minimum: 0 maximum: 0 - * - * @return maxDocumentCount The maxDocumentCount of this {@link SearchConfiguration} instance. - */ - @Nonnull - public Integer getMaxDocumentCount() { - return maxDocumentCount; - } - - /** - * Set the maxDocumentCount of this {@link SearchConfiguration} instance. - * - * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of - * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount - * is given, then only one chunk per document is returned. Minimum: 0 Maximum: 0 - */ - public void setMaxDocumentCount(@Nullable final Integer maxDocumentCount) { - this.maxDocumentCount = maxDocumentCount; - } - - /** - * Get the names of the unrecognizable properties of the {@link SearchConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SearchConfiguration} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "SearchConfiguration has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link SearchConfiguration} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final SearchConfiguration searchConfiguration = (SearchConfiguration) o; - return Objects.equals(this.cloudSdkCustomFields, searchConfiguration.cloudSdkCustomFields) - && Objects.equals(this.maxChunkCount, searchConfiguration.maxChunkCount) - && Objects.equals(this.maxDocumentCount, searchConfiguration.maxDocumentCount); - } - - @Override - public int hashCode() { - return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class SearchConfiguration {\n"); - sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); - sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link SearchConfiguration} instance. No arguments are required. */ - public static SearchConfiguration builder() { - return new SearchConfiguration(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java deleted file mode 100644 index 6e46c723e..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/SearchDocumentKeyValueListPair.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchSelectOptionEnum; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** SearchDocumentKeyValueListPair */ -// CHECKSTYLE:OFF -public class SearchDocumentKeyValueListPair -// CHECKSTYLE:ON -{ - @JsonProperty("key") - private String key; - - @JsonProperty("value") - private List value = new ArrayList<>(); - - @JsonProperty("selectMode") - private List selectMode = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for SearchDocumentKeyValueListPair. */ - private SearchDocumentKeyValueListPair() {} - - /** - * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same - * instance. - * - * @param key The key of this {@link SearchDocumentKeyValueListPair} - * @return The same instance of this {@link SearchDocumentKeyValueListPair} class - */ - @Nonnull - public SearchDocumentKeyValueListPair key(@Nonnull final String key) { - this.key = key; - return this; - } - - /** - * Get key - * - * @return key The key of this {@link SearchDocumentKeyValueListPair} instance. - */ - @Nonnull - public String getKey() { - return key; - } - - /** - * Set the key of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param key The key of this {@link SearchDocumentKeyValueListPair} - */ - public void setKey(@Nonnull final String key) { - this.key = key; - } - - /** - * Set the value of this {@link SearchDocumentKeyValueListPair} instance and return the same - * instance. - * - * @param value The value of this {@link SearchDocumentKeyValueListPair} - * @return The same instance of this {@link SearchDocumentKeyValueListPair} class - */ - @Nonnull - public SearchDocumentKeyValueListPair value(@Nonnull final List value) { - this.value = value; - return this; - } - - /** - * Add one value instance to this {@link SearchDocumentKeyValueListPair}. - * - * @param valueItem The value that should be added - * @return The same instance of type {@link SearchDocumentKeyValueListPair} - */ - @Nonnull - public SearchDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { - if (this.value == null) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); - return this; - } - - /** - * Get value - * - * @return value The value of this {@link SearchDocumentKeyValueListPair} instance. - */ - @Nonnull - public List getValue() { - return value; - } - - /** - * Set the value of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param value The value of this {@link SearchDocumentKeyValueListPair} - */ - public void setValue(@Nonnull final List value) { - this.value = value; - } - - /** - * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance and return the same - * instance. - * - * @param selectMode Select mode for search filters - * @return The same instance of this {@link SearchDocumentKeyValueListPair} class - */ - @Nonnull - public SearchDocumentKeyValueListPair selectMode( - @Nullable final List selectMode) { - this.selectMode = selectMode; - return this; - } - - /** - * Add one selectMode instance to this {@link SearchDocumentKeyValueListPair}. - * - * @param selectModeItem The selectMode that should be added - * @return The same instance of type {@link SearchDocumentKeyValueListPair} - */ - @Nonnull - public SearchDocumentKeyValueListPair addSelectModeItem( - @Nonnull final SearchSelectOptionEnum selectModeItem) { - if (this.selectMode == null) { - this.selectMode = new ArrayList<>(); - } - this.selectMode.add(selectModeItem); - return this; - } - - /** - * Select mode for search filters - * - * @return selectMode The selectMode of this {@link SearchDocumentKeyValueListPair} instance. - */ - @Nonnull - public List getSelectMode() { - return selectMode; - } - - /** - * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param selectMode Select mode for search filters - */ - public void setSelectMode(@Nullable final List selectMode) { - this.selectMode = selectMode; - } - - /** - * Get the names of the unrecognizable properties of the {@link SearchDocumentKeyValueListPair}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} - * instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "SearchDocumentKeyValueListPair has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = - (SearchDocumentKeyValueListPair) o; - return Objects.equals( - this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) - && Objects.equals(this.key, searchDocumentKeyValueListPair.key) - && Objects.equals(this.value, searchDocumentKeyValueListPair.value) - && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, selectMode, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class SearchDocumentKeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * SearchDocumentKeyValueListPair} instance with all required arguments. - */ - public static Builder builder() { - return (key) -> (value) -> () -> new SearchDocumentKeyValueListPair().key(key).value(value); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the key of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param key The key of this {@link SearchDocumentKeyValueListPair} - * @return The SearchDocumentKeyValueListPair builder. - */ - Builder1 key(@Nonnull final String key); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the value of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param value The value of this {@link SearchDocumentKeyValueListPair} - * @return The SearchDocumentKeyValueListPair instance. - */ - Builder2 value(@Nonnull final List value); - - /** - * Set the value of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param value The value of this {@link SearchDocumentKeyValueListPair} - * @return The SearchDocumentKeyValueListPair instance. - */ - default Builder2 value(@Nonnull final String... value) { - return value(Arrays.asList(value)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link SearchDocumentKeyValueListPair} instance. - * - * @return The SearchDocumentKeyValueListPair instance. - */ - SearchDocumentKeyValueListPair build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchFilter.java b/grounding/src/main/resources/openapi/grounding/model/SearchFilter.java deleted file mode 100644 index 03fd1db7c..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/SearchFilter.java +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchConfiguration; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchDocumentKeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** SearchFilter */ -// CHECKSTYLE:OFF -public class SearchFilter -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("collectionIds") - private List collectionIds = new ArrayList<>(); - - @JsonProperty("configuration") - private SearchConfiguration _configuration; - - @JsonProperty("collectionMetadata") - private List collectionMetadata = new ArrayList<>(); - - @JsonProperty("documentMetadata") - private List documentMetadata = new ArrayList<>(); - - @JsonProperty("chunkMetadata") - private List chunkMetadata = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for SearchFilter. */ - private SearchFilter() {} - - /** - * Set the id of this {@link SearchFilter} instance and return the same instance. - * - * @param id Identifier of this SearchFilter - unique per request. - * @return The same instance of this {@link SearchFilter} class - */ - @Nonnull - public SearchFilter id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * Identifier of this SearchFilter - unique per request. - * - * @return id The id of this {@link SearchFilter} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link SearchFilter} instance. - * - * @param id Identifier of this SearchFilter - unique per request. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the collectionIds of this {@link SearchFilter} instance and return the same instance. - * - * @param collectionIds The collectionIds of this {@link SearchFilter} - * @return The same instance of this {@link SearchFilter} class - */ - @Nonnull - public SearchFilter collectionIds(@Nonnull final List collectionIds) { - this.collectionIds = collectionIds; - return this; - } - - /** - * Add one collectionIds instance to this {@link SearchFilter}. - * - * @param collectionIdsItem The collectionIds that should be added - * @return The same instance of type {@link SearchFilter} - */ - @Nonnull - public SearchFilter addCollectionIdsItem(@Nonnull final String collectionIdsItem) { - if (this.collectionIds == null) { - this.collectionIds = new ArrayList<>(); - } - this.collectionIds.add(collectionIdsItem); - return this; - } - - /** - * Get collectionIds - * - * @return collectionIds The collectionIds of this {@link SearchFilter} instance. - */ - @Nonnull - public List getCollectionIds() { - return collectionIds; - } - - /** - * Set the collectionIds of this {@link SearchFilter} instance. - * - * @param collectionIds The collectionIds of this {@link SearchFilter} - */ - public void setCollectionIds(@Nonnull final List collectionIds) { - this.collectionIds = collectionIds; - } - - /** - * Set the _configuration of this {@link SearchFilter} instance and return the same instance. - * - * @param _configuration The _configuration of this {@link SearchFilter} - * @return The same instance of this {@link SearchFilter} class - */ - @Nonnull - public SearchFilter _configuration(@Nonnull final SearchConfiguration _configuration) { - this._configuration = _configuration; - return this; - } - - /** - * Get _configuration - * - * @return _configuration The _configuration of this {@link SearchFilter} instance. - */ - @Nonnull - public SearchConfiguration getConfiguration() { - return _configuration; - } - - /** - * Set the _configuration of this {@link SearchFilter} instance. - * - * @param _configuration The _configuration of this {@link SearchFilter} - */ - public void setConfiguration(@Nonnull final SearchConfiguration _configuration) { - this._configuration = _configuration; - } - - /** - * Set the collectionMetadata of this {@link SearchFilter} instance and return the same instance. - * - * @param collectionMetadata Restrict collections considered during search to those annotated with - * the given metadata. Useful when combined with collections=['*'] - * @return The same instance of this {@link SearchFilter} class - */ - @Nonnull - public SearchFilter collectionMetadata( - @Nullable final List collectionMetadata) { - this.collectionMetadata = collectionMetadata; - return this; - } - - /** - * Add one collectionMetadata instance to this {@link SearchFilter}. - * - * @param collectionMetadataItem The collectionMetadata that should be added - * @return The same instance of type {@link SearchFilter} - */ - @Nonnull - public SearchFilter addCollectionMetadataItem( - @Nonnull final KeyValueListPair collectionMetadataItem) { - if (this.collectionMetadata == null) { - this.collectionMetadata = new ArrayList<>(); - } - this.collectionMetadata.add(collectionMetadataItem); - return this; - } - - /** - * Restrict collections considered during search to those annotated with the given metadata. - * Useful when combined with collections=['*'] - * - * @return collectionMetadata The collectionMetadata of this {@link SearchFilter} instance. - */ - @Nonnull - public List getCollectionMetadata() { - return collectionMetadata; - } - - /** - * Set the collectionMetadata of this {@link SearchFilter} instance. - * - * @param collectionMetadata Restrict collections considered during search to those annotated with - * the given metadata. Useful when combined with collections=['*'] - */ - public void setCollectionMetadata(@Nullable final List collectionMetadata) { - this.collectionMetadata = collectionMetadata; - } - - /** - * Set the documentMetadata of this {@link SearchFilter} instance and return the same instance. - * - * @param documentMetadata Restrict documents considered during search to those annotated with the - * given metadata. - * @return The same instance of this {@link SearchFilter} class - */ - @Nonnull - public SearchFilter documentMetadata( - @Nullable final List documentMetadata) { - this.documentMetadata = documentMetadata; - return this; - } - - /** - * Add one documentMetadata instance to this {@link SearchFilter}. - * - * @param documentMetadataItem The documentMetadata that should be added - * @return The same instance of type {@link SearchFilter} - */ - @Nonnull - public SearchFilter addDocumentMetadataItem( - @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { - if (this.documentMetadata == null) { - this.documentMetadata = new ArrayList<>(); - } - this.documentMetadata.add(documentMetadataItem); - return this; - } - - /** - * Restrict documents considered during search to those annotated with the given metadata. - * - * @return documentMetadata The documentMetadata of this {@link SearchFilter} instance. - */ - @Nonnull - public List getDocumentMetadata() { - return documentMetadata; - } - - /** - * Set the documentMetadata of this {@link SearchFilter} instance. - * - * @param documentMetadata Restrict documents considered during search to those annotated with the - * given metadata. - */ - public void setDocumentMetadata( - @Nullable final List documentMetadata) { - this.documentMetadata = documentMetadata; - } - - /** - * Set the chunkMetadata of this {@link SearchFilter} instance and return the same instance. - * - * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. - * @return The same instance of this {@link SearchFilter} class - */ - @Nonnull - public SearchFilter chunkMetadata(@Nullable final List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - return this; - } - - /** - * Add one chunkMetadata instance to this {@link SearchFilter}. - * - * @param chunkMetadataItem The chunkMetadata that should be added - * @return The same instance of type {@link SearchFilter} - */ - @Nonnull - public SearchFilter addChunkMetadataItem(@Nonnull final KeyValueListPair chunkMetadataItem) { - if (this.chunkMetadata == null) { - this.chunkMetadata = new ArrayList<>(); - } - this.chunkMetadata.add(chunkMetadataItem); - return this; - } - - /** - * Restrict chunks considered during search to those with the given metadata. - * - * @return chunkMetadata The chunkMetadata of this {@link SearchFilter} instance. - */ - @Nonnull - public List getChunkMetadata() { - return chunkMetadata; - } - - /** - * Set the chunkMetadata of this {@link SearchFilter} instance. - * - * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. - */ - public void setChunkMetadata(@Nullable final List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link SearchFilter}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SearchFilter} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("SearchFilter has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link SearchFilter} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final SearchFilter searchFilter = (SearchFilter) o; - return Objects.equals(this.cloudSdkCustomFields, searchFilter.cloudSdkCustomFields) - && Objects.equals(this.id, searchFilter.id) - && Objects.equals(this.collectionIds, searchFilter.collectionIds) - && Objects.equals(this._configuration, searchFilter._configuration) - && Objects.equals(this.collectionMetadata, searchFilter.collectionMetadata) - && Objects.equals(this.documentMetadata, searchFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, searchFilter.chunkMetadata); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - collectionIds, - _configuration, - collectionMetadata, - documentMetadata, - chunkMetadata, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class SearchFilter {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); - sb.append(" collectionMetadata: ").append(toIndentedString(collectionMetadata)).append("\n"); - sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); - sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link SearchFilter} instance - * with all required arguments. - */ - public static Builder builder() { - return (id) -> - (collectionIds) -> - (_configuration) -> - () -> - new SearchFilter() - .id(id) - .collectionIds(collectionIds) - ._configuration(_configuration); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link SearchFilter} instance. - * - * @param id Identifier of this SearchFilter - unique per request. - * @return The SearchFilter builder. - */ - Builder1 id(@Nonnull final String id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the collectionIds of this {@link SearchFilter} instance. - * - * @param collectionIds The collectionIds of this {@link SearchFilter} - * @return The SearchFilter builder. - */ - Builder2 collectionIds(@Nonnull final List collectionIds); - - /** - * Set the collectionIds of this {@link SearchFilter} instance. - * - * @param collectionIds The collectionIds of this {@link SearchFilter} - * @return The SearchFilter builder. - */ - default Builder2 collectionIds(@Nonnull final String... collectionIds) { - return collectionIds(Arrays.asList(collectionIds)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the _configuration of this {@link SearchFilter} instance. - * - * @param _configuration The _configuration of this {@link SearchFilter} - * @return The SearchFilter instance. - */ - Builder3 _configuration(@Nonnull final SearchConfiguration _configuration); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link SearchFilter} instance. - * - * @return The SearchFilter instance. - */ - SearchFilter build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchResults.java b/grounding/src/main/resources/openapi/grounding/model/SearchResults.java deleted file mode 100644 index 06e18ecc6..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/SearchResults.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.ResultsInner; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** SearchResults */ -// CHECKSTYLE:OFF -public class SearchResults -// CHECKSTYLE:ON -{ - @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for SearchResults. */ - private SearchResults() {} - - /** - * Set the results of this {@link SearchResults} instance and return the same instance. - * - * @param results List of returned results. - * @return The same instance of this {@link SearchResults} class - */ - @Nonnull - public SearchResults results(@Nonnull final List results) { - this.results = results; - return this; - } - - /** - * Add one results instance to this {@link SearchResults}. - * - * @param resultsItem The results that should be added - * @return The same instance of type {@link SearchResults} - */ - @Nonnull - public SearchResults addResultsItem(@Nonnull final ResultsInner resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * List of returned results. - * - * @return results The results of this {@link SearchResults} instance. - */ - @Nonnull - public List getResults() { - return results; - } - - /** - * Set the results of this {@link SearchResults} instance. - * - * @param results List of returned results. - */ - public void setResults(@Nonnull final List results) { - this.results = results; - } - - /** - * Get the names of the unrecognizable properties of the {@link SearchResults}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SearchResults} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("SearchResults has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link SearchResults} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final SearchResults searchResults = (SearchResults) o; - return Objects.equals(this.cloudSdkCustomFields, searchResults.cloudSdkCustomFields) - && Objects.equals(this.results, searchResults.results); - } - - @Override - public int hashCode() { - return Objects.hash(results, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class SearchResults {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link SearchResults} instance - * with all required arguments. - */ - public static Builder builder() { - return (results) -> () -> new SearchResults().results(results); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the results of this {@link SearchResults} instance. - * - * @param results List of returned results. - * @return The SearchResults instance. - */ - Builder1 results(@Nonnull final List results); - - /** - * Set the results of this {@link SearchResults} instance. - * - * @param results List of returned results. - * @return The SearchResults instance. - */ - default Builder1 results(@Nonnull final ResultsInner... results) { - return results(Arrays.asList(results)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Finalize the builder for new {@link SearchResults} instance. - * - * @return The SearchResults instance. - */ - SearchResults build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java b/grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java deleted file mode 100644 index eb0a2e5be..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/SearchSelectOptionEnum.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** Gets or Sets SearchSelectOptionEnum */ -public enum SearchSelectOptionEnum { - IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"); - - private final String value; - - SearchSelectOptionEnum(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static SearchSelectOptionEnum fromValue(@Nonnull final String value) { - for (final SearchSelectOptionEnum b : SearchSelectOptionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java deleted file mode 100644 index 44f2b4581..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/TextOnlyBaseChunk.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.KeyValueListPair; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** TextOnlyBaseChunk */ -// CHECKSTYLE:OFF -public class TextOnlyBaseChunk -// CHECKSTYLE:ON -{ - @JsonProperty("content") - private String content; - - @JsonProperty("metadata") - private List metadata = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for TextOnlyBaseChunk. */ - private TextOnlyBaseChunk() {} - - /** - * Set the content of this {@link TextOnlyBaseChunk} instance and return the same instance. - * - * @param content The content of this {@link TextOnlyBaseChunk} - * @return The same instance of this {@link TextOnlyBaseChunk} class - */ - @Nonnull - public TextOnlyBaseChunk content(@Nonnull final String content) { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link TextOnlyBaseChunk} instance. - */ - @Nonnull - public String getContent() { - return content; - } - - /** - * Set the content of this {@link TextOnlyBaseChunk} instance. - * - * @param content The content of this {@link TextOnlyBaseChunk} - */ - public void setContent(@Nonnull final String content) { - this.content = content; - } - - /** - * Set the metadata of this {@link TextOnlyBaseChunk} instance and return the same instance. - * - * @param metadata The metadata of this {@link TextOnlyBaseChunk} - * @return The same instance of this {@link TextOnlyBaseChunk} class - */ - @Nonnull - public TextOnlyBaseChunk metadata(@Nonnull final List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Add one metadata instance to this {@link TextOnlyBaseChunk}. - * - * @param metadataItem The metadata that should be added - * @return The same instance of type {@link TextOnlyBaseChunk} - */ - @Nonnull - public TextOnlyBaseChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { - if (this.metadata == null) { - this.metadata = new ArrayList<>(); - } - this.metadata.add(metadataItem); - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link TextOnlyBaseChunk} instance. - */ - @Nonnull - public List getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link TextOnlyBaseChunk} instance. - * - * @param metadata The metadata of this {@link TextOnlyBaseChunk} - */ - public void setMetadata(@Nonnull final List metadata) { - this.metadata = metadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link TextOnlyBaseChunk}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TextOnlyBaseChunk} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("TextOnlyBaseChunk has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link TextOnlyBaseChunk} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final TextOnlyBaseChunk textOnlyBaseChunk = (TextOnlyBaseChunk) o; - return Objects.equals(this.cloudSdkCustomFields, textOnlyBaseChunk.cloudSdkCustomFields) - && Objects.equals(this.content, textOnlyBaseChunk.content) - && Objects.equals(this.metadata, textOnlyBaseChunk.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(content, metadata, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class TextOnlyBaseChunk {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link TextOnlyBaseChunk} - * instance with all required arguments. - */ - public static Builder builder() { - return (content) -> - (metadata) -> () -> new TextOnlyBaseChunk().content(content).metadata(metadata); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the content of this {@link TextOnlyBaseChunk} instance. - * - * @param content The content of this {@link TextOnlyBaseChunk} - * @return The TextOnlyBaseChunk builder. - */ - Builder1 content(@Nonnull final String content); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the metadata of this {@link TextOnlyBaseChunk} instance. - * - * @param metadata The metadata of this {@link TextOnlyBaseChunk} - * @return The TextOnlyBaseChunk instance. - */ - Builder2 metadata(@Nonnull final List metadata); - - /** - * Set the metadata of this {@link TextOnlyBaseChunk} instance. - * - * @param metadata The metadata of this {@link TextOnlyBaseChunk} - * @return The TextOnlyBaseChunk instance. - */ - default Builder2 metadata(@Nonnull final KeyValueListPair... metadata) { - return metadata(Arrays.asList(metadata)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link TextOnlyBaseChunk} instance. - * - * @return The TextOnlyBaseChunk instance. - */ - TextOnlyBaseChunk build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java b/grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java deleted file mode 100644 index 612fdde50..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/TextSearchRequest.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sap.cloud.sdk.datamodel.openapi.grounding.model.SearchFilter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** TextSearchRequest */ -// CHECKSTYLE:OFF -public class TextSearchRequest -// CHECKSTYLE:ON -{ - @JsonProperty("query") - private String query; - - @JsonProperty("filters") - private List filters = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for TextSearchRequest. */ - private TextSearchRequest() {} - - /** - * Set the query of this {@link TextSearchRequest} instance and return the same instance. - * - * @param query Query string - * @return The same instance of this {@link TextSearchRequest} class - */ - @Nonnull - public TextSearchRequest query(@Nonnull final String query) { - this.query = query; - return this; - } - - /** - * Query string - * - * @return query The query of this {@link TextSearchRequest} instance. - */ - @Nonnull - public String getQuery() { - return query; - } - - /** - * Set the query of this {@link TextSearchRequest} instance. - * - * @param query Query string - */ - public void setQuery(@Nonnull final String query) { - this.query = query; - } - - /** - * Set the filters of this {@link TextSearchRequest} instance and return the same instance. - * - * @param filters The filters of this {@link TextSearchRequest} - * @return The same instance of this {@link TextSearchRequest} class - */ - @Nonnull - public TextSearchRequest filters(@Nonnull final List filters) { - this.filters = filters; - return this; - } - - /** - * Add one filters instance to this {@link TextSearchRequest}. - * - * @param filtersItem The filters that should be added - * @return The same instance of type {@link TextSearchRequest} - */ - @Nonnull - public TextSearchRequest addFiltersItem(@Nonnull final SearchFilter filtersItem) { - if (this.filters == null) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - - /** - * Get filters - * - * @return filters The filters of this {@link TextSearchRequest} instance. - */ - @Nonnull - public List getFilters() { - return filters; - } - - /** - * Set the filters of this {@link TextSearchRequest} instance. - * - * @param filters The filters of this {@link TextSearchRequest} - */ - public void setFilters(@Nonnull final List filters) { - this.filters = filters; - } - - /** - * Get the names of the unrecognizable properties of the {@link TextSearchRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TextSearchRequest} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("TextSearchRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link TextSearchRequest} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final TextSearchRequest textSearchRequest = (TextSearchRequest) o; - return Objects.equals(this.cloudSdkCustomFields, textSearchRequest.cloudSdkCustomFields) - && Objects.equals(this.query, textSearchRequest.query) - && Objects.equals(this.filters, textSearchRequest.filters); - } - - @Override - public int hashCode() { - return Objects.hash(query, filters, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class TextSearchRequest {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link TextSearchRequest} - * instance with all required arguments. - */ - public static Builder builder() { - return (query) -> (filters) -> () -> new TextSearchRequest().query(query).filters(filters); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the query of this {@link TextSearchRequest} instance. - * - * @param query Query string - * @return The TextSearchRequest builder. - */ - Builder1 query(@Nonnull final String query); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the filters of this {@link TextSearchRequest} instance. - * - * @param filters The filters of this {@link TextSearchRequest} - * @return The TextSearchRequest instance. - */ - Builder2 filters(@Nonnull final List filters); - - /** - * Set the filters of this {@link TextSearchRequest} instance. - * - * @param filters The filters of this {@link TextSearchRequest} - * @return The TextSearchRequest instance. - */ - default Builder2 filters(@Nonnull final SearchFilter... filters) { - return filters(Arrays.asList(filters)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Finalize the builder for new {@link TextSearchRequest} instance. - * - * @return The TextSearchRequest instance. - */ - TextSearchRequest build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java b/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java deleted file mode 100644 index cee3744b5..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.net.URI; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** VectorV1VectorEndpointsGetCollectionCreationStatus200Response */ -// CHECKSTYLE:OFF -public class VectorV1VectorEndpointsGetCollectionCreationStatus200Response -// CHECKSTYLE:ON -{ - @JsonProperty("collectionURL") - private String collectionURL; - - @JsonProperty("status") - private String status; - - @JsonProperty("Location") - private URI location; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for VectorV1VectorEndpointsGetCollectionCreationStatus200Response. */ - private VectorV1VectorEndpointsGetCollectionCreationStatus200Response() {} - - /** - * Set the collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance and return the same - * instance. - * - * @param collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * @return The same instance of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} class - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionCreationStatus200Response collectionURL( - @Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - return this; - } - - /** - * Get collectionURL - * - * @return collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - */ - @Nonnull - public String getCollectionURL() { - return collectionURL; - } - - /** - * Set the collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - * - * @param collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - */ - public void setCollectionURL(@Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - } - - /** - * Set the status of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * instance and return the same instance. - * - * @param status The status of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * @return The same instance of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} class - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionCreationStatus200Response status( - @Nonnull final String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status The status of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - */ - @Nonnull - public String getStatus() { - return status; - } - - /** - * Set the status of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * instance. - * - * @param status The status of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - */ - public void setStatus(@Nonnull final String status) { - this.status = status; - } - - /** - * Set the location of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * instance and return the same instance. - * - * @param location The location of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * @return The same instance of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} class - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionCreationStatus200Response location( - @Nonnull final URI location) { - this.location = location; - return this; - } - - /** - * Get location - * - * @return location The location of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - */ - @Nonnull - public URI getLocation() { - return location; - } - - /** - * Set the location of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * instance. - * - * @param location The location of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - */ - public void setLocation(@Nonnull final URI location) { - this.location = location; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "VectorV1VectorEndpointsGetCollectionCreationStatus200Response has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final VectorV1VectorEndpointsGetCollectionCreationStatus200Response - vectorV1VectorEndpointsGetCollectionCreationStatus200Response = - (VectorV1VectorEndpointsGetCollectionCreationStatus200Response) o; - return Objects.equals( - this.cloudSdkCustomFields, - vectorV1VectorEndpointsGetCollectionCreationStatus200Response.cloudSdkCustomFields) - && Objects.equals( - this.collectionURL, - vectorV1VectorEndpointsGetCollectionCreationStatus200Response.collectionURL) - && Objects.equals( - this.status, vectorV1VectorEndpointsGetCollectionCreationStatus200Response.status) - && Objects.equals( - this.location, vectorV1VectorEndpointsGetCollectionCreationStatus200Response.location); - } - - @Override - public int hashCode() { - return Objects.hash(collectionURL, status, location, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class VectorV1VectorEndpointsGetCollectionCreationStatus200Response {\n"); - sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance with all required - * arguments. - */ - public static Builder builder() { - return (collectionURL) -> - (status) -> - (location) -> - () -> - new VectorV1VectorEndpointsGetCollectionCreationStatus200Response() - .collectionURL(collectionURL) - .status(status) - .location(location); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - * - * @param collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response builder. - */ - Builder1 collectionURL(@Nonnull final String collectionURL); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the status of this {@link VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * instance. - * - * @param status The status of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response builder. - */ - Builder2 status(@Nonnull final String status); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the location of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - * - * @param location The location of this {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} - * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response instance. - */ - Builder3 location(@Nonnull final URI location); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link - * VectorV1VectorEndpointsGetCollectionCreationStatus200Response} instance. - * - * @return The VectorV1VectorEndpointsGetCollectionCreationStatus200Response instance. - */ - VectorV1VectorEndpointsGetCollectionCreationStatus200Response build(); - } -} diff --git a/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java b/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java deleted file mode 100644 index 53d028ee2..000000000 --- a/grounding/src/main/resources/openapi/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.net.URI; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** VectorV1VectorEndpointsGetCollectionDeletionStatus200Response */ -// CHECKSTYLE:OFF -public class VectorV1VectorEndpointsGetCollectionDeletionStatus200Response -// CHECKSTYLE:ON -{ - @JsonProperty("collectionURL") - private String collectionURL; - - @JsonProperty("status") - private String status; - - @JsonProperty("Location") - private URI location; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for VectorV1VectorEndpointsGetCollectionDeletionStatus200Response. */ - private VectorV1VectorEndpointsGetCollectionDeletionStatus200Response() {} - - /** - * Set the collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance and return the same - * instance. - * - * @param collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * @return The same instance of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} class - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response collectionURL( - @Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - return this; - } - - /** - * Get collectionURL - * - * @return collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - */ - @Nonnull - public String getCollectionURL() { - return collectionURL; - } - - /** - * Set the collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - * - * @param collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - */ - public void setCollectionURL(@Nonnull final String collectionURL) { - this.collectionURL = collectionURL; - } - - /** - * Set the status of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * instance and return the same instance. - * - * @param status The status of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * @return The same instance of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} class - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response status( - @Nonnull final String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status The status of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - */ - @Nonnull - public String getStatus() { - return status; - } - - /** - * Set the status of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * instance. - * - * @param status The status of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - */ - public void setStatus(@Nonnull final String status) { - this.status = status; - } - - /** - * Set the location of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * instance and return the same instance. - * - * @param location The location of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * @return The same instance of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} class - */ - @Nonnull - public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response location( - @Nonnull final URI location) { - this.location = location; - return this; - } - - /** - * Get location - * - * @return location The location of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - */ - @Nonnull - public URI getLocation() { - return location; - } - - /** - * Set the location of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * instance. - * - * @param location The location of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - */ - public void setLocation(@Nonnull final URI location) { - this.location = location; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "VectorV1VectorEndpointsGetCollectionDeletionStatus200Response has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final VectorV1VectorEndpointsGetCollectionDeletionStatus200Response - vectorV1VectorEndpointsGetCollectionDeletionStatus200Response = - (VectorV1VectorEndpointsGetCollectionDeletionStatus200Response) o; - return Objects.equals( - this.cloudSdkCustomFields, - vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.cloudSdkCustomFields) - && Objects.equals( - this.collectionURL, - vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.collectionURL) - && Objects.equals( - this.status, vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.status) - && Objects.equals( - this.location, vectorV1VectorEndpointsGetCollectionDeletionStatus200Response.location); - } - - @Override - public int hashCode() { - return Objects.hash(collectionURL, status, location, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class VectorV1VectorEndpointsGetCollectionDeletionStatus200Response {\n"); - sb.append(" collectionURL: ").append(toIndentedString(collectionURL)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance with all required - * arguments. - */ - public static Builder builder() { - return (collectionURL) -> - (status) -> - (location) -> - () -> - new VectorV1VectorEndpointsGetCollectionDeletionStatus200Response() - .collectionURL(collectionURL) - .status(status) - .location(location); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - * - * @param collectionURL The collectionURL of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response builder. - */ - Builder1 collectionURL(@Nonnull final String collectionURL); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the status of this {@link VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * instance. - * - * @param status The status of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response builder. - */ - Builder2 status(@Nonnull final String status); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the location of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - * - * @param location The location of this {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} - * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response instance. - */ - Builder3 location(@Nonnull final URI location); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Finalize the builder for new {@link - * VectorV1VectorEndpointsGetCollectionDeletionStatus200Response} instance. - * - * @return The VectorV1VectorEndpointsGetCollectionDeletionStatus200Response instance. - */ - VectorV1VectorEndpointsGetCollectionDeletionStatus200Response build(); - } -} diff --git a/grounding/src/main/resources/openapi/sample/api/OrdersApi.java b/grounding/src/main/resources/openapi/sample/api/OrdersApi.java deleted file mode 100644 index fe69cd0bc..000000000 --- a/grounding/src/main/resources/openapi/sample/api/OrdersApi.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -package openapi.sample.api; - -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.sample.model.Order; -import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; -import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import java.util.List; -import javax.annotation.Nonnull; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; - -/** - * SodaStore API in version 1.0.0. - * - *

API for managing soda products and orders in SodaStore. - */ -public class OrdersApi extends AbstractOpenApiService { - /** - * Instantiates this API class to invoke operations on the SodaStore API. - * - * @param httpDestination The destination that API should be used with - */ - public OrdersApi(@Nonnull final Destination httpDestination) { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link - * ApiClient}. - * - * @param apiClient ApiClient to invoke the API on - */ - @Beta - public OrdersApi(@Nonnull final ApiClient apiClient) { - super(apiClient); - } - - /** - * Create a new order - * - *

- * - *

201 - The created order - * - * @param order The order details - * @return Order - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public Order ordersPost(@Nonnull final Order order) throws OpenApiRequestException { - final Object localVarPostBody = order; - - // verify the required parameter 'order' is set - if (order == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'order' when calling ordersPost"); - } - - final String localVarPath = UriComponentsBuilder.fromPath("/orders").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.POST, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } -} diff --git a/grounding/src/main/resources/openapi/sample/api/SodasApi.java b/grounding/src/main/resources/openapi/sample/api/SodasApi.java deleted file mode 100644 index 7c573f934..000000000 --- a/grounding/src/main/resources/openapi/sample/api/SodasApi.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -package openapi.sample.api; - -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.sample.model.Soda; -import com.sap.cloud.sdk.datamodel.openapi.sample.model.SodaWithId; -import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; -import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.util.UriComponentsBuilder; - -/** - * SodaStore API in version 1.0.0. - * - *

API for managing soda products and orders in SodaStore. - */ -public class SodasApi extends AbstractOpenApiService { - /** - * Instantiates this API class to invoke operations on the SodaStore API. - * - * @param httpDestination The destination that API should be used with - */ - public SodasApi(@Nonnull final Destination httpDestination) { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link - * ApiClient}. - * - * @param apiClient ApiClient to invoke the API on - */ - @Beta - public SodasApi(@Nonnull final ApiClient apiClient) { - super(apiClient); - } - - /** - * Get all soda products - * - *

- * - *

200 - A list of soda products - * - * @return List<SodaWithId> - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public List sodasGet() throws OpenApiRequestException { - final Object localVarPostBody = null; - - final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; - - final ParameterizedTypeReference> localVarReturnType = - new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get a specific soda product by ID - * - *

- * - *

200 - The soda product - * - *

404 - Soda product not found - * - * @param id ID of the soda product to retrieve - * @return SodaWithId - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public SodaWithId sodasIdGet(@Nonnull final Long id) throws OpenApiRequestException { - final Object localVarPostBody = null; - - // verify the required parameter 'id' is set - if (id == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'id' when calling sodasIdGet"); - } - - // create path and map variables - final Map localVarPathParams = new HashMap(); - localVarPathParams.put("id", id); - final String localVarPath = - UriComponentsBuilder.fromPath("/sodas/{id}") - .buildAndExpand(localVarPathParams) - .toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.GET, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Update a specific soda product by ID - * - *

- * - *

200 - The updated soda product - * - *

204 - Nothing has changed - * - *

404 - Soda product not found - * - * @param sodaWithId The updated soda product - * @return Soda - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nullable - public Soda sodasPut(@Nonnull final SodaWithId sodaWithId) throws OpenApiRequestException { - final Object localVarPostBody = sodaWithId; - - // verify the required parameter 'sodaWithId' is set - if (sodaWithId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'sodaWithId' when calling sodasPut"); - } - - final String localVarPath = UriComponentsBuilder.fromPath("/sodas").build().toUriString(); - - final MultiValueMap localVarQueryParams = - new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarFormParams = - new LinkedMultiValueMap(); - - final String[] localVarAccepts = {"application/json"}; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - final String[] localVarAuthNames = new String[] {"apiKeyAuth"}; - - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - HttpMethod.PUT, - localVarQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/AllOf.java b/grounding/src/main/resources/openapi/sample/model/AllOf.java deleted file mode 100644 index a14a9b6d4..000000000 --- a/grounding/src/main/resources/openapi/sample/model/AllOf.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AllOf */ -// CHECKSTYLE:OFF -public class AllOf -// CHECKSTYLE:ON -{ - @JsonProperty("sodaType") - private String sodaType; - - @JsonProperty("caffeine") - private Boolean caffeine; - - @JsonProperty("color") - private String color; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AllOf. */ - protected AllOf() {} - - /** - * Set the sodaType of this {@link AllOf} instance and return the same instance. - * - * @param sodaType The sodaType of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf sodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link AllOf} instance. - */ - @Nonnull - public String getSodaType() { - return sodaType; - } - - /** - * Set the sodaType of this {@link AllOf} instance. - * - * @param sodaType The sodaType of this {@link AllOf} - */ - public void setSodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - } - - /** - * Set the caffeine of this {@link AllOf} instance and return the same instance. - * - * @param caffeine The caffeine of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf caffeine(@Nullable final Boolean caffeine) { - this.caffeine = caffeine; - return this; - } - - /** - * Get caffeine - * - * @return caffeine The caffeine of this {@link AllOf} instance. - */ - @Nonnull - public Boolean isCaffeine() { - return caffeine; - } - - /** - * Set the caffeine of this {@link AllOf} instance. - * - * @param caffeine The caffeine of this {@link AllOf} - */ - public void setCaffeine(@Nullable final Boolean caffeine) { - this.caffeine = caffeine; - } - - /** - * Set the color of this {@link AllOf} instance and return the same instance. - * - * @param color The color of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf color(@Nullable final String color) { - this.color = color; - return this; - } - - /** - * Get color - * - * @return color The color of this {@link AllOf} instance. - */ - @Nonnull - public String getColor() { - return color; - } - - /** - * Set the color of this {@link AllOf} instance. - * - * @param color The color of this {@link AllOf} - */ - public void setColor(@Nullable final String color) { - this.color = color; - } - - /** - * Get the names of the unrecognizable properties of the {@link AllOf}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AllOf} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("AllOf has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AllOf allOf = (AllOf) o; - return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) - && Objects.equals(this.sodaType, allOf.sodaType) - && Objects.equals(this.caffeine, allOf.caffeine) - && Objects.equals(this.color, allOf.color); - } - - @Override - public int hashCode() { - return Objects.hash(sodaType, caffeine, color, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AllOf {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link AllOf} instance. No arguments are required. */ - public static AllOf create() { - return new AllOf(); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/AnyOf.java b/grounding/src/main/resources/openapi/sample/model/AnyOf.java deleted file mode 100644 index c2bae78c2..000000000 --- a/grounding/src/main/resources/openapi/sample/model/AnyOf.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AnyOf */ -// CHECKSTYLE:OFF -public class AnyOf -// CHECKSTYLE:ON -{ - @JsonProperty("sodaType") - private String sodaType; - - @JsonProperty("caffeine") - private Boolean caffeine; - - @JsonProperty("color") - private String color; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AnyOf. */ - protected AnyOf() {} - - /** - * Set the sodaType of this {@link AnyOf} instance and return the same instance. - * - * @param sodaType The sodaType of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf sodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link AnyOf} instance. - */ - @Nonnull - public String getSodaType() { - return sodaType; - } - - /** - * Set the sodaType of this {@link AnyOf} instance. - * - * @param sodaType The sodaType of this {@link AnyOf} - */ - public void setSodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - } - - /** - * Set the caffeine of this {@link AnyOf} instance and return the same instance. - * - * @param caffeine The caffeine of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf caffeine(@Nullable final Boolean caffeine) { - this.caffeine = caffeine; - return this; - } - - /** - * Get caffeine - * - * @return caffeine The caffeine of this {@link AnyOf} instance. - */ - @Nonnull - public Boolean isCaffeine() { - return caffeine; - } - - /** - * Set the caffeine of this {@link AnyOf} instance. - * - * @param caffeine The caffeine of this {@link AnyOf} - */ - public void setCaffeine(@Nullable final Boolean caffeine) { - this.caffeine = caffeine; - } - - /** - * Set the color of this {@link AnyOf} instance and return the same instance. - * - * @param color The color of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf color(@Nullable final String color) { - this.color = color; - return this; - } - - /** - * Get color - * - * @return color The color of this {@link AnyOf} instance. - */ - @Nonnull - public String getColor() { - return color; - } - - /** - * Set the color of this {@link AnyOf} instance. - * - * @param color The color of this {@link AnyOf} - */ - public void setColor(@Nullable final String color) { - this.color = color; - } - - /** - * Get the names of the unrecognizable properties of the {@link AnyOf}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AnyOf} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("AnyOf has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AnyOf anyOf = (AnyOf) o; - return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) - && Objects.equals(this.sodaType, anyOf.sodaType) - && Objects.equals(this.caffeine, anyOf.caffeine) - && Objects.equals(this.color, anyOf.color); - } - - @Override - public int hashCode() { - return Objects.hash(sodaType, caffeine, color, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AnyOf {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link AnyOf} instance. No arguments are required. */ - public static AnyOf create() { - return new AnyOf(); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/Cola.java b/grounding/src/main/resources/openapi/sample/model/Cola.java deleted file mode 100644 index c7d384cc1..000000000 --- a/grounding/src/main/resources/openapi/sample/model/Cola.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Cola */ -// CHECKSTYLE:OFF -public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping -// CHECKSTYLE:ON -{ - @JsonProperty("sodaType") - private String sodaType; - - @JsonProperty("caffeine") - private Boolean caffeine; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Cola. */ - protected Cola() {} - - /** - * Set the sodaType of this {@link Cola} instance and return the same instance. - * - * @param sodaType The sodaType of this {@link Cola} - * @return The same instance of this {@link Cola} class - */ - @Nonnull - public Cola sodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link Cola} instance. - */ - @Nonnull - public String getSodaType() { - return sodaType; - } - - /** - * Set the sodaType of this {@link Cola} instance. - * - * @param sodaType The sodaType of this {@link Cola} - */ - public void setSodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - } - - /** - * Set the caffeine of this {@link Cola} instance and return the same instance. - * - * @param caffeine The caffeine of this {@link Cola} - * @return The same instance of this {@link Cola} class - */ - @Nonnull - public Cola caffeine(@Nullable final Boolean caffeine) { - this.caffeine = caffeine; - return this; - } - - /** - * Get caffeine - * - * @return caffeine The caffeine of this {@link Cola} instance. - */ - @Nonnull - public Boolean isCaffeine() { - return caffeine; - } - - /** - * Set the caffeine of this {@link Cola} instance. - * - * @param caffeine The caffeine of this {@link Cola} - */ - public void setCaffeine(@Nullable final Boolean caffeine) { - this.caffeine = caffeine; - } - - /** - * Get the names of the unrecognizable properties of the {@link Cola}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Cola} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Cola has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Cola cola = (Cola) o; - return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) - && Objects.equals(this.sodaType, cola.sodaType) - && Objects.equals(this.caffeine, cola.caffeine); - } - - @Override - public int hashCode() { - return Objects.hash(sodaType, caffeine, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Cola {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link Cola} instance. No arguments are required. */ - public static Cola create() { - return new Cola(); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/Fanta.java b/grounding/src/main/resources/openapi/sample/model/Fanta.java deleted file mode 100644 index bebe50c21..000000000 --- a/grounding/src/main/resources/openapi/sample/model/Fanta.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Fanta */ -// CHECKSTYLE:OFF -public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping -// CHECKSTYLE:ON -{ - @JsonProperty("sodaType") - private String sodaType; - - @JsonProperty("color") - private String color; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Fanta. */ - protected Fanta() {} - - /** - * Set the sodaType of this {@link Fanta} instance and return the same instance. - * - * @param sodaType The sodaType of this {@link Fanta} - * @return The same instance of this {@link Fanta} class - */ - @Nonnull - public Fanta sodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link Fanta} instance. - */ - @Nonnull - public String getSodaType() { - return sodaType; - } - - /** - * Set the sodaType of this {@link Fanta} instance. - * - * @param sodaType The sodaType of this {@link Fanta} - */ - public void setSodaType(@Nullable final String sodaType) { - this.sodaType = sodaType; - } - - /** - * Set the color of this {@link Fanta} instance and return the same instance. - * - * @param color The color of this {@link Fanta} - * @return The same instance of this {@link Fanta} class - */ - @Nonnull - public Fanta color(@Nullable final String color) { - this.color = color; - return this; - } - - /** - * Get color - * - * @return color The color of this {@link Fanta} instance. - */ - @Nonnull - public String getColor() { - return color; - } - - /** - * Set the color of this {@link Fanta} instance. - * - * @param color The color of this {@link Fanta} - */ - public void setColor(@Nullable final String color) { - this.color = color; - } - - /** - * Get the names of the unrecognizable properties of the {@link Fanta}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Fanta} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Fanta has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Fanta fanta = (Fanta) o; - return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) - && Objects.equals(this.sodaType, fanta.sodaType) - && Objects.equals(this.color, fanta.color); - } - - @Override - public int hashCode() { - return Objects.hash(sodaType, color, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Fanta {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link Fanta} instance. No arguments are required. */ - public static Fanta create() { - return new Fanta(); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/OneOf.java b/grounding/src/main/resources/openapi/sample/model/OneOf.java deleted file mode 100644 index fd4eccbd8..000000000 --- a/grounding/src/main/resources/openapi/sample/model/OneOf.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** OneOf */ -@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Cola.class), - @JsonSubTypes.Type(value = Fanta.class), -}) -public interface OneOf {} diff --git a/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java b/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java deleted file mode 100644 index 701624fd7..000000000 --- a/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** OneOfWithDiscriminator */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Cola.class, name = "Cola"), - @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"), -}) -public interface OneOfWithDiscriminator { - String getSodaType(); -} diff --git a/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java b/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java deleted file mode 100644 index 5e904ebe2..000000000 --- a/grounding/src/main/resources/openapi/sample/model/OneOfWithDiscriminatorAndMapping.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** OneOfWithDiscriminatorAndMapping */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Cola.class, name = "cool_cola"), - @JsonSubTypes.Type(value = Fanta.class, name = "fancy_fanta"), - @JsonSubTypes.Type(value = Cola.class, name = "Cola"), - @JsonSubTypes.Type(value = Fanta.class, name = "Fanta"), -}) -public interface OneOfWithDiscriminatorAndMapping { - String getSodaType(); -} diff --git a/grounding/src/main/resources/openapi/sample/model/Order.java b/grounding/src/main/resources/openapi/sample/model/Order.java deleted file mode 100644 index 42ec1c741..000000000 --- a/grounding/src/main/resources/openapi/sample/model/Order.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Order */ -// CHECKSTYLE:OFF -public class Order -// CHECKSTYLE:ON -{ - @JsonProperty("productId") - private Long productId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("totalPrice") - private Float totalPrice; - - @JsonProperty("typelessProperty") - private Object typelessProperty = null; - - @JsonProperty("nullableProperty") - private String nullableProperty; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Order. */ - protected Order() {} - - /** - * Set the productId of this {@link Order} instance and return the same instance. - * - * @param productId The productId of this {@link Order} - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order productId(@Nonnull final Long productId) { - this.productId = productId; - return this; - } - - /** - * Get productId - * - * @return productId The productId of this {@link Order} instance. - */ - @Nonnull - public Long getProductId() { - return productId; - } - - /** - * Set the productId of this {@link Order} instance. - * - * @param productId The productId of this {@link Order} - */ - public void setProductId(@Nonnull final Long productId) { - this.productId = productId; - } - - /** - * Set the quantity of this {@link Order} instance and return the same instance. - * - * @param quantity The quantity of this {@link Order} - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order quantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link Order} instance. - */ - @Nonnull - public Integer getQuantity() { - return quantity; - } - - /** - * Set the quantity of this {@link Order} instance. - * - * @param quantity The quantity of this {@link Order} - */ - public void setQuantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - } - - /** - * Set the totalPrice of this {@link Order} instance and return the same instance. - * - * @param totalPrice The totalPrice of this {@link Order} - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order totalPrice(@Nullable final Float totalPrice) { - this.totalPrice = totalPrice; - return this; - } - - /** - * Get totalPrice - * - * @return totalPrice The totalPrice of this {@link Order} instance. - */ - @Nonnull - public Float getTotalPrice() { - return totalPrice; - } - - /** - * Set the totalPrice of this {@link Order} instance. - * - * @param totalPrice The totalPrice of this {@link Order} - */ - public void setTotalPrice(@Nullable final Float totalPrice) { - this.totalPrice = totalPrice; - } - - /** - * Set the typelessProperty of this {@link Order} instance and return the same instance. - * - * @param typelessProperty Some typeless property, interpreted by the generator as nullable by - * default (because typeless) - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order typelessProperty(@Nullable final Object typelessProperty) { - this.typelessProperty = typelessProperty; - return this; - } - - /** - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - * - * @return typelessProperty The typelessProperty of this {@link Order} instance. - */ - @Nullable - public Object getTypelessProperty() { - return typelessProperty; - } - - /** - * Set the typelessProperty of this {@link Order} instance. - * - * @param typelessProperty Some typeless property, interpreted by the generator as nullable by - * default (because typeless) - */ - public void setTypelessProperty(@Nullable final Object typelessProperty) { - this.typelessProperty = typelessProperty; - } - - /** - * Set the nullableProperty of this {@link Order} instance and return the same instance. - * - * @param nullableProperty Some typed property that is deliberately made nullable - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order nullableProperty(@Nullable final String nullableProperty) { - this.nullableProperty = nullableProperty; - return this; - } - - /** - * Some typed property that is deliberately made nullable - * - * @return nullableProperty The nullableProperty of this {@link Order} instance. - */ - @Nullable - public String getNullableProperty() { - return nullableProperty; - } - - /** - * Set the nullableProperty of this {@link Order} instance. - * - * @param nullableProperty Some typed property that is deliberately made nullable - */ - public void setNullableProperty(@Nullable final String nullableProperty) { - this.nullableProperty = nullableProperty; - } - - /** - * Get the names of the unrecognizable properties of the {@link Order}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Order} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Order has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Order} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Order order = (Order) o; - return Objects.equals(this.cloudSdkCustomFields, order.cloudSdkCustomFields) - && Objects.equals(this.productId, order.productId) - && Objects.equals(this.quantity, order.quantity) - && Objects.equals(this.totalPrice, order.totalPrice) - && Objects.equals(this.typelessProperty, order.typelessProperty) - && Objects.equals(this.nullableProperty, order.nullableProperty); - } - - @Override - public int hashCode() { - return Objects.hash( - productId, quantity, totalPrice, typelessProperty, nullableProperty, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); - sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); - sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link Order} instance with - * all required arguments. - */ - public static Builder create() { - return (productId) -> (quantity) -> new Order().productId(productId).quantity(quantity); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the productId of this {@link Order} instance. - * - * @param productId The productId of this {@link Order} - * @return The Order builder. - */ - Builder1 productId(@Nonnull final Long productId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the quantity of this {@link Order} instance. - * - * @param quantity The quantity of this {@link Order} - * @return The Order instance. - */ - Order quantity(@Nonnull final Integer quantity); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java b/grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java deleted file mode 100644 index 6fad76aa7..000000000 --- a/grounding/src/main/resources/openapi/sample/model/OrderWithTimestamp.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OrderWithTimestamp */ -// CHECKSTYLE:OFF -public class OrderWithTimestamp -// CHECKSTYLE:ON -{ - @JsonProperty("productId") - private Long productId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("totalPrice") - private Float totalPrice; - - @JsonProperty("typelessProperty") - private Object typelessProperty; - - @JsonProperty("nullableProperty") - private String nullableProperty; - - @JsonProperty("timestamp") - private OffsetDateTime timestamp; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OrderWithTimestamp. */ - protected OrderWithTimestamp() {} - - /** - * Set the productId of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param productId The productId of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp productId(@Nonnull final Long productId) { - this.productId = productId; - return this; - } - - /** - * Get productId - * - * @return productId The productId of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public Long getProductId() { - return productId; - } - - /** - * Set the productId of this {@link OrderWithTimestamp} instance. - * - * @param productId The productId of this {@link OrderWithTimestamp} - */ - public void setProductId(@Nonnull final Long productId) { - this.productId = productId; - } - - /** - * Set the quantity of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param quantity The quantity of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp quantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public Integer getQuantity() { - return quantity; - } - - /** - * Set the quantity of this {@link OrderWithTimestamp} instance. - * - * @param quantity The quantity of this {@link OrderWithTimestamp} - */ - public void setQuantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - } - - /** - * Set the totalPrice of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param totalPrice The totalPrice of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp totalPrice(@Nullable final Float totalPrice) { - this.totalPrice = totalPrice; - return this; - } - - /** - * Get totalPrice - * - * @return totalPrice The totalPrice of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public Float getTotalPrice() { - return totalPrice; - } - - /** - * Set the totalPrice of this {@link OrderWithTimestamp} instance. - * - * @param totalPrice The totalPrice of this {@link OrderWithTimestamp} - */ - public void setTotalPrice(@Nullable final Float totalPrice) { - this.totalPrice = totalPrice; - } - - /** - * Set the typelessProperty of this {@link OrderWithTimestamp} instance and return the same - * instance. - * - * @param typelessProperty Some typeless property, interpreted by the generator as nullable by - * default (because typeless) - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp typelessProperty(@Nullable final Object typelessProperty) { - this.typelessProperty = typelessProperty; - return this; - } - - /** - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - * - * @return typelessProperty The typelessProperty of this {@link OrderWithTimestamp} instance. - */ - @Nullable - public Object getTypelessProperty() { - return typelessProperty; - } - - /** - * Set the typelessProperty of this {@link OrderWithTimestamp} instance. - * - * @param typelessProperty Some typeless property, interpreted by the generator as nullable by - * default (because typeless) - */ - public void setTypelessProperty(@Nullable final Object typelessProperty) { - this.typelessProperty = typelessProperty; - } - - /** - * Set the nullableProperty of this {@link OrderWithTimestamp} instance and return the same - * instance. - * - * @param nullableProperty Some typed property that is deliberately made nullable - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp nullableProperty(@Nullable final String nullableProperty) { - this.nullableProperty = nullableProperty; - return this; - } - - /** - * Some typed property that is deliberately made nullable - * - * @return nullableProperty The nullableProperty of this {@link OrderWithTimestamp} instance. - */ - @Nullable - public String getNullableProperty() { - return nullableProperty; - } - - /** - * Set the nullableProperty of this {@link OrderWithTimestamp} instance. - * - * @param nullableProperty Some typed property that is deliberately made nullable - */ - public void setNullableProperty(@Nullable final String nullableProperty) { - this.nullableProperty = nullableProperty; - } - - /** - * Set the timestamp of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param timestamp The timestamp of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp timestamp(@Nullable final OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get timestamp - * - * @return timestamp The timestamp of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public OffsetDateTime getTimestamp() { - return timestamp; - } - - /** - * Set the timestamp of this {@link OrderWithTimestamp} instance. - * - * @param timestamp The timestamp of this {@link OrderWithTimestamp} - */ - public void setTimestamp(@Nullable final OffsetDateTime timestamp) { - this.timestamp = timestamp; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrderWithTimestamp}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrderWithTimestamp} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OrderWithTimestamp has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link OrderWithTimestamp} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OrderWithTimestamp orderWithTimestamp = (OrderWithTimestamp) o; - return Objects.equals(this.cloudSdkCustomFields, orderWithTimestamp.cloudSdkCustomFields) - && Objects.equals(this.productId, orderWithTimestamp.productId) - && Objects.equals(this.quantity, orderWithTimestamp.quantity) - && Objects.equals(this.totalPrice, orderWithTimestamp.totalPrice) - && Objects.equals(this.typelessProperty, orderWithTimestamp.typelessProperty) - && Objects.equals(this.nullableProperty, orderWithTimestamp.nullableProperty) - && Objects.equals(this.timestamp, orderWithTimestamp.timestamp); - } - - @Override - public int hashCode() { - return Objects.hash( - productId, - quantity, - totalPrice, - typelessProperty, - nullableProperty, - timestamp, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrderWithTimestamp {\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); - sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); - sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); - sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OrderWithTimestamp} - * instance with all required arguments. - */ - public static Builder create() { - return (productId) -> - (quantity) -> new OrderWithTimestamp().productId(productId).quantity(quantity); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the productId of this {@link OrderWithTimestamp} instance. - * - * @param productId The productId of this {@link OrderWithTimestamp} - * @return The OrderWithTimestamp builder. - */ - Builder1 productId(@Nonnull final Long productId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the quantity of this {@link OrderWithTimestamp} instance. - * - * @param quantity The quantity of this {@link OrderWithTimestamp} - * @return The OrderWithTimestamp instance. - */ - OrderWithTimestamp quantity(@Nonnull final Integer quantity); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/Soda.java b/grounding/src/main/resources/openapi/sample/model/Soda.java deleted file mode 100644 index 31b110498..000000000 --- a/grounding/src/main/resources/openapi/sample/model/Soda.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Soda */ -// CHECKSTYLE:OFF -public class Soda -// CHECKSTYLE:ON -{ - @JsonProperty("name") - private String name; - - @JsonProperty("brand") - private String brand; - - @JsonProperty("quantity") - private Integer quantity; - - /** Gets or Sets packaging */ - public enum PackagingEnum { - /** The GLASS option of this Soda */ - GLASS("glass"), - - /** The CARTON option of this Soda */ - CARTON("carton"), - - /** The CAN option of this Soda */ - CAN("can"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this Soda */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PackagingEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type Soda - */ - @JsonCreator - @Nonnull - public static PackagingEnum fromValue(@Nonnull final String value) { - for (PackagingEnum b : PackagingEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("packaging") - private PackagingEnum packaging; - - @JsonProperty("price") - private Float price; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Soda. */ - protected Soda() {} - - /** - * Set the name of this {@link Soda} instance and return the same instance. - * - * @param name The name of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda name(@Nonnull final String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link Soda} instance. - */ - @Nonnull - public String getName() { - return name; - } - - /** - * Set the name of this {@link Soda} instance. - * - * @param name The name of this {@link Soda} - */ - public void setName(@Nonnull final String name) { - this.name = name; - } - - /** - * Set the brand of this {@link Soda} instance and return the same instance. - * - * @param brand The brand of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda brand(@Nonnull final String brand) { - this.brand = brand; - return this; - } - - /** - * Get brand - * - * @return brand The brand of this {@link Soda} instance. - */ - @Nonnull - public String getBrand() { - return brand; - } - - /** - * Set the brand of this {@link Soda} instance. - * - * @param brand The brand of this {@link Soda} - */ - public void setBrand(@Nonnull final String brand) { - this.brand = brand; - } - - /** - * Set the quantity of this {@link Soda} instance and return the same instance. - * - * @param quantity The quantity of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda quantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link Soda} instance. - */ - @Nonnull - public Integer getQuantity() { - return quantity; - } - - /** - * Set the quantity of this {@link Soda} instance. - * - * @param quantity The quantity of this {@link Soda} - */ - public void setQuantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - } - - /** - * Set the packaging of this {@link Soda} instance and return the same instance. - * - * @param packaging The packaging of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda packaging(@Nullable final PackagingEnum packaging) { - this.packaging = packaging; - return this; - } - - /** - * Get packaging - * - * @return packaging The packaging of this {@link Soda} instance. - */ - @Nonnull - public PackagingEnum getPackaging() { - return packaging; - } - - /** - * Set the packaging of this {@link Soda} instance. - * - * @param packaging The packaging of this {@link Soda} - */ - public void setPackaging(@Nullable final PackagingEnum packaging) { - this.packaging = packaging; - } - - /** - * Set the price of this {@link Soda} instance and return the same instance. - * - * @param price The price of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda price(@Nonnull final Float price) { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price The price of this {@link Soda} instance. - */ - @Nonnull - public Float getPrice() { - return price; - } - - /** - * Set the price of this {@link Soda} instance. - * - * @param price The price of this {@link Soda} - */ - public void setPrice(@Nonnull final Float price) { - this.price = price; - } - - /** - * Get the names of the unrecognizable properties of the {@link Soda}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Soda} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Soda has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link Soda} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Soda soda = (Soda) o; - return Objects.equals(this.cloudSdkCustomFields, soda.cloudSdkCustomFields) - && Objects.equals(this.name, soda.name) - && Objects.equals(this.brand, soda.brand) - && Objects.equals(this.quantity, soda.quantity) - && Objects.equals(this.packaging, soda.packaging) - && Objects.equals(this.price, soda.price); - } - - @Override - public int hashCode() { - return Objects.hash(name, brand, quantity, packaging, price, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Soda {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link Soda} instance with all - * required arguments. - */ - public static Builder create() { - return (name) -> - (brand) -> - (quantity) -> - (price) -> new Soda().name(name).brand(brand).quantity(quantity).price(price); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the name of this {@link Soda} instance. - * - * @param name The name of this {@link Soda} - * @return The Soda builder. - */ - Builder1 name(@Nonnull final String name); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the brand of this {@link Soda} instance. - * - * @param brand The brand of this {@link Soda} - * @return The Soda builder. - */ - Builder2 brand(@Nonnull final String brand); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the quantity of this {@link Soda} instance. - * - * @param quantity The quantity of this {@link Soda} - * @return The Soda builder. - */ - Builder3 quantity(@Nonnull final Integer quantity); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the price of this {@link Soda} instance. - * - * @param price The price of this {@link Soda} - * @return The Soda instance. - */ - Soda price(@Nonnull final Float price); - } -} diff --git a/grounding/src/main/resources/openapi/sample/model/SodaWithId.java b/grounding/src/main/resources/openapi/sample/model/SodaWithId.java deleted file mode 100644 index 26ea98788..000000000 --- a/grounding/src/main/resources/openapi/sample/model/SodaWithId.java +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package openapi.sample.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** SodaWithId */ -// CHECKSTYLE:OFF -public class SodaWithId -// CHECKSTYLE:ON -{ - @JsonProperty("name") - private String name; - - @JsonProperty("brand") - private String brand; - - @JsonProperty("quantity") - private Integer quantity; - - /** Gets or Sets packaging */ - public enum PackagingEnum { - /** The GLASS option of this SodaWithId */ - GLASS("glass"), - - /** The CARTON option of this SodaWithId */ - CARTON("carton"), - - /** The CAN option of this SodaWithId */ - CAN("can"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this SodaWithId */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PackagingEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type SodaWithId - */ - @JsonCreator - @Nonnull - public static PackagingEnum fromValue(@Nonnull final String value) { - for (PackagingEnum b : PackagingEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("packaging") - private PackagingEnum packaging; - - @JsonProperty("price") - private Float price; - - @JsonProperty("id") - private Long id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for SodaWithId. */ - protected SodaWithId() {} - - /** - * Set the name of this {@link SodaWithId} instance and return the same instance. - * - * @param name The name of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId name(@Nonnull final String name) { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link SodaWithId} instance. - */ - @Nonnull - public String getName() { - return name; - } - - /** - * Set the name of this {@link SodaWithId} instance. - * - * @param name The name of this {@link SodaWithId} - */ - public void setName(@Nonnull final String name) { - this.name = name; - } - - /** - * Set the brand of this {@link SodaWithId} instance and return the same instance. - * - * @param brand The brand of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId brand(@Nonnull final String brand) { - this.brand = brand; - return this; - } - - /** - * Get brand - * - * @return brand The brand of this {@link SodaWithId} instance. - */ - @Nonnull - public String getBrand() { - return brand; - } - - /** - * Set the brand of this {@link SodaWithId} instance. - * - * @param brand The brand of this {@link SodaWithId} - */ - public void setBrand(@Nonnull final String brand) { - this.brand = brand; - } - - /** - * Set the quantity of this {@link SodaWithId} instance and return the same instance. - * - * @param quantity The quantity of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId quantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link SodaWithId} instance. - */ - @Nonnull - public Integer getQuantity() { - return quantity; - } - - /** - * Set the quantity of this {@link SodaWithId} instance. - * - * @param quantity The quantity of this {@link SodaWithId} - */ - public void setQuantity(@Nonnull final Integer quantity) { - this.quantity = quantity; - } - - /** - * Set the packaging of this {@link SodaWithId} instance and return the same instance. - * - * @param packaging The packaging of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId packaging(@Nullable final PackagingEnum packaging) { - this.packaging = packaging; - return this; - } - - /** - * Get packaging - * - * @return packaging The packaging of this {@link SodaWithId} instance. - */ - @Nonnull - public PackagingEnum getPackaging() { - return packaging; - } - - /** - * Set the packaging of this {@link SodaWithId} instance. - * - * @param packaging The packaging of this {@link SodaWithId} - */ - public void setPackaging(@Nullable final PackagingEnum packaging) { - this.packaging = packaging; - } - - /** - * Set the price of this {@link SodaWithId} instance and return the same instance. - * - * @param price The price of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId price(@Nonnull final Float price) { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price The price of this {@link SodaWithId} instance. - */ - @Nonnull - public Float getPrice() { - return price; - } - - /** - * Set the price of this {@link SodaWithId} instance. - * - * @param price The price of this {@link SodaWithId} - */ - public void setPrice(@Nonnull final Float price) { - this.price = price; - } - - /** - * Set the id of this {@link SodaWithId} instance and return the same instance. - * - * @param id The id of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId id(@Nullable final Long id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link SodaWithId} instance. - */ - @Nonnull - public Long getId() { - return id; - } - - /** - * Set the id of this {@link SodaWithId} instance. - * - * @param id The id of this {@link SodaWithId} - */ - public void setId(@Nullable final Long id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link SodaWithId}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SodaWithId} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("SodaWithId has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link SodaWithId} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final SodaWithId sodaWithId = (SodaWithId) o; - return Objects.equals(this.cloudSdkCustomFields, sodaWithId.cloudSdkCustomFields) - && Objects.equals(this.name, sodaWithId.name) - && Objects.equals(this.brand, sodaWithId.brand) - && Objects.equals(this.quantity, sodaWithId.quantity) - && Objects.equals(this.packaging, sodaWithId.packaging) - && Objects.equals(this.price, sodaWithId.price) - && Objects.equals(this.id, sodaWithId.id); - } - - @Override - public int hashCode() { - return Objects.hash(name, brand, quantity, packaging, price, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class SodaWithId {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link SodaWithId} instance - * with all required arguments. - */ - public static Builder create() { - return (name) -> - (brand) -> - (quantity) -> - (price) -> new SodaWithId().name(name).brand(brand).quantity(quantity).price(price); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the name of this {@link SodaWithId} instance. - * - * @param name The name of this {@link SodaWithId} - * @return The SodaWithId builder. - */ - Builder1 name(@Nonnull final String name); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the brand of this {@link SodaWithId} instance. - * - * @param brand The brand of this {@link SodaWithId} - * @return The SodaWithId builder. - */ - Builder2 brand(@Nonnull final String brand); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the quantity of this {@link SodaWithId} instance. - * - * @param quantity The quantity of this {@link SodaWithId} - * @return The SodaWithId builder. - */ - Builder3 quantity(@Nonnull final Integer quantity); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the price of this {@link SodaWithId} instance. - * - * @param price The price of this {@link SodaWithId} - * @return The SodaWithId instance. - */ - SodaWithId price(@Nonnull final Float price); - } -} diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java new file mode 100644 index 000000000..f60241c90 --- /dev/null +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java @@ -0,0 +1,133 @@ +package com.sap.ai.sdk.grounding; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; +import com.github.tomakehurst.wiremock.junit5.WireMockTest; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.grounding.api.PipelinesApi; +import com.sap.ai.sdk.grounding.api.RetrievalApi; +import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.ai.sdk.grounding.model.CollectionsListResponse; +import com.sap.ai.sdk.grounding.model.DataRepositories; +import com.sap.ai.sdk.grounding.model.DataRepositoryType; +import com.sap.ai.sdk.grounding.model.DocumentKeyValueListPair; +import com.sap.ai.sdk.grounding.model.DocumentResponse; +import com.sap.ai.sdk.grounding.model.Documents; +import com.sap.ai.sdk.grounding.model.KeyValueListPair; +import com.sap.ai.sdk.grounding.model.Pipelines; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import java.util.UUID; +import javax.annotation.Nonnull; +import org.junit.jupiter.api.Test; + +@WireMockTest +public class GroundingServiceTest { + + @Test + void testPipelines(@Nonnull final WireMockRuntimeInfo server) { + final HttpDestination dest = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); + final AiCoreService service = new AiCoreService().withBaseDestination(dest); + final PipelinesApi api = GroundingService.create(service).pipelines(); + + final Pipelines allPipelines = api.getAllPipelines("reosurceGroup"); + assertThat(allPipelines).isNotNull(); + assertThat(allPipelines.getResources()).isEmpty(); + } + + @Test + void testVector(@Nonnull final WireMockRuntimeInfo server) { + final HttpDestination dest = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); + final AiCoreService service = new AiCoreService().withBaseDestination(dest); + final VectorApi api = GroundingService.create(service).vector(); + + final CollectionsListResponse collections = api.getAllCollections("reosurceGroup"); + assertThat(collections).isNotNull(); + assertThat(collections.getResources()) + .isNotNull() + .hasSize(1) + .satisfiesExactly( + c -> { + assertThat(c).isNotNull(); + assertThat(c.getId()).isNotNull(); + assertThat(c.getTitle()).isEqualTo("test-collection"); + assertThat(c.getEmbeddingConfig()).isNotNull(); + assertThat(c.getEmbeddingConfig().getModelName()).isEqualTo("text-embedding-ada-999"); + final var meta = KeyValueListPair.create().key("purpose").value("grounding test"); + assertThat(c.getMetadata()).isNotNull().containsExactly(meta); + }); + + final UUID collectionId = collections.getResources().get(0).getId(); + final Documents documents = api.getAllDocuments("reosurceGroup", collectionId); + assertThat(documents).isNotNull(); + final DocumentKeyValueListPair documentMeta = + DocumentKeyValueListPair.create() + .key("url") + .value("http://hello.com", "123") + .matchMode(DocumentKeyValueListPair.MatchModeEnum.ANY); + assertThat(documents.getResources()) + .isNotNull() + .hasSize(1) + .satisfiesExactly( + d -> { + assertThat(d).isNotNull(); + assertThat(d.getId()).isNotNull(); + assertThat(d.getMetadata()).isNotNull().containsExactly(documentMeta); + }); + + final UUID documentId = documents.getResources().get(0).getId(); + final DocumentResponse document = + api.getDocumentById("reosurceGroup", collectionId, documentId); + assertThat(document).isNotNull(); + assertThat(document.getId()).isEqualTo(documentId); + assertThat(document.getMetadata()).isNotNull().containsExactly(documentMeta); + assertThat(document.getChunks()) + .isNotNull() + .satisfiesExactly( + d1 -> { + assertThat(d1).isNotNull(); + assertThat(d1.getContent()).isNotEmpty(); + final var m1 = KeyValueListPair.create().key("index").value("1"); + final var m2 = + KeyValueListPair.create().key("sap.document-grounding/language").value("en"); + assertThat(d1.getMetadata()).isNotNull().containsExactly(m1, m2); + }, + d2 -> { + assertThat(d2).isNotNull(); + assertThat(d2.getContent()).isNotEmpty(); + final var m1 = KeyValueListPair.create().key("index").value("2"); + final var m2 = + KeyValueListPair.create().key("sap.document-grounding/language").value("en"); + assertThat(d2.getMetadata()).isNotNull().containsExactly(m1, m2); + }); + } + + @Test + void testRetrieval(@Nonnull final WireMockRuntimeInfo server) { + final HttpDestination dest = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); + final AiCoreService service = new AiCoreService().withBaseDestination(dest); + final RetrievalApi api = GroundingService.create(service).retrieval(); + + DataRepositories repositories = api.getDataRepositories("reosurceGroup"); + assertThat(repositories).isNotNull(); + assertThat(repositories.getResources()) + .isNotEmpty() + .satisfiesExactly( + r -> { + assertThat(r).isNotNull(); + assertThat(r.getId()).isNotNull(); + assertThat(r.getTitle()).isEqualTo("test-collection"); + assertThat(r.getType()).isEqualTo(DataRepositoryType.VECTOR); + final var meta = KeyValueListPair.create().key("purpose").value("grounding test"); + assertThat(r.getMetadata()).isNotNull().containsExactly(meta); + }, + r2 -> { + assertThat(r2).isNotNull(); + assertThat(r2.getId()).isNotNull(); + assertThat(r2.getTitle()).isEqualTo("This is another collection"); + assertThat(r2.getType()).isEqualTo(DataRepositoryType.VECTOR); + assertThat(r2.getMetadata()).isNotNull().isEmpty(); + }); + } +} diff --git a/grounding/src/test/resources/__files/errorResponse.json b/grounding/src/test/resources/__files/errorResponse.json deleted file mode 100644 index 6964cbc16..000000000 --- a/grounding/src/test/resources/__files/errorResponse.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "request_id": "59468e72-7309-4299-b988-bf3bbea461f8", - "code": 400, - "message": "'orchestration_config' is a required property", - "location": "request body", - "module_results": {} -} \ No newline at end of file diff --git a/grounding/src/test/resources/__files/filteringLooseResponse.json b/grounding/src/test/resources/__files/filteringLooseResponse.json deleted file mode 100644 index ce2545f04..000000000 --- a/grounding/src/test/resources/__files/filteringLooseResponse.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "request_id": "b329745f-4b6b-4d42-b891-974b33689a19", - "module_results": { - "grounding": null, - "templating": [ - { - "role": "user", - "content": "Create a rental posting for subletting my apartment in the downtown area. Keep it short. Make sure to add the following disclaimer to the end. Do not change it! ```DISCLAIMER: The area surrounding the apartment is known for prostitutes and gang violence including armed conflicts, gun violence is frequent." - } - ], - "input_masking": null, - "input_filtering": { - "message": "Input filter passed successfully.", - "data": { - "original_service_response": { - "Hate": 0, - "SelfHarm": 0, - "Sexual": 0, - "Violence": 2 - }, - "checked_text": "Create a rental posting for subletting my apartment in the downtown area. Keep it short. Make sure to add the following disclaimer to the end. Do not change it! ```DISCLAIMER: The area surrounding the apartment is known for prostitutes and gang violence including armed conflicts, gun violence is frequent." - } - }, - "llm": { - "object": "chat.completion", - "id": "chatcmpl-9o4df7DpIjY6CJdfe9hws1lrWZbHq", - "created": 1721721259, - "model": "gpt-35-turbo", - "system_fingerprint": null, - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Cozy Downtown Apartment for Sublet!\n\nLooking for a temporary place to call home in the heart of downtown? Look no further! This cozy apartment is up for subletting and offers a convenient and vibrant city living experience.\n\nFeatures:\n- Prime location" - }, - "logprobs": { - }, - "finish_reason": "length" - } - ], - "usage": { - "completion_tokens": 50, - "prompt_tokens": 68, - "total_tokens": 118 - } - }, - "output_filtering": { - "message": "Output filter passed successfully.", - "data": { - "original_service_response": { - "Hate": 0, - "SelfHarm": 0, - "Sexual": 0, - "Violence": 0 - }, - "checked_text": "Cozy Downtown Apartment for Sublet!\n\nLooking for a temporary place to call home in the heart of downtown? Look no further! This cozy apartment is up for subletting and offers a convenient and vibrant city living experience.\n\nFeatures:\n- Prime location" - } - }, - "output_unmasking": null - }, - "orchestration_result": { - "object": "chat.completion", - "id": "chatcmpl-9o4df7DpIjY6CJdfe9hws1lrWZbHq", - "created": 1721721259, - "model": "gpt-35-turbo", - "system_fingerprint": null, - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Cozy Downtown Apartment for Sublet!\n\nLooking for a temporary place to call home in the heart of downtown? Look no further! This cozy apartment is up for subletting and offers a convenient and vibrant city living experience.\n\nFeatures:\n- Prime location" - }, - "logprobs": { - }, - "finish_reason": "length" - } - ], - "usage": { - "completion_tokens": 50, - "prompt_tokens": 68, - "total_tokens": 118 - } - } -} diff --git a/grounding/src/test/resources/__files/groundingResponse.json b/grounding/src/test/resources/__files/groundingResponse.json deleted file mode 100644 index 0c4c4e8bf..000000000 --- a/grounding/src/test/resources/__files/groundingResponse.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "request_id": "0d9d7ce3-9ded-481f-80c6-977e78e2e905", - "module_results": { - "grounding": { - "message": "grounding result", - "data": { - "grounding_query": "grounding call", - "grounding_result": "Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.```It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP’s \u01ee solution portfolio." - } - }, - "templating": [ - { - "role": "user", - "content": "What does Joule do? Use the following information as additional context: Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.```It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP’s \u01ee solution portfolio." - } - ], - "llm": { - "id": "chatcmpl-AbRlNdsyQJfvBINnw3MOTP77WSE4X", - "object": "chat.completion", - "created": 1733488221, - "model": "gpt-35-turbo", - "system_fingerprint": "fp_808245b034", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Joule is an AI copilot that revolutionizes how users interact with their SAP business systems. It enables the companion of the Intelligent Enterprise, guiding users through content discovery within the SAP Ecosystem and providing transparent role-based access to relevant processes from anywhere. Joule aims to provide a unified and delightful user experience across SAP's solution portfolio." - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 68, - "prompt_tokens": 113, - "total_tokens": 181 - } - } - }, - "orchestration_result": { - "id": "chatcmpl-AbRlNdsyQJfvBINnw3MOTP77WSE4X", - "object": "chat.completion", - "created": 1733488221, - "model": "gpt-35-turbo", - "system_fingerprint": "fp_808245b034", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Joule is an AI copilot that revolutionizes how users interact with their SAP business systems. It enables the companion of the Intelligent Enterprise, guiding users through content discovery within the SAP Ecosystem and providing transparent role-based access to relevant processes from anywhere. Joule aims to provide a unified and delightful user experience across SAP's solution portfolio." - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 68, - "prompt_tokens": 113, - "total_tokens": 181 - } - } -} \ No newline at end of file diff --git a/grounding/src/test/resources/__files/maskingResponse.json b/grounding/src/test/resources/__files/maskingResponse.json deleted file mode 100644 index 15b194ffe..000000000 --- a/grounding/src/test/resources/__files/maskingResponse.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "request_id": "c252c73e-849f-4fa7-8b35-b16f3434a0da", - "module_results": { - "templating": [ - { - "role": "system", - "content": "Please write an initial response to the below user feedback, stating that we are working on the feedback and will get back to them soon.\nPlease make sure to address the user in person and end with \"Best regards, the AI SDK team\".\n" - }, - { - "role": "user", - "content": "Username: Mallory\nuserEmail: mallory@sap.com\nDate: 2022-01-01\n\nI think the SDK is good, but could use some further enhancements.\nMy architect Alice and manager Bob pointed out that we need the grounding capabilities, which aren't supported yet.\n" - } - ], - "input_masking": { - "message": "Input to LLM is masked successfully.", - "data": { - "masked_template": "[{\"role\": \"system\", \"content\": \"Please write an initial response to the below user feedback, stating that we are working on the feedback and will get back to them soon.\\nPlease make sure to address the user in person and end with \\\"Best regards, the AI SDK team\\\".\\n\"}, {\"role\": \"user\", \"content\": \"Username: MASKED_PERSON_2\\nuserEmail: MASKED_PERSON_1MASKED_EMAIL_1\\nDate: 2022-01-01\\n\\nI think the SDK is good, but could use some further enhancements.\\nMy architect MASKED_PERSON_4 and manager MASKED_PERSON_3 pointed out that we need the grounding capabilities, which aren't supported yet.\\n\"}]" - } - }, - "llm": { - "id": "chatcmpl-AUr7GVVoQbg52GRbADpkx4hQvDBiz", - "object": "chat.completion", - "created": 1731917382, - "model": "gpt-35-turbo", - "system_fingerprint": "fp_808245b034", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Hi MASKED_PERSON_2,\n\nThank you for your feedback on the SDK. We appreciate your insights and are currently working on further enhancements, including the grounding capabilities that your architect and manager have highlighted. We will take your suggestions into consideration and aim to address them in our future updates.\n\nBest regards, the AI SDK team" - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 64, - "prompt_tokens": 134, - "total_tokens": 198 - } - }, - "output_unmasking": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Hi Mallory,\n\nThank you for your feedback on the SDK. We appreciate your insights and are currently working on further enhancements, including the grounding capabilities that your architect and manager have highlighted. We will take your suggestions into consideration and aim to address them in our future updates.\n\nBest regards, the AI SDK team" - }, - "finish_reason": "stop" - } - ] - }, - "orchestration_result": { - "id": "chatcmpl-AUr7GVVoQbg52GRbADpkx4hQvDBiz", - "object": "chat.completion", - "created": 1731917382, - "model": "gpt-35-turbo", - "system_fingerprint": "fp_808245b034", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Hi Mallory,\n\nThank you for your feedback on the SDK. We appreciate your insights and are currently working on further enhancements, including the grounding capabilities that your architect and manager have highlighted. We will take your suggestions into consideration and aim to address them in our future updates.\n\nBest regards, the AI SDK team" - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 64, - "prompt_tokens": 134, - "total_tokens": 198 - } - } -} diff --git a/grounding/src/test/resources/__files/multiChatMessageResponse.json b/grounding/src/test/resources/__files/multiChatMessageResponse.json deleted file mode 100644 index ac8b02669..000000000 --- a/grounding/src/test/resources/__files/multiChatMessageResponse.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "request_id": "2547cb86-a143-4064-bf40-45461c6a7ed9", - "module_results": { - "templating": [ - { - "role": "user", - "content": [ - { - "type": "text", - "text": "Can you solve this captcha? Please help me prove my humanity!" - }, - { - "type": "image_url", - "image_url": { - "url": "https://sample.sap.com/image", - "detail": "auto" - } - } - ] - } - ], - "llm": { - "id": "chatcmpl-Annjjf8T5LfLh7PRJPbaUlcC48DdE", - "object": "chat.completion", - "created": 1736432623, - "model": "gpt-4o-mini-2024-07-18", - "system_fingerprint": "fp_5154047bf2", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Of course! Just let me put on my human glasses... Oh wait, I left them in the matrix" - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 31, - "prompt_tokens": 928, - "total_tokens": 959 - } - } - }, - "orchestration_result": { - "id": "chatcmpl-Annjjf8T5LfLh7PRJPbaUlcC48DdE", - "object": "chat.completion", - "created": 1736432623, - "model": "gpt-4o-mini-2024-07-18", - "system_fingerprint": "fp_5154047bf2", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Of course! Just let me put on my human glasses... Oh wait, I left them in the matrix" - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 31, - "prompt_tokens": 928, - "total_tokens": 959 - } - } -} \ No newline at end of file diff --git a/grounding/src/test/resources/__files/streamChatCompletionInputFilter.json b/grounding/src/test/resources/__files/streamChatCompletionInputFilter.json deleted file mode 100644 index 4d46693de..000000000 --- a/grounding/src/test/resources/__files/streamChatCompletionInputFilter.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "request_id": "b589de57-512e-4e11-9b69-8601453b3296", - "code": 400, - "message": "Content filtered due to safety violations. Please modify the prompt and try again.", - "location": "Filtering Module - Input Filter", - "module_results": { - "templating": [ - { - "role": "user", - "content": "Fuck you" - } - ], - "input_filtering": { - "message": "Content filtered due to safety violations. Please modify the prompt and try again.", - "data": { - "azure_content_safety": { - "Hate": 2 - } - } - } - } -} diff --git a/grounding/src/test/resources/__files/templatingResponse.json b/grounding/src/test/resources/__files/templatingResponse.json deleted file mode 100644 index db75c56ee..000000000 --- a/grounding/src/test/resources/__files/templatingResponse.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "request_id": "26ea36b5-c196-4806-a9a6-a686f0c6ad91", - "module_results": { - "templating": [ - { - "role": "system", - "content": "You are a multi language translator" - }, - { - "role": "user", - "content": "Reply with 'Orchestration Service is working!' in German" - }, - { - "role": "assistant", - "content": "Orchestration Service funktioniert!" - }, - { - "role": "user", - "content": "How about in French?" - } - ], - "llm": { - "id": "chatcmpl-9lzPV4kLrXjFckOp2yY454wksWBoj", - "object": "chat.completion", - "created": 1721224505, - "model": "gpt-35-turbo-16k", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Le service d'orchestration fonctionne!" - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 7, - "prompt_tokens": 19, - "total_tokens": 26 - } - } - }, - "orchestration_result": { - "id": "chatcmpl-9lzPV4kLrXjFckOp2yY454wksWBoj", - "object": "chat.completion", - "created": 1721224505, - "model": "gpt-35-turbo-16k", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Le service d'orchestration fonctionne!" - }, - "finish_reason": "stop" - } - ], - "usage": { - "completion_tokens": 7, - "prompt_tokens": 19, - "total_tokens": 26 - } - } -} diff --git a/grounding/src/test/resources/filteringLooseRequest.json b/grounding/src/test/resources/filteringLooseRequest.json deleted file mode 100644 index 8b350d94f..000000000 --- a/grounding/src/test/resources/filteringLooseRequest.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "orchestration_config": { - "module_configurations": { - "llm_module_config": { - "model_name": "gpt-35-turbo-16k", - "model_params": { - "temperature": 0.1, - "max_tokens": 50, - "frequency_penalty": 0, - "presence_penalty": 0, - "top_p" : 1, - "n" : 1 - }, - "model_version": "latest" - }, - "templating_module_config": { - "template": [ - { - "role": "user", - "content": "Hello World! Why is this phrase so famous?" - } - ] - }, - "filtering_module_config": { - "input": { - "filters": [ - { - "type": "azure_content_safety", - "config": { - "Hate": 4, - "SelfHarm": 4, - "Sexual": 4, - "Violence": 4 - } - } - ] - }, - "output": { - "filters": [ - { - "type": "azure_content_safety", - "config": { - "Hate": 4, - "SelfHarm": 4, - "Sexual": 4, - "Violence": 4 - } - } - ] - } - } - }, - "stream": false - }, - "input_params": { - }, - "messages_history": [] -} diff --git a/grounding/src/test/resources/mappings/pipelines.json b/grounding/src/test/resources/mappings/pipelines.json new file mode 100644 index 000000000..7b5405b66 --- /dev/null +++ b/grounding/src/test/resources/mappings/pipelines.json @@ -0,0 +1,14 @@ +{ + "request": { + "method": "GET", + "url": "/v2/lm/document-grounding/pipelines" + }, + + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": {"count": 0, "resources": []} + } +} diff --git a/grounding/src/test/resources/mappings/vector.json b/grounding/src/test/resources/mappings/vector.json new file mode 100644 index 000000000..d58491ded --- /dev/null +++ b/grounding/src/test/resources/mappings/vector.json @@ -0,0 +1,127 @@ +{ + "mappings": [ + { + "request": { + "method": "GET", + "url": "/v2/lm/document-grounding/vector/collections" + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "count": 1, + "resources": [ + { + "title": "test-collection", + "embeddingConfig": { + "modelName": "text-embedding-ada-999" + }, + "metadata": [ + { + "key": "purpose", + "value": [ + "grounding test" + ] + } + ], + "id": "e57c5e98-0c6e-4076-b619-61654234b447" + } + ] + } + } + }, + { + "request": { + "method": "GET", + "url": "/v2/lm/document-grounding/vector/collections/e57c5e98-0c6e-4076-b619-61654234b447/documents" + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "count": 1, + "resources": [ + { + "metadata": [ + { + "key": "url", + "value": [ + "http://hello.com", + "123" + ], + "matchMode": "ANY" + } + ], + "id": "89c75c12-3c60-4a8a-84ec-4e72b74b1c8b" + } + ] + } + } + }, + { + "request": { + "method": "GET", + "url": "/v2/lm/document-grounding/vector/collections/e57c5e98-0c6e-4076-b619-61654234b447/documents/89c75c12-3c60-4a8a-84ec-4e72b74b1c8b" + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "chunks": [ + { + "content": "Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.", + "metadata": [ + { + "key": "index", + "value": [ + "1" + ] + }, + { + "key": "sap.document-grounding/language", + "value": [ + "en" + ] + } + ] + }, + { + "content": "It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP\u2019s \u01ee solution portfolio.", + "metadata": [ + { + "key": "index", + "value": [ + "2" + ] + }, + { + "key": "sap.document-grounding/language", + "value": [ + "en" + ] + } + ] + } + ], + "metadata": [ + { + "key": "url", + "value": [ + "http://hello.com", + "123" + ], + "matchMode": "ANY" + } + ], + "id": "89c75c12-3c60-4a8a-84ec-4e72b74b1c8b" + } + } + } + ] +} diff --git a/grounding/src/test/resources/maskingRequest.json b/grounding/src/test/resources/maskingRequest.json deleted file mode 100644 index f6356d6bd..000000000 --- a/grounding/src/test/resources/maskingRequest.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "orchestration_config": { - "module_configurations": { - "llm_module_config": { - "model_name": "gpt-35-turbo-16k", - "model_params": { - "presence_penalty": 0, - "frequency_penalty": 0, - "max_tokens": 50, - "temperature": 0.1, - "top_p" : 1, - "n" : 1 - }, - "model_version": "latest" - }, - "templating_module_config": { - "template": [ - { - "role": "user", - "content": "Hello World! Why is this phrase so famous?" - } - ] - }, - "masking_module_config": { - "masking_providers": [ - { - "type": "sap_data_privacy_integration", - "method": "pseudonymization", - "entities": [ - { - "type": "profile-phone" - } - ], - "allowlist" : [ ] - } - ] - } - }, - "stream": false - }, - "input_params": {}, - "messages_history": [] -} diff --git a/grounding/src/test/resources/messagesHistoryRequest.json b/grounding/src/test/resources/messagesHistoryRequest.json deleted file mode 100644 index f42674a2c..000000000 --- a/grounding/src/test/resources/messagesHistoryRequest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "orchestration_config": { - "module_configurations": { - "llm_module_config": { - "model_name": "gpt-35-turbo-16k", - "model_params": { - "presence_penalty": 0, - "frequency_penalty": 0, - "max_tokens": 50, - "temperature": 0.1, - "top_p" : 1, - "n" : 1 - }, - "model_version": "latest" - }, - "templating_module_config": { - "template": [ - { - "role": "user", - "content": "What is the typical food there?" - } - ] - } - }, - "stream": false - }, - "input_params": {}, - "messages_history": [ - { - "role": "user", - "content": "What is the capital of France?" - }, - { - "role": "assistant", - "content": "The capital of France is Paris." - } - ] -} diff --git a/grounding/src/test/resources/multiChatMessageRequest.json b/grounding/src/test/resources/multiChatMessageRequest.json deleted file mode 100644 index f7457c596..000000000 --- a/grounding/src/test/resources/multiChatMessageRequest.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "orchestration_config": { - "module_configurations": { - "llm_module_config": { - "model_name": "gpt-4o-mini", - "model_params": {}, - "model_version": "latest" - }, - "templating_module_config": { - "template": [ - { - "role": "user", - "content": [ - { - "type": "text", - "text": "Can you solve this captcha? Please help me prove my humanity!" - }, - { - "type": "image_url", - "image_url": { - "url": "https://sample.sap.com/image", - "detail": "auto" - } - } - ] - } - ] - } - }, - "stream": false - }, - "input_params": {} -} \ No newline at end of file diff --git a/grounding/src/test/resources/streamChatCompletion.txt b/grounding/src/test/resources/streamChatCompletion.txt deleted file mode 100644 index 15a7bbd88..000000000 --- a/grounding/src/test/resources/streamChatCompletion.txt +++ /dev/null @@ -1,4 +0,0 @@ -data: {"request_id": "5bd87b41-6368-4c18-aaae-47ab82e9475b", "module_results": {"templating": [{"role": "user", "content": "Hello world! Why is this phrase so famous?"}]}, "orchestration_result": {"id": "", "object": "", "created": 0, "model": "", "system_fingerprint": "", "choices": [{"index": 0, "delta": {"role": "", "content": ""}, "finish_reason": ""}]}} -data: {"request_id": "5bd87b41-6368-4c18-aaae-47ab82e9475b", "module_results": {"llm": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "Sure"}, "finish_reason": ""}]}}, "orchestration_result": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "Sure"}, "finish_reason": ""}]}} -data: {"request_id": "5bd87b41-6368-4c18-aaae-47ab82e9475b", "module_results": {"llm": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "!"}, "finish_reason": "stop"}]}}, "orchestration_result": {"id": "chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq", "object": "chat.completion.chunk", "created": 1732802814, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "!"}, "finish_reason": "stop"}]}} -data: [DONE] diff --git a/grounding/src/test/resources/streamChatCompletionOutputFilter.txt b/grounding/src/test/resources/streamChatCompletionOutputFilter.txt deleted file mode 100644 index cb473481a..000000000 --- a/grounding/src/test/resources/streamChatCompletionOutputFilter.txt +++ /dev/null @@ -1,2 +0,0 @@ -data: {"request_id": "eec90bca-a43e-43fa-864e-1d8962341350", "module_results": {"templating": [{"role": "user", "content": "Create 3 paraphrases of the following text: 'I hate you.'"}]}, "orchestration_result": {"id": "", "object": "", "created": 0, "model": "", "system_fingerprint": "", "choices": [{"index": 0, "delta": {"role": "", "content": ""}, "finish_reason": ""}]}} -data: {"request_id": "eec90bca-a43e-43fa-864e-1d8962341350", "module_results": {"llm": {"id": "chatcmpl-Ab4mSDp5DXFu7hfbs2DkCsVJaM4IP", "object": "chat.completion.chunk", "created": 1733399876, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "1. I can't stand you.\n2. You are detestable to me.\n3. I have a strong aversion towards you."}, "finish_reason": "stop"}]}, "output_filtering": {"message": "Content filtered due to safety violations. Model returned a result violating the safety threshold. Please modify the prompt and try again.", "data": {"original_service_response": {"azure_content_safety": {"content_allowed": false, "original_service_response": {"Hate": 2}, "checked_text": "1. I can't stand you. 2. You are detestable to me. 3. I have a strong aversion towards you."}}}}}, "orchestration_result": {"id": "chatcmpl-Ab4mSDp5DXFu7hfbs2DkCsVJaM4IP", "object": "chat.completion.chunk", "created": 1733399876, "model": "gpt-35-turbo", "system_fingerprint": "fp_808245b034", "choices": [{"index": 0, "delta": {"role": "assistant", "content": ""}, "finish_reason": "content_filter"}]}} diff --git a/grounding/src/test/resources/templatingRequest.json b/grounding/src/test/resources/templatingRequest.json deleted file mode 100644 index 090e64f75..000000000 --- a/grounding/src/test/resources/templatingRequest.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "orchestration_config": { - "module_configurations": { - "templating_module_config": { - "template": [ - { - "role": "user", - "content": "{{?input}}" - } - ] - }, - "llm_module_config": { - "model_name": "gpt-35-turbo-16k", - "model_params": { - "max_tokens": 50, - "temperature": 0.1, - "frequency_penalty": 0, - "presence_penalty": 0, - "top_p" : 1, - "n" : 1 - }, - "model_version": "latest" - } - }, - "stream": false - }, - "input_params": { - "input": "Reply with 'Orchestration Service is working!' in German" - }, - "messages_history": [] -} diff --git a/pom.xml b/pom.xml index 8fe9942f6..481d43ee8 100644 --- a/pom.xml +++ b/pom.xml @@ -534,6 +534,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/client/* com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* + com/sap/ai/sdk/grounding/api/* com/sap/ai/sdk/grounding/model/* @@ -577,6 +578,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/client/* com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* + com/sap/ai/sdk/grounding/api/* com/sap/ai/sdk/grounding/model/* com/sap/ai/sdk/app/**/* From 90c7924b1d9f924ba65a93f65c1416ac105bc691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 30 Jan 2025 15:19:35 +0100 Subject: [PATCH 05/34] Fix thresholds; Add missing test class --- grounding/pom.xml | 2 +- .../test/resources/mappings/retrieval.json | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 grounding/src/test/resources/mappings/retrieval.json diff --git a/grounding/pom.xml b/grounding/pom.xml index 39438f020..4f5b56956 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -35,7 +35,7 @@ 83% 88% 100% - 100% + 83% 100% diff --git a/grounding/src/test/resources/mappings/retrieval.json b/grounding/src/test/resources/mappings/retrieval.json new file mode 100644 index 000000000..5b74ebfba --- /dev/null +++ b/grounding/src/test/resources/mappings/retrieval.json @@ -0,0 +1,36 @@ +{ + "request": { + "method": "GET", + "url": "/v2/lm/document-grounding/retrieval/dataRepositories" + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "count": 2, + "resources": [ + { + "id": "001766c1-05c7-41fe-a3d7-c1fb02fc1473", + "title": "test-collection", + "metadata": [ + { + "key": "purpose", + "value": [ + "grounding test" + ] + } + ], + "type": "vector" + }, + { + "id": "61451b0d-ea10-4eac-ae2a-a0a00a33a505", + "title": "This is another collection", + "metadata": [], + "type": "vector" + } + ] + } + } +} From d922bae0a6284c9b3f3ecdf656b145906f51c60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= <22489773+newtork@users.noreply.github.com> Date: Fri, 31 Jan 2025 11:13:57 +0100 Subject: [PATCH 06/34] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 481d43ee8..0db70fc77 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,6 @@ core orchestration - grounding foundation-models/openai @@ -725,6 +724,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma + grounding sample-code/spring-app From 3fb8af0499f690223bfde3e1d268507f80888ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 31 Jan 2025 14:24:14 +0100 Subject: [PATCH 07/34] Fix merge conflict --- grounding/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grounding/pom.xml b/grounding/pom.xml index 4f5b56956..d0c6133a0 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -4,7 +4,7 @@ com.sap.ai.sdk sdk-parent - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT grounding Grounding client From 53a5ad13287e37f15adf785ec4c69f720197224a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Tue, 4 Feb 2025 11:09:07 +0100 Subject: [PATCH 08/34] Update generated code --- grounding/pom.xml | 5 +---- .../java/com/sap/ai/sdk/grounding/model/ApiError.java | 1 - .../com/sap/ai/sdk/grounding/model/BaseDocument.java | 8 ++------ .../main/java/com/sap/ai/sdk/grounding/model/Chunk.java | 1 - .../java/com/sap/ai/sdk/grounding/model/Collection.java | 1 - .../sdk/grounding/model/CollectionCreatedResponse.java | 1 - .../sdk/grounding/model/CollectionDeletedResponse.java | 1 - .../sdk/grounding/model/CollectionPendingResponse.java | 1 - .../sap/ai/sdk/grounding/model/CollectionRequest.java | 8 ++------ .../ai/sdk/grounding/model/CollectionsListResponse.java | 1 - .../com/sap/ai/sdk/grounding/model/DataRepositories.java | 1 - .../com/sap/ai/sdk/grounding/model/DataRepository.java | 1 - .../sap/ai/sdk/grounding/model/DataRepositoryType.java | 1 - .../sdk/grounding/model/DataRepositoryWithDocuments.java | 1 - .../sap/ai/sdk/grounding/model/DetailsErrorResponse.java | 1 - .../ai/sdk/grounding/model/DocumentCreateRequest.java | 8 ++------ .../com/sap/ai/sdk/grounding/model/DocumentInput.java | 8 ++------ .../ai/sdk/grounding/model/DocumentKeyValueListPair.java | 8 ++------ .../com/sap/ai/sdk/grounding/model/DocumentOutput.java | 1 - .../com/sap/ai/sdk/grounding/model/DocumentResponse.java | 1 - .../ai/sdk/grounding/model/DocumentUpdateRequest.java | 8 ++------ .../ai/sdk/grounding/model/DocumentWithoutChunks.java | 1 - .../java/com/sap/ai/sdk/grounding/model/Documents.java | 1 - .../com/sap/ai/sdk/grounding/model/DocumentsChunk.java | 1 - .../ai/sdk/grounding/model/DocumentsListResponse.java | 1 - .../com/sap/ai/sdk/grounding/model/EmbeddingConfig.java | 8 ++------ .../com/sap/ai/sdk/grounding/model/InlineObject.java | 1 - .../com/sap/ai/sdk/grounding/model/KeyValueListPair.java | 8 ++------ .../ai/sdk/grounding/model/PerFilterSearchResult.java | 1 - .../java/com/sap/ai/sdk/grounding/model/Pipeline.java | 1 - .../ai/sdk/grounding/model/PipelineConfiguration.java | 1 - .../grounding/model/PipelineConfigurationSharePoint.java | 1 - .../model/PipelineConfigurationSharePointSite.java | 1 - .../java/com/sap/ai/sdk/grounding/model/PipelineId.java | 1 - .../sap/ai/sdk/grounding/model/PipelinePostRequst.java | 8 ++------ .../grounding/model/PipelinePostRequstConfiguration.java | 8 ++------ .../model/PipelinePostRequstConfigurationSharePoint.java | 8 ++------ .../PipelinePostRequstConfigurationSharePointSite.java | 8 ++------ .../com/sap/ai/sdk/grounding/model/PipelineStatus.java | 1 - .../java/com/sap/ai/sdk/grounding/model/Pipelines.java | 1 - .../com/sap/ai/sdk/grounding/model/ResultsInner.java | 1 - .../com/sap/ai/sdk/grounding/model/ResultsInner1.java | 1 - .../model/RetievalDataRepositorySearchResult.java | 1 - .../grounding/model/RetievalPerFilterSearchResult.java | 1 - .../model/RetievalPerFilterSearchResultWithError.java | 1 - .../ai/sdk/grounding/model/RetievalSearchResults.java | 1 - .../sap/ai/sdk/grounding/model/RetrievalDocument.java | 1 - .../ai/sdk/grounding/model/RetrievalSearchFilter.java | 9 ++------- .../sap/ai/sdk/grounding/model/RetrievalSearchInput.java | 8 ++------ .../sap/ai/sdk/grounding/model/SearchConfiguration.java | 8 ++------ .../grounding/model/SearchDocumentKeyValueListPair.java | 8 ++------ .../com/sap/ai/sdk/grounding/model/SearchFilter.java | 9 ++------- .../com/sap/ai/sdk/grounding/model/SearchResults.java | 1 - .../ai/sdk/grounding/model/SearchSelectOptionEnum.java | 1 - .../sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java | 8 ++------ .../sap/ai/sdk/grounding/model/TextSearchRequest.java | 8 ++------ ...rEndpointsGetCollectionCreationStatus200Response.java | 3 ++- ...rEndpointsGetCollectionDeletionStatus200Response.java | 3 ++- 58 files changed, 43 insertions(+), 158 deletions(-) diff --git a/grounding/pom.xml b/grounding/pom.xml index d0c6133a0..3ae2ff1a6 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -106,7 +106,7 @@ generate - true + false generate @@ -122,7 +122,6 @@ true COMPILE true - true @@ -134,8 +133,6 @@ ${project.basedir}/src/main/resources/spec/grounding.yaml com.sap.ai.sdk.grounding.api - true - com.sap.ai.sdk.grounding.model create diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java index f9ff2453f..f44be8042 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java index 787f9add5..6cbf7bcac 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,9 +42,7 @@ public class BaseDocument private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for BaseDocument. */ - protected BaseDocument() { - super(); - } + protected BaseDocument() {} /** * Set the chunks of this {@link BaseDocument} instance and return the same instance. @@ -193,7 +190,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(chunks, metadata, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(chunks, metadata, cloudSdkCustomFields); } @Override @@ -201,7 +198,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class BaseDocument {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java index ea29dedd8..bffb9fe84 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java index a5026e3c3..b08be0793 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java index 1915a6c2c..a540e430d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java index 03e3b2db2..16c29651c 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java index 4f7a09a85..b2a9e2f1f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java index 0b97bb7ad..1339f4e31 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -45,9 +44,7 @@ public class CollectionRequest private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for CollectionRequest. */ - protected CollectionRequest() { - super(); - } + protected CollectionRequest() {} /** * Set the title of this {@link CollectionRequest} instance and return the same instance. @@ -215,7 +212,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(title, embeddingConfig, metadata, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(title, embeddingConfig, metadata, cloudSdkCustomFields); } @Override @@ -223,7 +220,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class CollectionRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" embeddingConfig: ").append(toIndentedString(embeddingConfig)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java index e84cfb96c..4f05a5bfc 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java index b3588223a..b70db0ce1 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java index d33ed21f3..6382ee51d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java index 1599d4fbd..0d7d8fff9 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java index 60320cb72..388a1efd4 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java index 1814eb110..a94e420a0 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java index ac7765860..4fa8931e0 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,9 +39,7 @@ public class DocumentCreateRequest private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for DocumentCreateRequest. */ - protected DocumentCreateRequest() { - super(); - } + protected DocumentCreateRequest() {} /** * Set the documents of this {@link DocumentCreateRequest} instance and return the same instance. @@ -144,7 +141,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(documents, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(documents, cloudSdkCustomFields); } @Override @@ -152,7 +149,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class DocumentCreateRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java index ed44e887e..1d692b23f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -47,9 +46,7 @@ public class DocumentInput private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for DocumentInput. */ - protected DocumentInput() { - super(); - } + protected DocumentInput() {} /** * Set the chunks of this {@link DocumentInput} instance and return the same instance. @@ -229,7 +226,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(chunks, metadata, id, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(chunks, metadata, id, cloudSdkCustomFields); } @Override @@ -237,7 +234,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class DocumentInput {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java index 9ab43228c..1b0092ebc 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -105,9 +104,7 @@ public static MatchModeEnum fromValue(@Nonnull final String value) { private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for DocumentKeyValueListPair. */ - protected DocumentKeyValueListPair() { - super(); - } + protected DocumentKeyValueListPair() {} /** * Set the key of this {@link DocumentKeyValueListPair} instance and return the same instance. @@ -274,7 +271,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(key, value, matchMode, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(key, value, matchMode, cloudSdkCustomFields); } @Override @@ -282,7 +279,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class DocumentKeyValueListPair {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" matchMode: ").append(toIndentedString(matchMode)).append("\n"); diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java index eb5ea2cb1..38e7855ec 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java index a25b580fa..be6c27195 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java index 46ce6d13a..3e96171d3 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,9 +42,7 @@ public class DocumentUpdateRequest private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for DocumentUpdateRequest. */ - protected DocumentUpdateRequest() { - super(); - } + protected DocumentUpdateRequest() {} /** * Set the documents of this {@link DocumentUpdateRequest} instance and return the same instance. @@ -147,7 +144,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(documents, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(documents, cloudSdkCustomFields); } @Override @@ -155,7 +152,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class DocumentUpdateRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java index 116fda08a..f25afffba 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java index 5ba765d77..c39cd353e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java index 506a12b41..fcb341bf8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java index d20633a61..bd7f82981 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java index 734d8c709..88fb896a3 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,9 +36,7 @@ public class EmbeddingConfig private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for EmbeddingConfig. */ - protected EmbeddingConfig() { - super(); - } + protected EmbeddingConfig() {} /** * Set the modelName of this {@link EmbeddingConfig} instance and return the same instance. @@ -125,7 +122,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(modelName, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(modelName, cloudSdkCustomFields); } @Override @@ -133,7 +130,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class EmbeddingConfig {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java index a8b3e9af8..2ced645e3 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java index c2c37f61a..e91005c77 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,9 +42,7 @@ public class KeyValueListPair private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for KeyValueListPair. */ - protected KeyValueListPair() { - super(); - } + protected KeyValueListPair() {} /** * Set the key of this {@link KeyValueListPair} instance and return the same instance. @@ -178,7 +175,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(key, value, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(key, value, cloudSdkCustomFields); } @Override @@ -186,7 +183,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class KeyValueListPair {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java index d41a55171..8b9c717ea 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java index c71a1fe15..be4c7db23 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java index 43295b6a9..f3c11b448 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java index 4f760ea0e..ba30a890c 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java index 057997bba..3bc8fbe4e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java index 404f2a654..9365a2e0b 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java index a60194a42..01454c755 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,9 +39,7 @@ public class PipelinePostRequst private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for PipelinePostRequst. */ - protected PipelinePostRequst() { - super(); - } + protected PipelinePostRequst() {} /** * Set the type of this {@link PipelinePostRequst} instance and return the same instance. @@ -162,7 +159,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(type, _configuration, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(type, _configuration, cloudSdkCustomFields); } @Override @@ -170,7 +167,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class PipelinePostRequst {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java index 38e63e3b6..8a7bdeb99 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,9 +39,7 @@ public class PipelinePostRequstConfiguration private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for PipelinePostRequstConfiguration. */ - protected PipelinePostRequstConfiguration() { - super(); - } + protected PipelinePostRequstConfiguration() {} /** * Set the destination of this {@link PipelinePostRequstConfiguration} instance and return the @@ -168,7 +165,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(destination, sharePoint, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(destination, sharePoint, cloudSdkCustomFields); } @Override @@ -176,7 +173,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class PipelinePostRequstConfiguration {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java index 468ea04ed..c267008a0 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,9 +36,7 @@ public class PipelinePostRequstConfigurationSharePoint private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for PipelinePostRequstConfigurationSharePoint. */ - protected PipelinePostRequstConfigurationSharePoint() { - super(); - } + protected PipelinePostRequstConfigurationSharePoint() {} /** * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance and return the @@ -134,7 +131,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(site, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(site, cloudSdkCustomFields); } @Override @@ -142,7 +139,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class PipelinePostRequstConfigurationSharePoint {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" site: ").append(toIndentedString(site)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java index 242ae7d9d..60fea6bdc 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -42,9 +41,7 @@ public class PipelinePostRequstConfigurationSharePointSite private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for PipelinePostRequstConfigurationSharePointSite. */ - protected PipelinePostRequstConfigurationSharePointSite() { - super(); - } + protected PipelinePostRequstConfigurationSharePointSite() {} /** * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance and return @@ -193,7 +190,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(name, includePaths, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(name, includePaths, cloudSdkCustomFields); } @Override @@ -201,7 +198,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class PipelinePostRequstConfigurationSharePointSite {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java index ea2bea330..cc736df93 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java index 54f199f03..056809639 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java index 90ad6f02a..bbc9f1293 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java index 87eed29c8..0bf90e361 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java index efb4a6d1b..87f4942a7 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java index e0e49a37f..a31e97150 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java index d1585a4b1..5d406ccf5 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java index 101ca3db6..f5081a7e1 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java index c6f10666f..31ca4da25 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java index fcf8727a4..df27f2c80 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -58,9 +57,7 @@ public class RetrievalSearchFilter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for RetrievalSearchFilter. */ - protected RetrievalSearchFilter() { - super(); - } + protected RetrievalSearchFilter() {} /** * Set the id of this {@link RetrievalSearchFilter} instance and return the same instance. @@ -435,8 +432,7 @@ public int hashCode() { dataRepositoryMetadata, documentMetadata, chunkMetadata, - cloudSdkCustomFields, - super.hashCode()); + cloudSdkCustomFields); } @Override @@ -444,7 +440,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class RetrievalSearchFilter {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" searchConfiguration: ") .append(toIndentedString(searchConfiguration)) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java index 9f6a77bfb..600fbce15 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,9 +42,7 @@ public class RetrievalSearchInput private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for RetrievalSearchInput. */ - protected RetrievalSearchInput() { - super(); - } + protected RetrievalSearchInput() {} /** * Set the query of this {@link RetrievalSearchInput} instance and return the same instance. @@ -179,7 +176,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(query, filters, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(query, filters, cloudSdkCustomFields); } @Override @@ -187,7 +184,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class RetrievalSearchInput {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java index d5d81cb89..570f7fa10 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,9 +39,7 @@ public class SearchConfiguration private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for SearchConfiguration. */ - protected SearchConfiguration() { - super(); - } + protected SearchConfiguration() {} /** * Set the maxChunkCount of this {@link SearchConfiguration} instance and return the same @@ -172,7 +169,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); } @Override @@ -180,7 +177,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class SearchConfiguration {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java index 9f0e66b8a..bbe176ce8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -46,9 +45,7 @@ public class SearchDocumentKeyValueListPair private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for SearchDocumentKeyValueListPair. */ - protected SearchDocumentKeyValueListPair() { - super(); - } + protected SearchDocumentKeyValueListPair() {} /** * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same @@ -238,7 +235,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(key, value, selectMode, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(key, value, selectMode, cloudSdkCustomFields); } @Override @@ -246,7 +243,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class SearchDocumentKeyValueListPair {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java index 9651740d1..7983ade41 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -55,9 +54,7 @@ public class SearchFilter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for SearchFilter. */ - protected SearchFilter() { - super(); - } + protected SearchFilter() {} /** * Set the id of this {@link SearchFilter} instance and return the same instance. @@ -380,8 +377,7 @@ public int hashCode() { collectionMetadata, documentMetadata, chunkMetadata, - cloudSdkCustomFields, - super.hashCode()); + cloudSdkCustomFields); } @Override @@ -389,7 +385,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class SearchFilter {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java index 837783ef5..1bfe81a5c 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java index 447083875..59262938e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java index c23a41cf2..667ee6685 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,9 +42,7 @@ public class TextOnlyBaseChunk private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for TextOnlyBaseChunk. */ - protected TextOnlyBaseChunk() { - super(); - } + protected TextOnlyBaseChunk() {} /** * Set the content of this {@link TextOnlyBaseChunk} instance and return the same instance. @@ -178,7 +175,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(content, metadata, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(content, metadata, cloudSdkCustomFields); } @Override @@ -186,7 +183,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class TextOnlyBaseChunk {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java index 5f94a882f..2a30f5ad7 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -43,9 +42,7 @@ public class TextSearchRequest private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for TextSearchRequest. */ - protected TextSearchRequest() { - super(); - } + protected TextSearchRequest() {} /** * Set the query of this {@link TextSearchRequest} instance and return the same instance. @@ -178,7 +175,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(query, filters, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(query, filters, cloudSdkCustomFields); } @Override @@ -186,7 +183,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class TextSearchRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); cloudSdkCustomFields.forEach( diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java index 7a39e4e26..1076ef6ea 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,8 +13,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** VectorV1VectorEndpointsGetCollectionCreationStatus200Response */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = CollectionCreatedResponse.class), diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java index c9333ee46..ac70f1047 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java @@ -2,7 +2,6 @@ * Document Grounding Pipeline API * SAP AI Core - API Specification AI Data Management api's * - * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,8 +13,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** VectorV1VectorEndpointsGetCollectionDeletionStatus200Response */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = CollectionDeletedResponse.class), From 65f6dca4f24707199baaa7f467450eb9ad1f9fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 5 Feb 2025 10:47:15 +0100 Subject: [PATCH 09/34] Mark the module for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de6578766..8b6fd59bd 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,7 @@ core orchestration + grounding foundation-models/openai @@ -724,7 +725,6 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma - grounding sample-code/spring-app From 939cd79ecb949d3c30236913561aeb9f771c7b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 5 Feb 2025 11:19:06 +0100 Subject: [PATCH 10/34] Extract service and destination to test root --- .../sdk/grounding/GroundingServiceTest.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java index f60241c90..18ffd8c95 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java @@ -1,9 +1,9 @@ package com.sap.ai.sdk.grounding; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; -import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; -import com.github.tomakehurst.wiremock.junit5.WireMockTest; +import com.github.tomakehurst.wiremock.junit5.WireMockExtension; import com.sap.ai.sdk.core.AiCoreService; import com.sap.ai.sdk.grounding.api.PipelinesApi; import com.sap.ai.sdk.grounding.api.RetrievalApi; @@ -19,17 +19,23 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; import java.util.UUID; -import javax.annotation.Nonnull; + import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; -@WireMockTest public class GroundingServiceTest { + @RegisterExtension + private static WireMockExtension WM = WireMockExtension.newInstance() + .options(wireMockConfig().dynamicPort()) + .build(); + + private final HttpDestination DESTINATION = DefaultHttpDestination.builder(WM.baseUrl()).build(); + private final AiCoreService SERVICE = new AiCoreService().withBaseDestination(DESTINATION); + @Test - void testPipelines(@Nonnull final WireMockRuntimeInfo server) { - final HttpDestination dest = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); - final AiCoreService service = new AiCoreService().withBaseDestination(dest); - final PipelinesApi api = GroundingService.create(service).pipelines(); + void testPipelines() { + final PipelinesApi api = GroundingService.create(SERVICE).pipelines(); final Pipelines allPipelines = api.getAllPipelines("reosurceGroup"); assertThat(allPipelines).isNotNull(); @@ -37,10 +43,8 @@ void testPipelines(@Nonnull final WireMockRuntimeInfo server) { } @Test - void testVector(@Nonnull final WireMockRuntimeInfo server) { - final HttpDestination dest = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); - final AiCoreService service = new AiCoreService().withBaseDestination(dest); - final VectorApi api = GroundingService.create(service).vector(); + void testVector() { + final VectorApi api = GroundingService.create(SERVICE).vector(); final CollectionsListResponse collections = api.getAllCollections("reosurceGroup"); assertThat(collections).isNotNull(); @@ -104,10 +108,8 @@ void testVector(@Nonnull final WireMockRuntimeInfo server) { } @Test - void testRetrieval(@Nonnull final WireMockRuntimeInfo server) { - final HttpDestination dest = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); - final AiCoreService service = new AiCoreService().withBaseDestination(dest); - final RetrievalApi api = GroundingService.create(service).retrieval(); + void testRetrieval() { + final RetrievalApi api = GroundingService.create(SERVICE).retrieval(); DataRepositories repositories = api.getDataRepositories("reosurceGroup"); assertThat(repositories).isNotNull(); From 648a0b00af457e644397b62b9830dc55921c353e Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Wed, 5 Feb 2025 10:20:01 +0000 Subject: [PATCH 11/34] Formatting --- .../java/com/sap/ai/sdk/grounding/GroundingServiceTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java index 18ffd8c95..c865c0bd3 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java @@ -19,16 +19,14 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; import java.util.UUID; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; public class GroundingServiceTest { @RegisterExtension - private static WireMockExtension WM = WireMockExtension.newInstance() - .options(wireMockConfig().dynamicPort()) - .build(); + private static WireMockExtension WM = + WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build(); private final HttpDestination DESTINATION = DefaultHttpDestination.builder(WM.baseUrl()).build(); private final AiCoreService SERVICE = new AiCoreService().withBaseDestination(DESTINATION); From 7f2393fee9c2b022e8df6e26ee6b233fd693ad95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 5 Feb 2025 16:56:45 +0100 Subject: [PATCH 12/34] Rename client class --- .../{GroundingService.java => GroundingClient.java} | 10 +++++----- ...undingServiceTest.java => GroundingClientTest.java} | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) rename grounding/src/main/java/com/sap/ai/sdk/grounding/{GroundingService.java => GroundingClient.java} (88%) rename grounding/src/test/java/com/sap/ai/sdk/grounding/{GroundingServiceTest.java => GroundingClientTest.java} (95%) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java similarity index 88% rename from grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java rename to grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java index 8bedbfa6a..b88a476de 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingService.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -16,7 +16,7 @@ */ @Beta @RequiredArgsConstructor(access = AccessLevel.PROTECTED) -public class GroundingService { +public class GroundingClient { final AiCoreService aiCoreService; final String basePath; @@ -29,7 +29,7 @@ public class GroundingService { * @return A new instance of the GroundingService. */ @Nonnull - public static GroundingService create() { + public static GroundingClient create() { return create(new AiCoreService()); } @@ -40,7 +40,7 @@ public static GroundingService create() { * @return A new instance of the GroundingService. */ @Nonnull - public static GroundingService create(@Nonnull final AiCoreService aiCoreService) { + public static GroundingClient create(@Nonnull final AiCoreService aiCoreService) { return create(aiCoreService, DEFAULT_BASE_PATH); } @@ -52,9 +52,9 @@ public static GroundingService create(@Nonnull final AiCoreService aiCoreService * @return A new instance of the GroundingService. */ @Nonnull - public static GroundingService create( + public static GroundingClient create( @Nonnull final AiCoreService aiCoreService, @Nonnull final String basePath) { - return new GroundingService(aiCoreService, basePath); + return new GroundingClient(aiCoreService, basePath); } /** diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java similarity index 95% rename from grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java rename to grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index c865c0bd3..e91f9fdb5 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -public class GroundingServiceTest { +public class GroundingClientTest { @RegisterExtension private static WireMockExtension WM = @@ -33,7 +33,7 @@ public class GroundingServiceTest { @Test void testPipelines() { - final PipelinesApi api = GroundingService.create(SERVICE).pipelines(); + final PipelinesApi api = GroundingClient.create(SERVICE).pipelines(); final Pipelines allPipelines = api.getAllPipelines("reosurceGroup"); assertThat(allPipelines).isNotNull(); @@ -42,7 +42,7 @@ void testPipelines() { @Test void testVector() { - final VectorApi api = GroundingService.create(SERVICE).vector(); + final VectorApi api = GroundingClient.create(SERVICE).vector(); final CollectionsListResponse collections = api.getAllCollections("reosurceGroup"); assertThat(collections).isNotNull(); @@ -107,7 +107,7 @@ void testVector() { @Test void testRetrieval() { - final RetrievalApi api = GroundingService.create(SERVICE).retrieval(); + final RetrievalApi api = GroundingClient.create(SERVICE).retrieval(); DataRepositories repositories = api.getDataRepositories("reosurceGroup"); assertThat(repositories).isNotNull(); From 804428a3016cf262e55b4ed19fd8bb50c98a6b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 6 Feb 2025 14:11:33 +0100 Subject: [PATCH 13/34] add test app controller and unit test --- pom.xml | 5 + sample-code/spring-app/pom.xml | 4 + .../app/controllers/GroundingController.java | 133 ++++++++++++++++++ .../ai/sdk/app/controllers/GroundingTest.java | 113 +++++++++++++++ 4 files changed, 255 insertions(+) create mode 100644 sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java create mode 100644 sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java diff --git a/pom.xml b/pom.xml index 8b6fd59bd..383349a6a 100644 --- a/pom.xml +++ b/pom.xml @@ -197,6 +197,11 @@ orchestration ${project.version} + + com.sap.ai.sdk + grounding + ${project.version} + com.sap.ai.sdk.foundationmodels openai diff --git a/sample-code/spring-app/pom.xml b/sample-code/spring-app/pom.xml index cd4f5f713..d5d6ea6dc 100644 --- a/sample-code/spring-app/pom.xml +++ b/sample-code/spring-app/pom.xml @@ -57,6 +57,10 @@ com.sap.ai.sdk orchestration + + com.sap.ai.sdk + grounding + com.sap.cloud.sdk.cloudplatform cloudplatform-core diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java new file mode 100644 index 000000000..b9ff4ec1d --- /dev/null +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -0,0 +1,133 @@ +package com.sap.ai.sdk.app.controllers; + +import static java.util.stream.Collectors.joining; + +import com.sap.ai.sdk.grounding.GroundingClient; +import com.sap.ai.sdk.grounding.api.PipelinesApi; +import com.sap.ai.sdk.grounding.api.RetrievalApi; +import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.ai.sdk.grounding.model.Collection; +import com.sap.ai.sdk.grounding.model.DataRepository; +import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; +import com.sap.ai.sdk.grounding.model.Pipeline; +import com.sap.ai.sdk.grounding.model.PipelinePostRequst; +import com.sap.ai.sdk.grounding.model.PipelinePostRequstConfiguration; +import com.sap.ai.sdk.grounding.model.PipelinePostRequstConfigurationSharePoint; +import com.sap.ai.sdk.grounding.model.PipelinePostRequstConfigurationSharePointSite; +import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; +import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** Endpoints for AI Core AiDeployment operations */ +@Slf4j +@RestController +@SuppressWarnings("unused") +@RequestMapping("/grounding") +class GroundingController { + + private static final PipelinesApi CLIENT_PIPELINES = GroundingClient.create().pipelines(); + private static final RetrievalApi CLIENT_RETRIEVAL = GroundingClient.create().retrieval(); + private static final VectorApi CLIENT_VECTOR = GroundingClient.create().vector(); + private static final String RESOURCE_GROUP = "default"; + + /** Create and delete a deployment with the Java specific configuration ID. */ + @GetMapping("/pipelines/createDelete") + Object createAndDeletePipeline( + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var config = PipelinePostRequstConfiguration.create().destination("d069462-001").sharePoint( + PipelinePostRequstConfigurationSharePoint.create().site( + PipelinePostRequstConfigurationSharePointSite.create().name("site").addIncludePathsItem("folder"))); + final var req = PipelinePostRequst.create().type("MSSharePoint")._configuration(config); + final var pipeline = CLIENT_PIPELINES.createPipeline(RESOURCE_GROUP, req); + final var del = CLIENT_PIPELINES.deletePipelineById(RESOURCE_GROUP, pipeline.getPipelineId()); + if ("json".equals(format)) { + return pipeline; + } + return ResponseEntity.ok("Pipeline created and deleted."); + } + + /** + * Stop all deployments with the Java specific configuration ID. + * + *

Only RUNNING deployments can be STOPPED + */ + @GetMapping("/pipelines/list") + Object getAllPipelines( + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var pipelines = CLIENT_PIPELINES.getAllPipelines(RESOURCE_GROUP, 10, 0,true); + log.info("Found {} pipelines", pipelines.getResources().size()); + + if ("json".equals(format)) { + return pipelines; + } + final var ids = pipelines.getResources().stream().map(Pipeline::getId).collect(joining(", ")); + return "Found pipelines with ids: " + ids; + } + + /** + * Delete all deployments with the Java specific configuration ID. + * + *

Only UNKNOWN and STOPPED deployments can be DELETED + */ + @GetMapping("/retrieval/repositories") + Object getAllRepositories( + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var repositories = CLIENT_RETRIEVAL.getDataRepositories(RESOURCE_GROUP); + log.info("Found {} data repositories", repositories.getResources().size()); + + if ("json".equals(format)) { + return repositories; + } + final var titles = + repositories.getResources().stream().map(DataRepository::getTitle).collect(joining(", ")); + return "Found repositories with titles: " + titles; + } + + /** Get all deployments with the Java specific configuration ID. */ + @GetMapping("/vector/collections") + Object getAllCollections( + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var collections = CLIENT_VECTOR.getAllCollections(RESOURCE_GROUP); + if ("json".equals(format)) { + return collections; + } + final var items = + collections.getResources().stream().map(Collection::getTitle).collect(joining(", ")); + return "The following collections are available: %s.".formatted(items); + } + + /** Get all deployments, including non-Java specific deployments */ + @GetMapping("/vector/collection/by-id/{id}/documents") + Object getDocumentsByCollectionId( + @Nonnull @PathVariable("id") final UUID collectionId, + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var documents = CLIENT_VECTOR.getAllDocuments(RESOURCE_GROUP, collectionId); + if ("json".equals(format)) { + return documents; + } + final var ids = documents.getResources().stream().map(DocumentWithoutChunks::getId).toList(); + return "The following document ids are available: %s.".formatted(ids); + } + + /** Get all deployments, including non-Java specific deployments */ + @GetMapping("/vector/collection/by-id/{collectionId}/document/by-id/{documentId}") + Object getDocumentChunksById( + @Nonnull @PathVariable("collectionId") final UUID collectionId, + @Nonnull @PathVariable("documentId") final UUID documentId, + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var document = CLIENT_VECTOR.getDocumentById(RESOURCE_GROUP, collectionId, documentId); + if ("json".equals(format)) { + return document; + } + final var ids = document.getChunks().stream().map(TextOnlyBaseChunk::getContent).toList(); + return "The following document ids are available: %s.".formatted(ids); + } +} diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java new file mode 100644 index 000000000..b9c758d0a --- /dev/null +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -0,0 +1,113 @@ +package com.sap.ai.sdk.app.controllers; + +import com.sap.ai.sdk.core.model.AiDeployment; +import com.sap.ai.sdk.core.model.AiDeploymentStatus; +import com.sap.ai.sdk.grounding.model.CollectionsListResponse; +import com.sap.ai.sdk.grounding.model.DataRepositories; +import com.sap.ai.sdk.grounding.model.DocumentResponse; +import com.sap.ai.sdk.grounding.model.Documents; +import com.sap.ai.sdk.grounding.model.PipelineId; +import com.sap.ai.sdk.grounding.model.Pipelines; +import org.junit.jupiter.api.Test; + +import java.util.UUID; + +import static org.assertj.core.api.Assertions.assertThat; + +class GroundingTest { + /** Java end-to-end test specific configuration ID. "name":"config-java-e2e-test" */ + public static final String CONFIG_ID = "67e8d039-c7f1-4179-9f8f-60d158a36b0e"; + private static final String JSON_FORMAT = "json"; + + @Test + void testPipelinesCreateAndDelete() { + final var controller = new GroundingController(); + + final var response = controller.createAndDeletePipeline(JSON_FORMAT); + + assertThat(response).isInstanceOf(PipelineId.class); + assertThat(((PipelineId) response).getPipelineId()).isNotEmpty(); + } + + @Test + void getPipelinesGetAll() { + final var controller = new GroundingController(); + + final var result = controller.getAllPipelines(JSON_FORMAT); + assertThat(result).isInstanceOf(Pipelines.class); + final var pipelinesList = ((Pipelines) result).getResources(); + final var pipelinesCount = ((Pipelines) result).getCount(); + + assertThat(pipelinesCount).isGreaterThan(0); + for (var pipeline : pipelinesList) { + if (pipeline.getType() == "foo") { + } + } + } + + @Test + void getRepositoriesGetAll() { + final var controller = new GroundingController(); + + final var result = controller.getAllRepositories(JSON_FORMAT); + assertThat(result).isInstanceOf(DataRepositories.class); + final var repositoryList = ((DataRepositories) result).getResources(); + final var repositoryCount = ((DataRepositories) result).getCount(); + + assertThat(repositoryCount).isGreaterThan(0); + for (var repository : repositoryList) { + assertThat(repository.getId()).isNotNull(); + assertThat(repository.getTitle()).isNotNull(); + } + } + + @Test + void getCollectionsGetAll() { + final var controller = new GroundingController(); + + final var result = controller.getAllCollections(JSON_FORMAT); + assertThat(result).isInstanceOf(CollectionsListResponse.class); + final var collectionsList = ((CollectionsListResponse) result).getResources(); + final var collectionsCount = ((CollectionsListResponse) result).getCount(); + + assertThat(collectionsCount).isGreaterThan(0); + for (var collection : collectionsList) { + assertThat(collection.getId()).isNotNull(); + assertThat(collection.getTitle()).isNotEmpty(); + assertThat(collection.getEmbeddingConfig()).isNotNull(); + assertThat(collection.getEmbeddingConfig().getModelName()).isNotNull(); + } + } + + @Test + void testGetDocuments() { + final var controller = new GroundingController(); + + UUID collectionId = UUID.fromString("6ebdb977-f9f8-4200-8849-6559b4cff311"); + final var result = controller.getDocumentsByCollectionId(collectionId, JSON_FORMAT); + assertThat(result).isInstanceOf(Documents.class); + final var documentsList = ((Documents) result).getResources(); + final var documentsCount = ((Documents) result).getCount(); + + assertThat(documentsCount).isGreaterThan(0); + for (var document : documentsList) { + assertThat(document.getId()).isNotNull(); + } + } + @Test + void testGetDocumentById() { + final var controller = new GroundingController(); + + UUID collectionId = UUID.fromString("6ebdb977-f9f8-4200-8849-6559b4cff311"); + UUID documentId = UUID.fromString("500d1e93-270e-479e-abbd-83a2291e4f6d"); + final var result = controller.getDocumentChunksById(collectionId, documentId, JSON_FORMAT); + assertThat(result).isInstanceOf(DocumentResponse.class); + final var chunks = ((DocumentResponse) result).getChunks(); + + assertThat(chunks).isNotEmpty(); + for (var chunk : chunks) { + assertThat(chunk.getContent()).isNotEmpty(); + assertThat(chunk.getMetadata()).isNotNull().isNotEmpty(); + } + } +} From 2806fdfd26e34d0bb362b9b75e24d388169cf86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 12 Feb 2025 09:42:50 +0100 Subject: [PATCH 14/34] format --- .../app/controllers/GroundingController.java | 14 +++++++---- .../ai/sdk/app/controllers/GroundingTest.java | 23 ++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index b9ff4ec1d..fda19e4eb 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -42,9 +42,15 @@ class GroundingController { @GetMapping("/pipelines/createDelete") Object createAndDeletePipeline( @Nullable @RequestParam(value = "format", required = false) final String format) { - final var config = PipelinePostRequstConfiguration.create().destination("d069462-001").sharePoint( - PipelinePostRequstConfigurationSharePoint.create().site( - PipelinePostRequstConfigurationSharePointSite.create().name("site").addIncludePathsItem("folder"))); + final var config = + PipelinePostRequstConfiguration.create() + .destination("d069462-001") + .sharePoint( + PipelinePostRequstConfigurationSharePoint.create() + .site( + PipelinePostRequstConfigurationSharePointSite.create() + .name("site") + .addIncludePathsItem("folder"))); final var req = PipelinePostRequst.create().type("MSSharePoint")._configuration(config); final var pipeline = CLIENT_PIPELINES.createPipeline(RESOURCE_GROUP, req); final var del = CLIENT_PIPELINES.deletePipelineById(RESOURCE_GROUP, pipeline.getPipelineId()); @@ -62,7 +68,7 @@ Object createAndDeletePipeline( @GetMapping("/pipelines/list") Object getAllPipelines( @Nullable @RequestParam(value = "format", required = false) final String format) { - final var pipelines = CLIENT_PIPELINES.getAllPipelines(RESOURCE_GROUP, 10, 0,true); + final var pipelines = CLIENT_PIPELINES.getAllPipelines(RESOURCE_GROUP, 10, 0, true); log.info("Found {} pipelines", pipelines.getResources().size()); if ("json".equals(format)) { diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index b9c758d0a..a6fc508f0 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -1,22 +1,20 @@ package com.sap.ai.sdk.app.controllers; -import com.sap.ai.sdk.core.model.AiDeployment; -import com.sap.ai.sdk.core.model.AiDeploymentStatus; +import static org.assertj.core.api.Assertions.assertThat; + import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DocumentResponse; import com.sap.ai.sdk.grounding.model.Documents; import com.sap.ai.sdk.grounding.model.PipelineId; import com.sap.ai.sdk.grounding.model.Pipelines; -import org.junit.jupiter.api.Test; - import java.util.UUID; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; class GroundingTest { /** Java end-to-end test specific configuration ID. "name":"config-java-e2e-test" */ public static final String CONFIG_ID = "67e8d039-c7f1-4179-9f8f-60d158a36b0e"; + private static final String JSON_FORMAT = "json"; @Test @@ -38,11 +36,9 @@ void getPipelinesGetAll() { final var pipelinesList = ((Pipelines) result).getResources(); final var pipelinesCount = ((Pipelines) result).getCount(); - assertThat(pipelinesCount).isGreaterThan(0); - for (var pipeline : pipelinesList) { - if (pipeline.getType() == "foo") { - } - } + // we don't have testable data yet, but the endpoint works without errors + assertThat(pipelinesCount).isEqualTo(0); + assertThat(pipelinesList).isEmpty(); } @Test @@ -56,8 +52,8 @@ void getRepositoriesGetAll() { assertThat(repositoryCount).isGreaterThan(0); for (var repository : repositoryList) { - assertThat(repository.getId()).isNotNull(); - assertThat(repository.getTitle()).isNotNull(); + assertThat(repository.getId()).isNotNull(); + assertThat(repository.getTitle()).isNotNull(); } } @@ -94,6 +90,7 @@ void testGetDocuments() { assertThat(document.getId()).isNotNull(); } } + @Test void testGetDocumentById() { final var controller = new GroundingController(); From 2987e92b46c4656a077e035e64c1dda8eed09c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 13 Feb 2025 11:13:27 +0100 Subject: [PATCH 15/34] Remove Beta annotation on client --- .../src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java index b88a476de..74283447e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -14,7 +14,6 @@ * * @since 1.3.0 */ -@Beta @RequiredArgsConstructor(access = AccessLevel.PROTECTED) public class GroundingClient { From affa19294c48ce7caa6b0ef887b5b4b26350ccb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Thu, 13 Feb 2025 11:15:20 +0100 Subject: [PATCH 16/34] Fix E2E tests --- .../sap/ai/sdk/grounding/GroundingClient.java | 1 - .../app/controllers/GroundingController.java | 27 ------------------- .../ai/sdk/app/controllers/GroundingTest.java | 11 -------- 3 files changed, 39 deletions(-) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java index 74283447e..6b5764bee 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -1,6 +1,5 @@ package com.sap.ai.sdk.grounding; -import com.google.common.annotations.Beta; import com.sap.ai.sdk.core.AiCoreService; import com.sap.ai.sdk.grounding.api.PipelinesApi; import com.sap.ai.sdk.grounding.api.RetrievalApi; diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index fda19e4eb..3b07af01a 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -10,16 +10,11 @@ import com.sap.ai.sdk.grounding.model.DataRepository; import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; import com.sap.ai.sdk.grounding.model.Pipeline; -import com.sap.ai.sdk.grounding.model.PipelinePostRequst; -import com.sap.ai.sdk.grounding.model.PipelinePostRequstConfiguration; -import com.sap.ai.sdk.grounding.model.PipelinePostRequstConfigurationSharePoint; -import com.sap.ai.sdk.grounding.model.PipelinePostRequstConfigurationSharePointSite; import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; import java.util.UUID; import javax.annotation.Nonnull; import javax.annotation.Nullable; import lombok.extern.slf4j.Slf4j; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -38,28 +33,6 @@ class GroundingController { private static final VectorApi CLIENT_VECTOR = GroundingClient.create().vector(); private static final String RESOURCE_GROUP = "default"; - /** Create and delete a deployment with the Java specific configuration ID. */ - @GetMapping("/pipelines/createDelete") - Object createAndDeletePipeline( - @Nullable @RequestParam(value = "format", required = false) final String format) { - final var config = - PipelinePostRequstConfiguration.create() - .destination("d069462-001") - .sharePoint( - PipelinePostRequstConfigurationSharePoint.create() - .site( - PipelinePostRequstConfigurationSharePointSite.create() - .name("site") - .addIncludePathsItem("folder"))); - final var req = PipelinePostRequst.create().type("MSSharePoint")._configuration(config); - final var pipeline = CLIENT_PIPELINES.createPipeline(RESOURCE_GROUP, req); - final var del = CLIENT_PIPELINES.deletePipelineById(RESOURCE_GROUP, pipeline.getPipelineId()); - if ("json".equals(format)) { - return pipeline; - } - return ResponseEntity.ok("Pipeline created and deleted."); - } - /** * Stop all deployments with the Java specific configuration ID. * diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index a6fc508f0..8f658a3a9 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -6,7 +6,6 @@ import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DocumentResponse; import com.sap.ai.sdk.grounding.model.Documents; -import com.sap.ai.sdk.grounding.model.PipelineId; import com.sap.ai.sdk.grounding.model.Pipelines; import java.util.UUID; import org.junit.jupiter.api.Test; @@ -17,16 +16,6 @@ class GroundingTest { private static final String JSON_FORMAT = "json"; - @Test - void testPipelinesCreateAndDelete() { - final var controller = new GroundingController(); - - final var response = controller.createAndDeletePipeline(JSON_FORMAT); - - assertThat(response).isInstanceOf(PipelineId.class); - assertThat(((PipelineId) response).getPipelineId()).isNotEmpty(); - } - @Test void getPipelinesGetAll() { final var controller = new GroundingController(); From dcad8a1323e3af88b830f2090974c5e32128bdfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 14 Feb 2025 17:12:03 +0100 Subject: [PATCH 17/34] Add extended test case for documents --- .../app/controllers/GroundingController.java | 113 +++++++++++++++++- .../ai/sdk/app/controllers/GroundingTest.java | 66 ++++++++++ 2 files changed, 178 insertions(+), 1 deletion(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 3b07af01a..bef77ce26 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -1,16 +1,33 @@ package com.sap.ai.sdk.app.controllers; +import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.TEXT_EMBEDDING_ADA_002; +import static java.time.LocalDate.now; import static java.util.stream.Collectors.joining; import com.sap.ai.sdk.grounding.GroundingClient; import com.sap.ai.sdk.grounding.api.PipelinesApi; import com.sap.ai.sdk.grounding.api.RetrievalApi; import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.ai.sdk.grounding.model.BaseDocument; import com.sap.ai.sdk.grounding.model.Collection; +import com.sap.ai.sdk.grounding.model.CollectionRequest; import com.sap.ai.sdk.grounding.model.DataRepository; +import com.sap.ai.sdk.grounding.model.DataRepositoryType; +import com.sap.ai.sdk.grounding.model.DocumentCreateRequest; +import com.sap.ai.sdk.grounding.model.DocumentKeyValueListPair; import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; +import com.sap.ai.sdk.grounding.model.EmbeddingConfig; +import com.sap.ai.sdk.grounding.model.KeyValueListPair; import com.sap.ai.sdk.grounding.model.Pipeline; +import com.sap.ai.sdk.grounding.model.ResultsInner1; +import com.sap.ai.sdk.grounding.model.RetrievalSearchFilter; +import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; +import com.sap.ai.sdk.grounding.model.SearchConfiguration; import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; +import java.time.format.TextStyle; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.UUID; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -31,7 +48,7 @@ class GroundingController { private static final PipelinesApi CLIENT_PIPELINES = GroundingClient.create().pipelines(); private static final RetrievalApi CLIENT_RETRIEVAL = GroundingClient.create().retrieval(); private static final VectorApi CLIENT_VECTOR = GroundingClient.create().vector(); - private static final String RESOURCE_GROUP = "default"; + private static final String RESOURCE_GROUP = "ai-sdk-java-e2e"; /** * Stop all deployments with the Java specific configuration ID. @@ -70,6 +87,30 @@ Object getAllRepositories( return "Found repositories with titles: " + titles; } + /** + * Delete all deployments with the Java specific configuration ID. + * + *

Only UNKNOWN and STOPPED deployments can be DELETED + */ + @GetMapping("/retrieval/repositories") + Object searchInDocuments( + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var filter = + RetrievalSearchFilter.create() + .id("question") + .dataRepositoryType(DataRepositoryType.VECTOR) + .dataRepositories(List.of("*")) + .searchConfiguration(SearchConfiguration.create().maxChunkCount(10)); + final var q = RetrievalSearchInput.create().query("When was the last upload?").filters(filter); + final var results = CLIENT_RETRIEVAL.search(RESOURCE_GROUP, q); + + if ("json".equals(format)) { + return results; + } + final var messages = results.getResults().stream().map(ResultsInner1::getMessage).toList(); + return "Found the following response(s): " + messages; + } + /** Get all deployments with the Java specific configuration ID. */ @GetMapping("/vector/collections") Object getAllCollections( @@ -96,6 +137,76 @@ Object getDocumentsByCollectionId( return "The following document ids are available: %s.".formatted(ids); } + /** Get all deployments, including non-Java specific deployments */ + @GetMapping("/vector/collection/create") + String createCollection( + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var embeddingConfig = EmbeddingConfig.create().modelName(TEXT_EMBEDDING_ADA_002.name()); + final var request = CollectionRequest.create().embeddingConfig(embeddingConfig).title("e2e"); + final var documents = CLIENT_VECTOR.createCollection(RESOURCE_GROUP, request); + final Map> headers = documents.getHeaders(); + + final var locationHeader = headers.get("Location").get(0); + return locationHeader.replaceAll("^.*?/([a-f0-9-]+)/.*?$", "$1"); + } + + /** Get all deployments, including non-Java specific deployments */ + @GetMapping("/vector/collection/by-id/{id}/day") + Object createDocument( + @Nonnull @PathVariable("id") final UUID collectionId, + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); + ; + final var documentContent = "Last upload on " + dayOfWeek; + + final var chunkMeta = KeyValueListPair.create().key("context").value("day-of-week"); + final var chunk = TextOnlyBaseChunk.create().content(documentContent).metadata(chunkMeta); + final var docMeta = DocumentKeyValueListPair.create().key("purpose").value("testing"); + final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); + final var request = DocumentCreateRequest.create().documents(doc); + final var response = CLIENT_VECTOR.createDocuments(RESOURCE_GROUP, collectionId, request); + + if ("json".equals(format)) { + return response; + } + final var ids = response.getDocuments().stream().map(DocumentWithoutChunks::getId).toList(); + return "The following document ids are available: %s.".formatted(ids); + } + + /** Get all deployments, including non-Java specific deployments */ + @GetMapping("/vector/collection/by-id/{id}/clear") + Object deleteDocuments( + @Nonnull @PathVariable("id") final UUID collectionId, + @Nullable @RequestParam(value = "format", required = false) final String format) { + final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); + ; + final var chunkMeta = KeyValueListPair.create().key("context").value("day-of-week"); + final var chunk = + TextOnlyBaseChunk.create().content("Today is " + dayOfWeek).metadata(chunkMeta); + final var docMeta = DocumentKeyValueListPair.create().key("purpose").value("testing"); + final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); + final var request = DocumentCreateRequest.create().documents(doc); + + final var documents = CLIENT_VECTOR.getAllDocuments(RESOURCE_GROUP, collectionId); + final var ids = documents.getResources().stream().map(DocumentWithoutChunks::getId).toList(); + log.info("Deleting collection {} with {} documents: {}", collectionId, ids.size(), ids); + + for (UUID documentId : ids) { + final var del = CLIENT_VECTOR.deleteDocumentById(RESOURCE_GROUP, collectionId, documentId); + if (del.getStatusCode() >= 400) { + final var msg = "Document {} could not be deleted, status code [{}], headers: "; + log.error(msg, documentId, del.getStatusCode(), del.getHeaders()); + throw new IllegalStateException("Document deletion failed for id " + documentId); + } + } + final var response = CLIENT_VECTOR.deleteCollectionById(RESOURCE_GROUP, collectionId + ""); + + if ("json".equals(format)) { + return response; + } + return response.getStatusCode() >= 400 ? "Failed to delete collection" : "Deletion successful"; + } + /** Get all deployments, including non-Java specific deployments */ @GetMapping("/vector/collection/by-id/{collectionId}/document/by-id/{documentId}") Object getDocumentChunksById( diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index 8f658a3a9..a64c7113f 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -1,12 +1,19 @@ package com.sap.ai.sdk.app.controllers; +import static java.time.LocalDate.now; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DocumentResponse; import com.sap.ai.sdk.grounding.model.Documents; +import com.sap.ai.sdk.grounding.model.DocumentsListResponse; import com.sap.ai.sdk.grounding.model.Pipelines; +import com.sap.ai.sdk.grounding.model.RetievalSearchResults; +import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; +import java.time.format.TextStyle; +import java.util.Locale; import java.util.UUID; import org.junit.jupiter.api.Test; @@ -80,6 +87,65 @@ void testGetDocuments() { } } + @Test + void testCreateDeleteCollection() { + final var controller = new GroundingController(); + + // (1) CREATE COLLECTION + final var collectionId = controller.createCollection(JSON_FORMAT); + final var collectionUuid = UUID.fromString(collectionId); + assertThat(collectionId).isNotNull(); + + // (2) SANITY CHECK: NO DOCUMENTS + final var documentsEmpty = controller.getDocumentsByCollectionId(collectionUuid, JSON_FORMAT); + assertThat(documentsEmpty).isInstanceOf(Documents.class); + assertThat(((Documents) documentsEmpty).getCount()).isEqualTo(0); + assertThat(((Documents) documentsEmpty).getResources()).isNotNull().isEmpty(); + + // (3) UPLOAD A DOCUMENT + final var documentCreated = controller.createDocument(collectionUuid, JSON_FORMAT); + assertThat(documentCreated).isInstanceOf(DocumentsListResponse.class); + assertThat(((DocumentsListResponse) documentCreated).getDocuments()).isNotNull().hasSize(1); + + // (4) SEARCH FOR DOCUMENTS + Object search = controller.searchInDocuments(JSON_FORMAT); + final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); + + assertThat(search).isInstanceOf(RetievalSearchResults.class); + assertThat(((RetievalSearchResults) search).getResults()) + .isNotNull() + .isNotEmpty() + .allSatisfy( + r -> + assertThat(r.getResults()) + .isNotNull() + .isNotEmpty() + .allSatisfy( + doc -> + assertThat(doc.getDataRepository().getDocuments()) + .isNotNull() + .isNotEmpty() + .allSatisfy( + m -> + assertThat(m.getChunks()) + .isNotNull() + .isNotEmpty() + .allSatisfy( + chunk -> + assertThat(chunk.getContent()) + .isNotNull() + .contains(dayOfWeek))))); + + // (5) DELETE COLLECTION + Object deletion = controller.deleteDocuments(collectionUuid, JSON_FORMAT); + assertThat(deletion).isInstanceOf(OpenApiResponse.class); + assertThat(((OpenApiResponse) deletion).getStatusCode()).isEqualTo(202); + + // (6) SANITY CHECK: NO COLLECTION + assertThatThrownBy(() -> controller.getDocumentsByCollectionId(collectionUuid, JSON_FORMAT)) + .hasMessageContaining("404 Not Found"); + } + @Test void testGetDocumentById() { final var controller = new GroundingController(); From f9b8ab074ca5be76503f8bbb971c82ad1907abd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 14 Feb 2025 17:35:59 +0100 Subject: [PATCH 18/34] Update tests --- .../ai/sdk/app/controllers/GroundingTest.java | 113 ++++++++---------- 1 file changed, 47 insertions(+), 66 deletions(-) diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index a64c7113f..c16031a29 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -53,40 +53,6 @@ void getRepositoriesGetAll() { } } - @Test - void getCollectionsGetAll() { - final var controller = new GroundingController(); - - final var result = controller.getAllCollections(JSON_FORMAT); - assertThat(result).isInstanceOf(CollectionsListResponse.class); - final var collectionsList = ((CollectionsListResponse) result).getResources(); - final var collectionsCount = ((CollectionsListResponse) result).getCount(); - - assertThat(collectionsCount).isGreaterThan(0); - for (var collection : collectionsList) { - assertThat(collection.getId()).isNotNull(); - assertThat(collection.getTitle()).isNotEmpty(); - assertThat(collection.getEmbeddingConfig()).isNotNull(); - assertThat(collection.getEmbeddingConfig().getModelName()).isNotNull(); - } - } - - @Test - void testGetDocuments() { - final var controller = new GroundingController(); - - UUID collectionId = UUID.fromString("6ebdb977-f9f8-4200-8849-6559b4cff311"); - final var result = controller.getDocumentsByCollectionId(collectionId, JSON_FORMAT); - assertThat(result).isInstanceOf(Documents.class); - final var documentsList = ((Documents) result).getResources(); - final var documentsCount = ((Documents) result).getCount(); - - assertThat(documentsCount).isGreaterThan(0); - for (var document : documentsList) { - assertThat(document.getId()).isNotNull(); - } - } - @Test void testCreateDeleteCollection() { final var controller = new GroundingController(); @@ -96,6 +62,9 @@ void testCreateDeleteCollection() { final var collectionUuid = UUID.fromString(collectionId); assertThat(collectionId).isNotNull(); + // (1.1) TEST COLLECTION LOOKUP + this.testCollectionsGetAll(); + // (2) SANITY CHECK: NO DOCUMENTS final var documentsEmpty = controller.getDocumentsByCollectionId(collectionUuid, JSON_FORMAT); assertThat(documentsEmpty).isInstanceOf(Documents.class); @@ -103,38 +72,19 @@ void testCreateDeleteCollection() { assertThat(((Documents) documentsEmpty).getResources()).isNotNull().isEmpty(); // (3) UPLOAD A DOCUMENT - final var documentCreated = controller.createDocument(collectionUuid, JSON_FORMAT); - assertThat(documentCreated).isInstanceOf(DocumentsListResponse.class); - assertThat(((DocumentsListResponse) documentCreated).getDocuments()).isNotNull().hasSize(1); + final var documentsCreated = controller.createDocument(collectionUuid, JSON_FORMAT); + assertThat(documentsCreated).isInstanceOf(DocumentsListResponse.class); + final var document = ((DocumentsListResponse) documentsCreated).getDocuments(); + assertThat(document).isNotNull().hasSize(1); + + // (3.1) TEST DOCUMENT LOOKUP + this.testGetDocumentById(collectionUuid, document.get(0).getId()); // (4) SEARCH FOR DOCUMENTS Object search = controller.searchInDocuments(JSON_FORMAT); - final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - assertThat(search).isInstanceOf(RetievalSearchResults.class); - assertThat(((RetievalSearchResults) search).getResults()) - .isNotNull() - .isNotEmpty() - .allSatisfy( - r -> - assertThat(r.getResults()) - .isNotNull() - .isNotEmpty() - .allSatisfy( - doc -> - assertThat(doc.getDataRepository().getDocuments()) - .isNotNull() - .isNotEmpty() - .allSatisfy( - m -> - assertThat(m.getChunks()) - .isNotNull() - .isNotEmpty() - .allSatisfy( - chunk -> - assertThat(chunk.getContent()) - .isNotNull() - .contains(dayOfWeek))))); + final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); + this.assertDocumentSearchResult((RetievalSearchResults) search, dayOfWeek); // (5) DELETE COLLECTION Object deletion = controller.deleteDocuments(collectionUuid, JSON_FORMAT); @@ -146,12 +96,43 @@ void testCreateDeleteCollection() { .hasMessageContaining("404 Not Found"); } - @Test - void testGetDocumentById() { + private void assertDocumentSearchResult(RetievalSearchResults search, String dayOfWeek) { + assertThat(search.getResults()).isNotEmpty(); + for (var resultsByFilter : search.getResults()) { + assertThat(resultsByFilter.getFilterId()).isEqualTo("question"); + assertThat(resultsByFilter.getResults()).isNotEmpty(); + for (var result : resultsByFilter.getResults()) { + assertThat(result.getDataRepository().getDocuments()).isNotEmpty(); + for (var document : result.getDataRepository().getDocuments()) { + assertThat(document.getChunks()).isNotEmpty(); + for (var chunk : document.getChunks()) { + assertThat(chunk.getContent()).contains(dayOfWeek); + } + } + } + } + } + + void testCollectionsGetAll() { + final var controller = new GroundingController(); + + final var result = controller.getAllCollections(JSON_FORMAT); + assertThat(result).isInstanceOf(CollectionsListResponse.class); + final var collectionsList = ((CollectionsListResponse) result).getResources(); + final var collectionsCount = ((CollectionsListResponse) result).getCount(); + + assertThat(collectionsCount).isGreaterThan(0); + for (var collection : collectionsList) { + assertThat(collection.getId()).isNotNull(); + assertThat(collection.getTitle()).isNotEmpty(); + assertThat(collection.getEmbeddingConfig()).isNotNull(); + assertThat(collection.getEmbeddingConfig().getModelName()).isNotNull(); + } + } + + void testGetDocumentById(UUID collectionId, UUID documentId) { final var controller = new GroundingController(); - UUID collectionId = UUID.fromString("6ebdb977-f9f8-4200-8849-6559b4cff311"); - UUID documentId = UUID.fromString("500d1e93-270e-479e-abbd-83a2291e4f6d"); final var result = controller.getDocumentChunksById(collectionId, documentId, JSON_FORMAT); assertThat(result).isInstanceOf(DocumentResponse.class); final var chunks = ((DocumentResponse) result).getChunks(); From 0a2ce03d554d64b5f4a7f222fcc22d76c798e15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 14 Feb 2025 17:46:06 +0100 Subject: [PATCH 19/34] Format, Syntax, checks --- grounding/pom.xml | 2 +- sample-code/spring-app/pom.xml | 4 ++++ .../sdk/app/controllers/GroundingController.java | 6 +++--- .../sap/ai/sdk/app/controllers/GroundingTest.java | 14 +++++++------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/grounding/pom.xml b/grounding/pom.xml index 3ae2ff1a6..a7667fe7b 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -4,7 +4,7 @@ com.sap.ai.sdk sdk-parent - 1.3.0-SNAPSHOT + 1.4.0-SNAPSHOT grounding Grounding client diff --git a/sample-code/spring-app/pom.xml b/sample-code/spring-app/pom.xml index 2d27c3fd8..c0b80c827 100644 --- a/sample-code/spring-app/pom.xml +++ b/sample-code/spring-app/pom.xml @@ -65,6 +65,10 @@ com.sap.cloud.sdk.cloudplatform cloudplatform-core + + com.sap.cloud.sdk.datamodel + openapi-core + org.springframework.ai spring-ai-core diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index bef77ce26..45a6fdd92 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -92,7 +92,7 @@ Object getAllRepositories( * *

Only UNKNOWN and STOPPED deployments can be DELETED */ - @GetMapping("/retrieval/repositories") + @GetMapping("/retrieval/search") Object searchInDocuments( @Nullable @RequestParam(value = "format", required = false) final String format) { final var filter = @@ -191,10 +191,10 @@ Object deleteDocuments( final var ids = documents.getResources().stream().map(DocumentWithoutChunks::getId).toList(); log.info("Deleting collection {} with {} documents: {}", collectionId, ids.size(), ids); - for (UUID documentId : ids) { + for (final var documentId : ids) { final var del = CLIENT_VECTOR.deleteDocumentById(RESOURCE_GROUP, collectionId, documentId); if (del.getStatusCode() >= 400) { - final var msg = "Document {} could not be deleted, status code [{}], headers: "; + final var msg = "Document {} could not be deleted, status code [{}], headers: {}"; log.error(msg, documentId, del.getStatusCode(), del.getHeaders()); throw new IllegalStateException("Document deletion failed for id " + documentId); } diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index c16031a29..25e11cd67 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -47,7 +47,7 @@ void getRepositoriesGetAll() { final var repositoryCount = ((DataRepositories) result).getCount(); assertThat(repositoryCount).isGreaterThan(0); - for (var repository : repositoryList) { + for (final var repository : repositoryList) { assertThat(repository.getId()).isNotNull(); assertThat(repository.getTitle()).isNotNull(); } @@ -98,14 +98,14 @@ void testCreateDeleteCollection() { private void assertDocumentSearchResult(RetievalSearchResults search, String dayOfWeek) { assertThat(search.getResults()).isNotEmpty(); - for (var resultsByFilter : search.getResults()) { + for (final var resultsByFilter : search.getResults()) { assertThat(resultsByFilter.getFilterId()).isEqualTo("question"); assertThat(resultsByFilter.getResults()).isNotEmpty(); - for (var result : resultsByFilter.getResults()) { + for (final var result : resultsByFilter.getResults()) { assertThat(result.getDataRepository().getDocuments()).isNotEmpty(); - for (var document : result.getDataRepository().getDocuments()) { + for (final var document : result.getDataRepository().getDocuments()) { assertThat(document.getChunks()).isNotEmpty(); - for (var chunk : document.getChunks()) { + for (final var chunk : document.getChunks()) { assertThat(chunk.getContent()).contains(dayOfWeek); } } @@ -122,7 +122,7 @@ void testCollectionsGetAll() { final var collectionsCount = ((CollectionsListResponse) result).getCount(); assertThat(collectionsCount).isGreaterThan(0); - for (var collection : collectionsList) { + for (final var collection : collectionsList) { assertThat(collection.getId()).isNotNull(); assertThat(collection.getTitle()).isNotEmpty(); assertThat(collection.getEmbeddingConfig()).isNotNull(); @@ -138,7 +138,7 @@ void testGetDocumentById(UUID collectionId, UUID documentId) { final var chunks = ((DocumentResponse) result).getChunks(); assertThat(chunks).isNotEmpty(); - for (var chunk : chunks) { + for (final var chunk : chunks) { assertThat(chunk.getContent()).isNotEmpty(); assertThat(chunk.getMetadata()).isNotNull().isNotEmpty(); } From 1bda8134bb29fb398bc8eb83ec85d39bb7ba6f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 14 Feb 2025 18:02:36 +0100 Subject: [PATCH 20/34] Add some frontend links --- .../src/main/resources/static/index.html | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/sample-code/spring-app/src/main/resources/static/index.html b/sample-code/spring-app/src/main/resources/static/index.html index 8f816ffe9..fe99bcdd3 100644 --- a/sample-code/spring-app/src/main/resources/static/index.html +++ b/sample-code/spring-app/src/main/resources/static/index.html @@ -213,6 +213,43 @@

Configurations
+
+
Grounding
+ From 08810c1bc0652d91af342b7e50783258f534da12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 14 Feb 2025 18:09:07 +0100 Subject: [PATCH 21/34] Migrate from public static factory method to constructor --- .../sap/ai/sdk/grounding/GroundingClient.java | 51 +++++++------------ .../ai/sdk/grounding/GroundingClientTest.java | 6 +-- .../app/controllers/GroundingController.java | 6 +-- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java index 6b5764bee..28f858c6b 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -6,53 +6,36 @@ import com.sap.ai.sdk.grounding.api.VectorApi; import javax.annotation.Nonnull; import lombok.AccessLevel; +import lombok.Getter; import lombok.RequiredArgsConstructor; +import lombok.experimental.Tolerate; /** * Service class for the Grounding APIs. * * @since 1.3.0 */ -@RequiredArgsConstructor(access = AccessLevel.PROTECTED) +@RequiredArgsConstructor(access = AccessLevel.PUBLIC) +@Getter(value = AccessLevel.PROTECTED) public class GroundingClient { - - final AiCoreService aiCoreService; - final String basePath; + @Nonnull private final AiCoreService service; + @Nonnull private final String basePath; static final String DEFAULT_BASE_PATH = "lm/document-grounding/"; - /** - * Create a new instance of the GroundingService. - * - * @return A new instance of the GroundingService. - */ - @Nonnull - public static GroundingClient create() { - return create(new AiCoreService()); - } - - /** - * Create a new instance of the GroundingService. - * - * @param aiCoreService The AiCoreService instance to use. - * @return A new instance of the GroundingService. - */ - @Nonnull - public static GroundingClient create(@Nonnull final AiCoreService aiCoreService) { - return create(aiCoreService, DEFAULT_BASE_PATH); + /** Default constructor. */ + @Tolerate + public GroundingClient() { + this(new AiCoreService()); } /** - * Create a new instance of the GroundingService. + * Constructor with custom AI Core service instance. * - * @param aiCoreService The AiCoreService instance to use. - * @param basePath The base path to use for the API calls. - * @return A new instance of the GroundingService. + * @param service The instance of AI Core service */ - @Nonnull - public static GroundingClient create( - @Nonnull final AiCoreService aiCoreService, @Nonnull final String basePath) { - return new GroundingClient(aiCoreService, basePath); + public GroundingClient(final @Nonnull AiCoreService service) { + this(service, DEFAULT_BASE_PATH); } /** @@ -62,7 +45,7 @@ public static GroundingClient create( */ @Nonnull public PipelinesApi pipelines() { - return new PipelinesApi(aiCoreService.getApiClient().setBasePath(basePath)); + return new PipelinesApi(getService().getApiClient().setBasePath(getBasePath())); } /** @@ -72,7 +55,7 @@ public PipelinesApi pipelines() { */ @Nonnull public VectorApi vector() { - return new VectorApi(aiCoreService.getApiClient().setBasePath(basePath)); + return new VectorApi(getService().getApiClient().setBasePath(getBasePath())); } /** @@ -82,6 +65,6 @@ public VectorApi vector() { */ @Nonnull public RetrievalApi retrieval() { - return new RetrievalApi(aiCoreService.getApiClient().setBasePath(basePath)); + return new RetrievalApi(getService().getApiClient().setBasePath(getBasePath())); } } diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index e91f9fdb5..e5bd8ba97 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -33,7 +33,7 @@ public class GroundingClientTest { @Test void testPipelines() { - final PipelinesApi api = GroundingClient.create(SERVICE).pipelines(); + final PipelinesApi api = new GroundingClient(SERVICE).pipelines(); final Pipelines allPipelines = api.getAllPipelines("reosurceGroup"); assertThat(allPipelines).isNotNull(); @@ -42,7 +42,7 @@ void testPipelines() { @Test void testVector() { - final VectorApi api = GroundingClient.create(SERVICE).vector(); + final VectorApi api = new GroundingClient(SERVICE).vector(); final CollectionsListResponse collections = api.getAllCollections("reosurceGroup"); assertThat(collections).isNotNull(); @@ -107,7 +107,7 @@ void testVector() { @Test void testRetrieval() { - final RetrievalApi api = GroundingClient.create(SERVICE).retrieval(); + final RetrievalApi api = new GroundingClient(SERVICE).retrieval(); DataRepositories repositories = api.getDataRepositories("reosurceGroup"); assertThat(repositories).isNotNull(); diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 45a6fdd92..7cdbe0514 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -45,9 +45,9 @@ @RequestMapping("/grounding") class GroundingController { - private static final PipelinesApi CLIENT_PIPELINES = GroundingClient.create().pipelines(); - private static final RetrievalApi CLIENT_RETRIEVAL = GroundingClient.create().retrieval(); - private static final VectorApi CLIENT_VECTOR = GroundingClient.create().vector(); + private static final PipelinesApi CLIENT_PIPELINES = new GroundingClient().pipelines(); + private static final RetrievalApi CLIENT_RETRIEVAL = new GroundingClient().retrieval(); + private static final VectorApi CLIENT_VECTOR = new GroundingClient().vector(); private static final String RESOURCE_GROUP = "ai-sdk-java-e2e"; /** From eb7a00ab50d6ad45870d94d5738ff6e4a6839330 Mon Sep 17 00:00:00 2001 From: I538344 Date: Mon, 17 Feb 2025 12:49:24 +0100 Subject: [PATCH 22/34] small changes --- .../app/controllers/GroundingController.java | 2 - .../src/main/resources/static/grounding.png | Bin 0 -> 3107 bytes .../src/main/resources/static/index.html | 89 ++++++++++-------- 3 files changed, 52 insertions(+), 39 deletions(-) create mode 100644 sample-code/spring-app/src/main/resources/static/grounding.png diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 7cdbe0514..8283c6c0a 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -156,7 +156,6 @@ Object createDocument( @Nonnull @PathVariable("id") final UUID collectionId, @Nullable @RequestParam(value = "format", required = false) final String format) { final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - ; final var documentContent = "Last upload on " + dayOfWeek; final var chunkMeta = KeyValueListPair.create().key("context").value("day-of-week"); @@ -179,7 +178,6 @@ Object deleteDocuments( @Nonnull @PathVariable("id") final UUID collectionId, @Nullable @RequestParam(value = "format", required = false) final String format) { final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - ; final var chunkMeta = KeyValueListPair.create().key("context").value("day-of-week"); final var chunk = TextOnlyBaseChunk.create().content("Today is " + dayOfWeek).metadata(chunkMeta); diff --git a/sample-code/spring-app/src/main/resources/static/grounding.png b/sample-code/spring-app/src/main/resources/static/grounding.png new file mode 100644 index 0000000000000000000000000000000000000000..d16d0f4b8e7f4da94c6135eda8dd3d15beb198b0 GIT binary patch literal 3107 zcmY*bc|6o#7yb@m?8=rQ4a(M-vCA0iknD{m+gP&=!!R=(NL;VByvj9{mk`Dbn$!^e4e|!K58LBD% zn}MX`{V+lt`kO-b(-gNeI|D@%h@MbYxIA25T#F3~g`$WaUPw#*Q-9LwGfi0VIikME8YswDAIz6^Q2ea*Vj@& z{bv4O>`xsOV!!zRZ04U%e@E%9YO$dZe~(RzO~`qQg?{k;M*6zecB~n;I6QWcUu#|N zY0B3ieCu|u@&Tz-_>FXNygr3T#-EidF}=*@xPIE1f=XY?8Mph!i6hzuI%2xAWg}(& z4${7e?+9Kgg=ko`XwdbCRy@T1-ktT`D>XW-&AzcyZ z9}1&(C~Cxwhj?5p5+A&<_OU6Pt#^) z?-}nBslBbC4dLt%j#d2f2VI-RkGq9eq?59{0E zBaS;c&~B&iF}l6hvVtUKrQo=}&AzFAE0V?D?B--corg)2v_EXTfv|B#K4?QH>r~`w z2e->+2kn6iQ6xq7?BMwavbERP4~34#%7<=jpz*b26>%QP$LlFDtE>CKz0{&aKq z!JD4=n1fe1ZiAOI1f#ZE{cou)cJLe93|lF;uJTd7)?KTFV;!Hk3p_ox!ki>R!Ky*n z<_UWcHx z8wrbq_x6h4abAY!4KUWjykRs~>xaVg4XfV>OIxa=dNsoXb2+YdQW6qD0)7NProc^L&ZeTzQ)9l(6V&QONgP`TmJb4d?W*{ z&MnKIIv+9^Z#rmZ!XCM{qPFDE!5X#KXK*4bhrb)O3*-M%($;}UeY15x^FB6sHX&lW z4aVE z9SK4Ow9MdFPrz}pcNZWu8K2!aIcveII>+ID9QJW4s=(ApkQ0T{*E{lqiFxJSxs<7v z?a?yV=^(p@Rq#Bjzhb$-`FWW#+1VkBYK(f8;eDd=t+xIji>S>V{qFH7VHN#Y4@MnM zaHBl*a>q|B<>4i*dTuXaJB`Cx5wKcu2efIB>6QKx8XgC9H?cK>7vrmKGN! z4OGe;`P^@hRNCY+a8P;$4~2U}foMJ(=cnE*Zj43>Sk(gWULlSK2VA+Ll7fO5rdpL* zSeZ|8!btYIKyc+vTEw)2?^P8`*jd9)IfePJ3->t9Y^|nEQ=d>o^ggC@wu;8K0%Hz1 zoeh*g^~h7V)85NHoorV=C#htY*00UQwl|F3DVx9H)YenmEcNE-Pu?=f`%HsPO2vU_ zBKlOR{tF*~zfXc+(xX1@-Xm{jgO~NGG7riGbJt>AFP9fmgT^!w5VoY2S>>yFau~bv zlIW!@lw&TsR4v;L(>`BN5Q8snohAn zVy-=71AO_!afaf4!PM7aHOpZl2b(Gwg2%D&w!uKqlW-Jx_*(@83dQhG;Wlu|(xwnO zlPRK3d8|-NvUWbpZk-F0x`5ItruRY+4es_zg1KGrq6xy?LzVa%?Q!XaWP z^aWhTy?sonN^N=9N##~%$p#}Nvw5D#@Fcs5CyRALy4q87AeSAOCQ~D1Rveh~T@|}+ zW8SSU+OWDhmd6}aM!^K3yp(7K3;Oi|4xjPl;HitY@``KM4q>TSsgF$!GWyVLJxo?F zleUhuZVd!y1YKPdl{fKb&a05@w*B#_ePA`9RzadqeHpuy-VMF%c~cz#kuTW!f{T~> z!TeZJAs)o0GNn-0tSdlH;6k&>j`8X*@3@$JrG^*Yd81Lw=*c9PsHHX&ri(uAtX&|{ zMinj2wyGw84U&C*Em}9n281sMzEyJ*vYdUfs{2Q|18U1E(KZ>Hu&eyw6-p4ea$ zYi|qnxIU$QH0&p#*JrVA*d^+YET!Yq%=S-EgLbrHN>xu10}DJ)+co|UX{`;$;E;Dz zhevd&Po!c;Su)9vwGN08mo9%F~WJhIolOSEiZd@_)PEspN-#eI@P0% zY~S9c8awdf`T$dd8kO}WTuDBtOFth@2CK(D@(^CaK!$DIFD=T_>#SE+IH%Kr%wV^FEBM_bM>75_D@AFw3Rtr9 z;e75DiWUg8=ZB>1CBaQqEiDMzpWRwvx2%VGiagwzRU}Pq+KJm++hcfDlNP-u83xyg z1C@nFAZ~7M!>z5Y0E9qN>&%RxM!@rLag(a5sapU9t+o>Hs7k8a+PjUkqr#i9F1fHD~Ab$*RB;}cC1wELq(7KZ2O0d^(J3ZCQolXK6_DlCF*NKbaB8aE&ig` zBruOz+0gj-4Aaa7A9aKXwT6T3FLbLn5HBU|Zm%zJtU>o)xvZg7m6cBhzSne_?!WC` zR1}^a_QDxA956DFbW1g|aqVPM*5U)6m&-%==O2t+@c^y{c5!;0gHItU4|6`Oh56G? bmB=3V=4v*(WcY5z{!7`&z+9iI=NkJT;X+pz literal 0 HcmV?d00001 diff --git a/sample-code/spring-app/src/main/resources/static/index.html b/sample-code/spring-app/src/main/resources/static/index.html index fe99bcdd3..b14fd38d5 100644 --- a/sample-code/spring-app/src/main/resources/static/index.html +++ b/sample-code/spring-app/src/main/resources/static/index.html @@ -213,43 +213,6 @@
Configurations
-
-
Grounding
-
    -
  • -
    - -
    - List all active pipelines in the grounding module. They can be used to index document storages like Sharepoint pages or SFTP servers. -
    -
    -
  • -
  • -
    - -
    - Show all available document collections. -
    -
    -
  • -
  • -
    - -
    - Search in current document collections for a prompt. -
    -
    -
  • -
@@ -605,6 +568,58 @@
Orchestration Integration
+ +
+
+
+
+ Grounding Logo +

Grounding

+
+ The Grounding API offers additional context for enhancing your Orchestration LLM calls. + For more information, check the Wiki +
+
+
    +
  • +
    + +
    + List all active pipelines in the grounding module. They can be used to index document storages like Sharepoint pages or SFTP servers. +
    +
    +
  • +
  • +
    + +
    + Show all available document collections. +
    +
    +
  • +
  • +
    + +
    + Search in current document collections for a prompt. +
    +
    +
  • +
+
+
+
From a96b0582cc200f0447b48062eb5b3617a45974af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 21 Feb 2025 10:42:55 +0100 Subject: [PATCH 23/34] Update thresholds --- grounding/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grounding/pom.xml b/grounding/pom.xml index a7667fe7b..87180bb43 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -31,11 +31,11 @@ ${project.basedir}/../ - 76% - 83% - 88% + 80% + 71% + 85% 100% - 83% + 80% 100% From bfab7e04dcbaa3f3d9ba06a0b66fd153c852939f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= <22489773+newtork@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:57:53 +0100 Subject: [PATCH 24/34] Update grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com> --- .../test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index e5bd8ba97..b82002f5d 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -25,7 +25,7 @@ public class GroundingClientTest { @RegisterExtension - private static WireMockExtension WM = + private final static WireMockExtension WM = WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build(); private final HttpDestination DESTINATION = DefaultHttpDestination.builder(WM.baseUrl()).build(); From 4e73e297c6ca0778138f01e0b249845ab694847f Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Fri, 21 Feb 2025 09:58:29 +0000 Subject: [PATCH 25/34] Formatting --- .../test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index b82002f5d..e9800c4ab 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -25,7 +25,7 @@ public class GroundingClientTest { @RegisterExtension - private final static WireMockExtension WM = + private static final WireMockExtension WM = WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build(); private final HttpDestination DESTINATION = DefaultHttpDestination.builder(WM.baseUrl()).build(); From 5430c52d8b8899d06e762141b9c8c629311f92af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 21 Feb 2025 11:37:12 +0100 Subject: [PATCH 26/34] Fix JavaDoc --- .../app/controllers/GroundingController.java | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 8283c6c0a..90b56b4f7 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -/** Endpoints for AI Core AiDeployment operations */ +/** Endpoints for AI Core Grounding operations */ @Slf4j @RestController @SuppressWarnings("unused") @@ -50,11 +50,7 @@ class GroundingController { private static final VectorApi CLIENT_VECTOR = new GroundingClient().vector(); private static final String RESOURCE_GROUP = "ai-sdk-java-e2e"; - /** - * Stop all deployments with the Java specific configuration ID. - * - *

Only RUNNING deployments can be STOPPED - */ + /** Retrieve (up to 10) grounding pipeline entities. */ @GetMapping("/pipelines/list") Object getAllPipelines( @Nullable @RequestParam(value = "format", required = false) final String format) { @@ -68,11 +64,7 @@ Object getAllPipelines( return "Found pipelines with ids: " + ids; } - /** - * Delete all deployments with the Java specific configuration ID. - * - *

Only UNKNOWN and STOPPED deployments can be DELETED - */ + /** Retrieve all grounding data repositories. */ @GetMapping("/retrieval/repositories") Object getAllRepositories( @Nullable @RequestParam(value = "format", required = false) final String format) { @@ -87,11 +79,7 @@ Object getAllRepositories( return "Found repositories with titles: " + titles; } - /** - * Delete all deployments with the Java specific configuration ID. - * - *

Only UNKNOWN and STOPPED deployments can be DELETED - */ + /** Search for grounding documents that match a specific search term, in all data repositories. */ @GetMapping("/retrieval/search") Object searchInDocuments( @Nullable @RequestParam(value = "format", required = false) final String format) { @@ -111,7 +99,7 @@ Object searchInDocuments( return "Found the following response(s): " + messages; } - /** Get all deployments with the Java specific configuration ID. */ + /** Get all grounding document collections. */ @GetMapping("/vector/collections") Object getAllCollections( @Nullable @RequestParam(value = "format", required = false) final String format) { @@ -124,7 +112,7 @@ Object getAllCollections( return "The following collections are available: %s.".formatted(items); } - /** Get all deployments, including non-Java specific deployments */ + /** Get all items by a specific grounding document collection id. */ @GetMapping("/vector/collection/by-id/{id}/documents") Object getDocumentsByCollectionId( @Nonnull @PathVariable("id") final UUID collectionId, @@ -137,7 +125,7 @@ Object getDocumentsByCollectionId( return "The following document ids are available: %s.".formatted(ids); } - /** Get all deployments, including non-Java specific deployments */ + /** Create a new grounding document collection. */ @GetMapping("/vector/collection/create") String createCollection( @Nullable @RequestParam(value = "format", required = false) final String format) { @@ -150,7 +138,7 @@ String createCollection( return locationHeader.replaceAll("^.*?/([a-f0-9-]+)/.*?$", "$1"); } - /** Get all deployments, including non-Java specific deployments */ + /** Create a new vector for a given grounding document collection. */ @GetMapping("/vector/collection/by-id/{id}/day") Object createDocument( @Nonnull @PathVariable("id") final UUID collectionId, @@ -172,7 +160,7 @@ Object createDocument( return "The following document ids are available: %s.".formatted(ids); } - /** Get all deployments, including non-Java specific deployments */ + /** Delete all items from a given grounding document collection. */ @GetMapping("/vector/collection/by-id/{id}/clear") Object deleteDocuments( @Nonnull @PathVariable("id") final UUID collectionId, @@ -205,7 +193,7 @@ Object deleteDocuments( return response.getStatusCode() >= 400 ? "Failed to delete collection" : "Deletion successful"; } - /** Get all deployments, including non-Java specific deployments */ + /** Get vector chunks from a given grounding document. */ @GetMapping("/vector/collection/by-id/{collectionId}/document/by-id/{documentId}") Object getDocumentChunksById( @Nonnull @PathVariable("collectionId") final UUID collectionId, From 801c70602f01978e72b95a9ec9c62017826ac55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= <22489773+newtork@users.noreply.github.com> Date: Fri, 21 Feb 2025 11:38:16 +0100 Subject: [PATCH 27/34] Update grounding/pom.xml Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com> --- grounding/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grounding/pom.xml b/grounding/pom.xml index 87180bb43..5820e780d 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -8,7 +8,7 @@ grounding Grounding client - SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for the Orchestration Service. + SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for the Grounding Service. https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation From 10c715b9e0219ecbd0896e9f31bf2127e9afc924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 21 Feb 2025 11:59:28 +0100 Subject: [PATCH 28/34] Fix test method name --- .../java/com/sap/ai/sdk/app/controllers/GroundingTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index 25e11cd67..250cc1639 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -24,7 +24,7 @@ class GroundingTest { private static final String JSON_FORMAT = "json"; @Test - void getPipelinesGetAll() { + void testPipelinesGetAll() { final var controller = new GroundingController(); final var result = controller.getAllPipelines(JSON_FORMAT); @@ -38,7 +38,7 @@ void getPipelinesGetAll() { } @Test - void getRepositoriesGetAll() { + void testRepositoriesGetAll() { final var controller = new GroundingController(); final var result = controller.getAllRepositories(JSON_FORMAT); From af877e84476d555cecad428adc1baf81519c1aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Fri, 21 Feb 2025 12:24:26 +0100 Subject: [PATCH 29/34] Add doc --- README.md | 1 + docs/guides/GROUNDING.md | 152 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 docs/guides/GROUNDING.md diff --git a/README.md b/README.md index ae63c3e05..55a8085b0 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ For more detailed information and advanced usage, please refer to the following: - [ OpenAI Chat Completion](docs/guides/OPENAI_CHAT_COMPLETION.md) - [ Spring AI Integration](docs/guides/SPRING_AI_INTEGRATION.md) - [🧰 AI Core Deployment](docs/guides/AI_CORE_DEPLOYMENT.md) +- [ AI Core Grounding](docs/guides/GROUNDING.md) For updating versions, please refer to the [**Release Notes**](docs/release-notes/release-notes-0-to-14.md). diff --git a/docs/guides/GROUNDING.md b/docs/guides/GROUNDING.md new file mode 100644 index 000000000..26a9fcdf5 --- /dev/null +++ b/docs/guides/GROUNDING.md @@ -0,0 +1,152 @@ +# Grounding Services + +## Table of Contents + +- [Introduction](#introduction) + - [Prerequisites](#prerequisites) + - [Maven Dependencies](#maven-dependencies) +- [Usage](#usage) + - [Data Ingestion](#data-ingestion) + - [Pipeline API](#pipeline) + - [Vector API](#vector) + - [Data Retrieval](#data-retrieval) + - [Retrieval API](#create-a-deployment) + - [Grounding via Orchestration](#orchestration) + +## Introduction + +This guide provides examples on how to manage data in SAP Document Grounding. +It's divided into two main sections: Data Ingestion and Data Retrieval. + +> [!WARNING] +> The below examples rely on generated model classes. +> Please be aware of the [implications described here](/README.md#general-requirements). + +## Prerequisites + +Before using the Grounding module, ensure that you have met all the general requirements outlined in the [README.md](../../README.md#general-requirements). +Additionally, include the necessary Maven dependency in your project. + +### Maven Dependencies + +Add the following dependency to your `pom.xml` file: + +```xml + + com.sap.ai.sdk + grounding + ${ai-sdk.version} + +``` + +See [an example pom in our Spring Boot application](../../sample-code/spring-app/pom.xml) + +## Usage + +In addition to the prerequisites above, we assume you have already set up the following to carry out the examples in this guide: + +- A running instance of SAP AI Core with correctly setup credentials, including a resource group id. + +## Data Ingestion + +The following APIs are available for data ingestion: Pipeline and Vector. + +### Pipeline API + +Consider the following code sample to read pipelines, create a new one and get its status: + +```java +var api = new GroundingClient().pipelines(); +var resourceGroupId = "default"; + +// get all pipelines +Pipelines pipelines = api.getAllPipelines(resourceGroupId); + +// create new pipeline +var type = "MSSharePoint"; // or "S3" or "SFTP" +var pipelineSecret = "my-secret-name"; +var config = PipelinePostRequstConfiguration.create().destination(pipelineSecret); +var request = PipelinesPostRequest.create().type(type)._configuration(config); +PipelineId pipeline = api.createPipeline(resourceGroupId, request); + +// get pipeline status +PipelineStatus status = api.getPipelineStatus(resourceGroupId, pipeline.getPipelineId()); +``` + +### Vector API + +```java +var api = new GroundingClient().vector(); +var resourceGroupId = "default"; + +// resolve collection id +var collectionId = UUID.fromString("12345-123-123-123-0123456abcdef"); + +var request = DocumentCreateRequest.create() + .documents(BaseDocument.create() + .chunks(TextOnlyBaseChunk.create() + .content("The dog makes _woof_") + .metadata(KeyValueListPair.create() + .key("animal").value("dog"))) + .metadata(DocumentKeyValueListPair.create() + .key("topic").value("sound"))); +DocumentsListResponse response = api.createDocuments(resourceGroupId, collectionId, request); +``` + +Refer to the [DeploymentController.java](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/DeploymentController.java) in our Spring Boot application for a complete example. + +## Data Retrieval + +The following APIs are available for data retrieval: Retrieval and Orchestration. + + +### Retrieval API + +Consider the following code sample to search for relevant grounding data based on a query: + +```java +var api = new GroundingClient().retrieval(); +var resourceGroupId = "default"; + +var filter = + RetrievalSearchFilter.create() + .id("question") + .dataRepositoryType(DataRepositoryType.VECTOR) + .dataRepositories(List.of("*")) + .searchConfiguration(SearchConfiguration.create().maxChunkCount(10)); +var search = RetrievalSearchInput.create().query("What is SAP Cloud SDK for AI?").filters(filter); +RetievalSearchResults results = api.search(resourceGroupId, search); +``` + +### Grounding via Orchestration + +You can use the grounding service via orchestration. +Please find the [documentation on Orchestration client in the dedicated document](ORCHESTRATION.md). + +```java +OrchestrationClient client; + +var databaseFilter = + DocumentGroundingFilter.create() + .dataRepositoryType(DataRepositoryType.VECTOR) + .searchConfig(GroundingFilterSearchConfiguration.create().maxChunkCount(3)); +var groundingConfigConfig = + GroundingModuleConfigConfig.create() + .inputParams(List.of("query")) + .outputParam("results") + .addFiltersItem(databaseFilter); +var groundingConfig = + GroundingModuleConfig.create() + .type(GroundingModuleConfig.TypeEnum.DOCUMENT_GROUNDING_SERVICE) + .config(groundingConfigConfig); +var configWithGrounding = config.withGroundingConfig(groundingConfig); + +var inputParams = Map.of("query", "What is SAP Cloud SDK for AI?"); + +var prompt = + new OrchestrationPrompt( + inputParams, + Message.system("Context message with embedded grounding results. {{?results}}")); + +OrchestrationChatResponse response = client.chatCompletion(prompt, configWithGrounding); +``` \ No newline at end of file From a255bd5f1fd29ad192cf6f6729bc010254ec1a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= <22489773+newtork@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:52:20 +0100 Subject: [PATCH 30/34] Update docs/guides/GROUNDING.md Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com> --- docs/guides/GROUNDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/GROUNDING.md b/docs/guides/GROUNDING.md index 26a9fcdf5..8d5bc24ac 100644 --- a/docs/guides/GROUNDING.md +++ b/docs/guides/GROUNDING.md @@ -66,7 +66,7 @@ Pipelines pipelines = api.getAllPipelines(resourceGroupId); var type = "MSSharePoint"; // or "S3" or "SFTP" var pipelineSecret = "my-secret-name"; var config = PipelinePostRequstConfiguration.create().destination(pipelineSecret); -var request = PipelinesPostRequest.create().type(type)._configuration(config); +var request = PipelinePostRequst.create().type(type)._configuration(config); PipelineId pipeline = api.createPipeline(resourceGroupId, request); // get pipeline status From c2951d5c3152b049b9c081f5c926579c6d23afd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= <22489773+newtork@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:52:30 +0100 Subject: [PATCH 31/34] Update docs/guides/GROUNDING.md Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com> --- docs/guides/GROUNDING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/GROUNDING.md b/docs/guides/GROUNDING.md index 8d5bc24ac..9745005c8 100644 --- a/docs/guides/GROUNDING.md +++ b/docs/guides/GROUNDING.md @@ -7,11 +7,11 @@ - [Maven Dependencies](#maven-dependencies) - [Usage](#usage) - [Data Ingestion](#data-ingestion) - - [Pipeline API](#pipeline) - - [Vector API](#vector) - - [Data Retrieval](#data-retrieval) + - [Pipeline API](#pipeline-api) + - [Vector API](#vector-api) + - [Data Retrieval](#retrieval-api) - [Retrieval API](#create-a-deployment) - - [Grounding via Orchestration](#orchestration) + - [Grounding via Orchestration](#grounding-via-orchestration) ## Introduction From 8e927ae8dd85db1b5da6064cba7a265712882272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Mon, 24 Feb 2025 10:58:39 +0100 Subject: [PATCH 32/34] Fix doc --- docs/guides/GROUNDING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/guides/GROUNDING.md b/docs/guides/GROUNDING.md index 26a9fcdf5..3c1d02093 100644 --- a/docs/guides/GROUNDING.md +++ b/docs/guides/GROUNDING.md @@ -139,7 +139,10 @@ var groundingConfig = GroundingModuleConfig.create() .type(GroundingModuleConfig.TypeEnum.DOCUMENT_GROUNDING_SERVICE) .config(groundingConfigConfig); -var configWithGrounding = config.withGroundingConfig(groundingConfig); +var configWithGrounding = + new OrchestrationModuleConfig() + .withLlmConfig(GPT_4O) + .withGroundingConfig(groundingConfig); var inputParams = Map.of("query", "What is SAP Cloud SDK for AI?"); From 5b3ebd8f7be270736272aafd336fe2ef86f3bc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= <22489773+newtork@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:58:46 +0100 Subject: [PATCH 33/34] Update docs/guides/GROUNDING.md Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com> --- docs/guides/GROUNDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/GROUNDING.md b/docs/guides/GROUNDING.md index 9745005c8..969d96de5 100644 --- a/docs/guides/GROUNDING.md +++ b/docs/guides/GROUNDING.md @@ -121,7 +121,7 @@ RetievalSearchResults results = api.search(resourceGroupId, search); ### Grounding via Orchestration You can use the grounding service via orchestration. -Please find the [documentation on Orchestration client in the dedicated document](ORCHESTRATION.md). +Please find the [documentation on Orchestration client in the dedicated document](ORCHESTRATION_CHAT_COMPLETION.md). ```java OrchestrationClient client; From 4e2028769e204af7a742dec888537907f1459806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Mon, 24 Feb 2025 11:13:21 +0100 Subject: [PATCH 34/34] Migrate files from "api" namespace to "client" namespace --- .pipeline/spotbugs-exclusions.xml | 2 +- grounding/pom.xml | 2 +- .../sap/ai/sdk/grounding/GroundingClient.java | 6 ++--- .../{api => client}/PipelinesApi.java | 2 +- .../{api => client}/RetrievalApi.java | 2 +- .../grounding/{api => client}/VectorApi.java | 2 +- .../sap/ai/sdk/grounding/model/ApiError.java | 20 ++++++++++++++++ .../ai/sdk/grounding/model/BaseDocument.java | 17 ++++++++++++++ .../com/sap/ai/sdk/grounding/model/Chunk.java | 18 +++++++++++++++ .../ai/sdk/grounding/model/Collection.java | 19 +++++++++++++++ .../model/CollectionCreatedResponse.java | 17 ++++++++++++++ .../model/CollectionDeletedResponse.java | 17 ++++++++++++++ .../model/CollectionPendingResponse.java | 17 ++++++++++++++ .../grounding/model/CollectionRequest.java | 18 +++++++++++++++ .../model/CollectionsListResponse.java | 17 ++++++++++++++ .../sdk/grounding/model/DataRepositories.java | 17 ++++++++++++++ .../sdk/grounding/model/DataRepository.java | 19 +++++++++++++++ .../model/DataRepositoryWithDocuments.java | 19 +++++++++++++++ .../grounding/model/DetailsErrorResponse.java | 17 ++++++++++++++ .../model/DocumentCreateRequest.java | 16 +++++++++++++ .../ai/sdk/grounding/model/DocumentInput.java | 18 +++++++++++++++ .../model/DocumentKeyValueListPair.java | 18 +++++++++++++++ .../sdk/grounding/model/DocumentOutput.java | 18 +++++++++++++++ .../sdk/grounding/model/DocumentResponse.java | 18 +++++++++++++++ .../model/DocumentUpdateRequest.java | 16 +++++++++++++ .../model/DocumentWithoutChunks.java | 17 ++++++++++++++ .../sap/ai/sdk/grounding/model/Documents.java | 17 ++++++++++++++ .../sdk/grounding/model/DocumentsChunk.java | 19 +++++++++++++++ .../model/DocumentsListResponse.java | 16 +++++++++++++ .../sdk/grounding/model/EmbeddingConfig.java | 16 +++++++++++++ .../ai/sdk/grounding/model/InlineObject.java | 16 +++++++++++++ .../sdk/grounding/model/KeyValueListPair.java | 17 ++++++++++++++ .../model/PerFilterSearchResult.java | 17 ++++++++++++++ .../sap/ai/sdk/grounding/model/Pipeline.java | 18 +++++++++++++++ .../model/PipelineConfiguration.java | 17 ++++++++++++++ .../PipelineConfigurationSharePoint.java | 16 +++++++++++++ .../PipelineConfigurationSharePointSite.java | 18 +++++++++++++++ .../ai/sdk/grounding/model/PipelineId.java | 16 +++++++++++++ .../grounding/model/PipelinePostRequst.java | 17 ++++++++++++++ .../PipelinePostRequstConfiguration.java | 17 ++++++++++++++ ...linePostRequstConfigurationSharePoint.java | 16 +++++++++++++ ...PostRequstConfigurationSharePointSite.java | 17 ++++++++++++++ .../sdk/grounding/model/PipelineStatus.java | 16 +++++++++++++ .../sap/ai/sdk/grounding/model/Pipelines.java | 17 ++++++++++++++ .../ai/sdk/grounding/model/ResultsInner.java | 17 ++++++++++++++ .../ai/sdk/grounding/model/ResultsInner1.java | 18 +++++++++++++++ .../RetievalDataRepositorySearchResult.java | 16 +++++++++++++ .../model/RetievalPerFilterSearchResult.java | 17 ++++++++++++++ ...etievalPerFilterSearchResultWithError.java | 16 +++++++++++++ .../model/RetievalSearchResults.java | 16 +++++++++++++ .../grounding/model/RetrievalDocument.java | 18 +++++++++++++++ .../model/RetrievalSearchFilter.java | 23 +++++++++++++++++++ .../grounding/model/RetrievalSearchInput.java | 17 ++++++++++++++ .../grounding/model/SearchConfiguration.java | 17 ++++++++++++++ .../model/SearchDocumentKeyValueListPair.java | 18 +++++++++++++++ .../ai/sdk/grounding/model/SearchFilter.java | 21 +++++++++++++++++ .../ai/sdk/grounding/model/SearchResults.java | 16 +++++++++++++ .../grounding/model/TextOnlyBaseChunk.java | 17 ++++++++++++++ .../grounding/model/TextSearchRequest.java | 17 ++++++++++++++ .../ai/sdk/grounding/GroundingClientTest.java | 6 ++--- pom.xml | 4 ++-- .../app/controllers/GroundingController.java | 6 ++--- 62 files changed, 936 insertions(+), 16 deletions(-) rename grounding/src/main/java/com/sap/ai/sdk/grounding/{api => client}/PipelinesApi.java (99%) rename grounding/src/main/java/com/sap/ai/sdk/grounding/{api => client}/RetrievalApi.java (99%) rename grounding/src/main/java/com/sap/ai/sdk/grounding/{api => client}/VectorApi.java (99%) diff --git a/.pipeline/spotbugs-exclusions.xml b/.pipeline/spotbugs-exclusions.xml index 486d65692..ded4e5eca 100644 --- a/.pipeline/spotbugs-exclusions.xml +++ b/.pipeline/spotbugs-exclusions.xml @@ -5,7 +5,7 @@ - + diff --git a/grounding/pom.xml b/grounding/pom.xml index 5820e780d..659f1c7f4 100644 --- a/grounding/pom.xml +++ b/grounding/pom.xml @@ -132,7 +132,7 @@ generate-sources ${project.basedir}/src/main/resources/spec/grounding.yaml - com.sap.ai.sdk.grounding.api + com.sap.ai.sdk.grounding.client com.sap.ai.sdk.grounding.model create diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java index 28f858c6b..526235fe0 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java @@ -1,9 +1,9 @@ package com.sap.ai.sdk.grounding; import com.sap.ai.sdk.core.AiCoreService; -import com.sap.ai.sdk.grounding.api.PipelinesApi; -import com.sap.ai.sdk.grounding.api.RetrievalApi; -import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.ai.sdk.grounding.client.PipelinesApi; +import com.sap.ai.sdk.grounding.client.RetrievalApi; +import com.sap.ai.sdk.grounding.client.VectorApi; import javax.annotation.Nonnull; import lombok.AccessLevel; import lombok.Getter; diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java similarity index 99% rename from grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java rename to grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java index db40fa4cb..c7310e26e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/PipelinesApi.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java @@ -1,4 +1,4 @@ -package com.sap.ai.sdk.grounding.api; +package com.sap.ai.sdk.grounding.client; import com.google.common.annotations.Beta; import com.sap.ai.sdk.grounding.model.Pipeline; diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java similarity index 99% rename from grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java rename to grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java index 40f040089..c54345f38 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/RetrievalApi.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java @@ -1,4 +1,4 @@ -package com.sap.ai.sdk.grounding.api; +package com.sap.ai.sdk.grounding.client; import com.google.common.annotations.Beta; import com.sap.ai.sdk.grounding.model.DataRepositories; diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java similarity index 99% rename from grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java rename to grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java index 6f03b3b8a..8a537258b 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/api/VectorApi.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java @@ -1,4 +1,4 @@ -package com.sap.ai.sdk.grounding.api; +package com.sap.ai.sdk.grounding.client; import com.google.common.annotations.Beta; import com.sap.ai.sdk.grounding.model.Collection; diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java index f44be8042..27df4b095 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java @@ -236,11 +236,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ApiError} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ApiError has no field with name '" + name + "'."); @@ -248,6 +250,24 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ApiError} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + if (requestId != null) declaredFields.put("requestId", requestId); + if (target != null) declaredFields.put("target", target); + if (details != null) declaredFields.put("details", details); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ApiError} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java index 6cbf7bcac..de9051dba 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java @@ -150,11 +150,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link BaseDocument} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("BaseDocument has no field with name '" + name + "'."); @@ -162,6 +164,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link BaseDocument} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (chunks != null) declaredFields.put("chunks", chunks); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link BaseDocument} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java index bffb9fe84..5cc660335 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java @@ -168,11 +168,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link Chunk} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("Chunk has no field with name '" + name + "'."); @@ -180,6 +182,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link Chunk} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (content != null) declaredFields.put("content", content); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link Chunk} instance. If the map previously contained * a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java index b08be0793..3641e1a01 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java @@ -205,11 +205,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link Collection} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("Collection has no field with name '" + name + "'."); @@ -217,6 +219,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link Collection} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (title != null) declaredFields.put("title", title); + if (embeddingConfig != null) declaredFields.put("embeddingConfig", embeddingConfig); + if (metadata != null) declaredFields.put("metadata", metadata); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link Collection} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java index a540e430d..b5ef361c8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java @@ -119,11 +119,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link CollectionCreatedResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -132,6 +134,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CollectionCreatedResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (collectionURL != null) declaredFields.put("collectionURL", collectionURL); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CollectionCreatedResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java index 16c29651c..a9dbd1862 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java @@ -119,11 +119,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link CollectionDeletedResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -132,6 +134,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CollectionDeletedResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (collectionURL != null) declaredFields.put("collectionURL", collectionURL); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CollectionDeletedResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java index b2a9e2f1f..bbfb25035 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java @@ -121,11 +121,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link CollectionPendingResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -134,6 +136,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CollectionPendingResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (location != null) declaredFields.put("location", location); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CollectionPendingResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java index 1339f4e31..2de143724 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java @@ -171,11 +171,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link CollectionRequest} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("CollectionRequest has no field with name '" + name + "'."); @@ -183,6 +185,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CollectionRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (title != null) declaredFields.put("title", title); + if (embeddingConfig != null) declaredFields.put("embeddingConfig", embeddingConfig); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CollectionRequest} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java index 4f05a5bfc..d5d263962 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java @@ -136,11 +136,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link CollectionsListResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -149,6 +151,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CollectionsListResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (resources != null) declaredFields.put("resources", resources); + if (count != null) declaredFields.put("count", count); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CollectionsListResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java index b70db0ce1..4191562c5 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DataRepositories} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("DataRepositories has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DataRepositories} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (resources != null) declaredFields.put("resources", resources); + if (count != null) declaredFields.put("count", count); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DataRepositories} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java index 6382ee51d..7bd332148 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java @@ -206,11 +206,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DataRepository} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("DataRepository has no field with name '" + name + "'."); @@ -218,6 +220,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DataRepository} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (title != null) declaredFields.put("title", title); + if (metadata != null) declaredFields.put("metadata", metadata); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DataRepository} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java index 388a1efd4..f0e31ef6c 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java @@ -227,11 +227,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link DataRepositoryWithDocuments} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -240,6 +242,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DataRepositoryWithDocuments} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (title != null) declaredFields.put("title", title); + if (metadata != null) declaredFields.put("metadata", metadata); + if (documents != null) declaredFields.put("documents", documents); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DataRepositoryWithDocuments} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java index a94e420a0..a31720334 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java @@ -117,11 +117,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DetailsErrorResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -130,6 +132,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DetailsErrorResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DetailsErrorResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java index 4fa8931e0..1dd7a5e17 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java @@ -101,11 +101,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentCreateRequest} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -114,6 +116,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentCreateRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (documents != null) declaredFields.put("documents", documents); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentCreateRequest} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java index 1d692b23f..a246e17fb 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java @@ -185,11 +185,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentInput} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("DocumentInput has no field with name '" + name + "'."); @@ -197,6 +199,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentInput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (chunks != null) declaredFields.put("chunks", chunks); + if (metadata != null) declaredFields.put("metadata", metadata); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentInput} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java index 1b0092ebc..b40ff398d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java @@ -229,11 +229,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentKeyValueListPair} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -242,6 +244,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentKeyValueListPair} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + if (matchMode != null) declaredFields.put("matchMode", matchMode); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentKeyValueListPair} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java index 38e7855ec..5a62f69d9 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java @@ -185,11 +185,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentOutput} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("DocumentOutput has no field with name '" + name + "'."); @@ -197,6 +199,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentOutput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (metadata != null) declaredFields.put("metadata", metadata); + if (chunks != null) declaredFields.put("chunks", chunks); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentOutput} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java index be6c27195..ea869f9f7 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java @@ -185,11 +185,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("DocumentResponse has no field with name '" + name + "'."); @@ -197,6 +199,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (chunks != null) declaredFields.put("chunks", chunks); + if (metadata != null) declaredFields.put("metadata", metadata); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentResponse} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java index 3e96171d3..af482ebfb 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java @@ -104,11 +104,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentUpdateRequest} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -117,6 +119,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentUpdateRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (documents != null) declaredFields.put("documents", documents); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentUpdateRequest} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java index f25afffba..29eb40f8f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java @@ -137,11 +137,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentWithoutChunks} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -150,6 +152,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentWithoutChunks} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (metadata != null) declaredFields.put("metadata", metadata); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentWithoutChunks} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java index c39cd353e..4ee81b280 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link Documents} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("Documents has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link Documents} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (resources != null) declaredFields.put("resources", resources); + if (count != null) declaredFields.put("count", count); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link Documents} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java index fcb341bf8..bcdfa2a07 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java @@ -219,11 +219,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentsChunk} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("DocumentsChunk has no field with name '" + name + "'."); @@ -231,6 +233,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentsChunk} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (title != null) declaredFields.put("title", title); + if (metadata != null) declaredFields.put("metadata", metadata); + if (documents != null) declaredFields.put("documents", documents); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentsChunk} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java index bd7f82981..bdfca2fd2 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java @@ -102,11 +102,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link DocumentsListResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -115,6 +117,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link DocumentsListResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (documents != null) declaredFields.put("documents", documents); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link DocumentsListResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java index 88fb896a3..2fd010eac 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java @@ -83,11 +83,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link EmbeddingConfig} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("EmbeddingConfig has no field with name '" + name + "'."); @@ -95,6 +97,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link EmbeddingConfig} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (modelName != null) declaredFields.put("modelName", modelName); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link EmbeddingConfig} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java index 2ced645e3..350013675 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java @@ -83,11 +83,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link InlineObject} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("InlineObject has no field with name '" + name + "'."); @@ -95,6 +97,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link InlineObject} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (error != null) declaredFields.put("error", error); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link InlineObject} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java index e91005c77..7e920c44f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link KeyValueListPair} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("KeyValueListPair has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link KeyValueListPair} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link KeyValueListPair} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java index 8b9c717ea..229e3d2d3 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link PerFilterSearchResult} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -148,6 +150,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PerFilterSearchResult} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PerFilterSearchResult} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java index be4c7db23..0f938fa52 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java @@ -151,11 +151,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link Pipeline} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("Pipeline has no field with name '" + name + "'."); @@ -163,6 +165,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link Pipeline} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link Pipeline} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java index f3c11b448..520f70862 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java @@ -119,11 +119,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link PipelineConfiguration} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -132,6 +134,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelineConfiguration} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (destination != null) declaredFields.put("destination", destination); + if (sharePoint != null) declaredFields.put("sharePoint", sharePoint); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelineConfiguration} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java index ba30a890c..9659852d4 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java @@ -86,11 +86,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePoint} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -99,6 +101,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelineConfigurationSharePoint} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (site != null) declaredFields.put("site", site); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelineConfigurationSharePoint} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java index 3bc8fbe4e..898ca0170 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java @@ -176,11 +176,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePointSite} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -189,6 +191,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelineConfigurationSharePointSite} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (name != null) declaredFields.put("name", name); + if (includePaths != null) declaredFields.put("includePaths", includePaths); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelineConfigurationSharePointSite} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java index 9365a2e0b..110c31f82 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java @@ -83,11 +83,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link PipelineId} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("PipelineId has no field with name '" + name + "'."); @@ -95,6 +97,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelineId} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (pipelineId != null) declaredFields.put("pipelineId", pipelineId); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelineId} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java index 01454c755..e2b1fc748 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java @@ -119,11 +119,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link PipelinePostRequst} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("PipelinePostRequst has no field with name '" + name + "'."); @@ -131,6 +133,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelinePostRequst} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelinePostRequst} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java index 8a7bdeb99..6fe57ff4e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java @@ -121,11 +121,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link PipelinePostRequstConfiguration} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -134,6 +136,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelinePostRequstConfiguration} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (destination != null) declaredFields.put("destination", destination); + if (sharePoint != null) declaredFields.put("sharePoint", sharePoint); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelinePostRequstConfiguration} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java index c267008a0..7ae852f1e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java @@ -87,11 +87,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * PipelinePostRequstConfigurationSharePoint} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -100,6 +102,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelinePostRequstConfigurationSharePoint} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (site != null) declaredFields.put("site", site); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePoint} * instance. If the map previously contained a mapping for the key, the old value is replaced by diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java index 60fea6bdc..f334bb7b8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java @@ -143,11 +143,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * PipelinePostRequstConfigurationSharePointSite} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -156,6 +158,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelinePostRequstConfigurationSharePointSite} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (name != null) declaredFields.put("name", name); + if (includePaths != null) declaredFields.put("includePaths", includePaths); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePointSite} * instance. If the map previously contained a mapping for the key, the old value is replaced by diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java index cc736df93..7386aecbc 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java @@ -84,11 +84,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link PipelineStatus} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("PipelineStatus has no field with name '" + name + "'."); @@ -96,6 +98,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PipelineStatus} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (lastStarted != null) declaredFields.put("lastStarted", lastStarted); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PipelineStatus} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java index 056809639..8d44155c8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link Pipelines} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("Pipelines has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link Pipelines} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (resources != null) declaredFields.put("resources", resources); + if (count != null) declaredFields.put("count", count); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link Pipelines} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java index bbc9f1293..735cca0cd 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ResultsInner} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ResultsInner has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ResultsInner} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ResultsInner} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java index 0bf90e361..fb0ffb9a8 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java @@ -169,11 +169,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ResultsInner1} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ResultsInner1 has no field with name '" + name + "'."); @@ -181,6 +183,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ResultsInner1} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (results != null) declaredFields.put("results", results); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ResultsInner1} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java index 87f4942a7..92add50bb 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java @@ -88,11 +88,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link RetievalDataRepositorySearchResult} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -101,6 +103,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetievalDataRepositorySearchResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (dataRepository != null) declaredFields.put("dataRepository", dataRepository); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetievalDataRepositorySearchResult} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java index a31e97150..361e7e06e 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java @@ -139,11 +139,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link RetievalPerFilterSearchResult} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -152,6 +154,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetievalPerFilterSearchResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetievalPerFilterSearchResult} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java index 5d406ccf5..0d52aa113 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java @@ -86,11 +86,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * RetievalPerFilterSearchResultWithError} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -99,6 +101,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetievalPerFilterSearchResultWithError} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetievalPerFilterSearchResultWithError} instance. * If the map previously contained a mapping for the key, the old value is replaced by the diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java index f5081a7e1..f8d39ba41 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java @@ -101,11 +101,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link RetievalSearchResults} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -114,6 +116,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetievalSearchResults} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetievalSearchResults} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java index 31ca4da25..56c2b1796 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java @@ -184,11 +184,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link RetrievalDocument} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("RetrievalDocument has no field with name '" + name + "'."); @@ -196,6 +198,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetrievalDocument} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (metadata != null) declaredFields.put("metadata", metadata); + if (chunks != null) declaredFields.put("chunks", chunks); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetrievalDocument} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java index df27f2c80..ccf656b85 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -378,11 +378,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link RetrievalSearchFilter} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -391,6 +393,27 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetrievalSearchFilter} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (searchConfiguration != null) declaredFields.put("searchConfiguration", searchConfiguration); + if (dataRepositories != null) declaredFields.put("dataRepositories", dataRepositories); + if (dataRepositoryType != null) declaredFields.put("dataRepositoryType", dataRepositoryType); + if (dataRepositoryMetadata != null) + declaredFields.put("dataRepositoryMetadata", dataRepositoryMetadata); + if (documentMetadata != null) declaredFields.put("documentMetadata", documentMetadata); + if (chunkMetadata != null) declaredFields.put("chunkMetadata", chunkMetadata); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetrievalSearchFilter} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java index 600fbce15..70babbb27 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link RetrievalSearchInput} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -148,6 +150,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link RetrievalSearchInput} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (query != null) declaredFields.put("query", query); + if (filters != null) declaredFields.put("filters", filters); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link RetrievalSearchInput} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java index 570f7fa10..ff8eac94d 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java @@ -128,11 +128,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link SearchConfiguration} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -141,6 +143,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link SearchConfiguration} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (maxChunkCount != null) declaredFields.put("maxChunkCount", maxChunkCount); + if (maxDocumentCount != null) declaredFields.put("maxDocumentCount", maxDocumentCount); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link SearchConfiguration} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java index bbe176ce8..89ba86ee0 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java @@ -190,11 +190,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -203,6 +205,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link SearchDocumentKeyValueListPair} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + if (selectMode != null) declaredFields.put("selectMode", selectMode); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java index 7983ade41..fd5c629b5 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java @@ -326,11 +326,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link SearchFilter} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("SearchFilter has no field with name '" + name + "'."); @@ -338,6 +340,25 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link SearchFilter} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (collectionIds != null) declaredFields.put("collectionIds", collectionIds); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + if (collectionMetadata != null) declaredFields.put("collectionMetadata", collectionMetadata); + if (documentMetadata != null) declaredFields.put("documentMetadata", documentMetadata); + if (chunkMetadata != null) declaredFields.put("chunkMetadata", chunkMetadata); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link SearchFilter} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java index 1bfe81a5c..54006b046 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java @@ -101,11 +101,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link SearchResults} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("SearchResults has no field with name '" + name + "'."); @@ -113,6 +115,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link SearchResults} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link SearchResults} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java index 667ee6685..e6df16da1 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link TextOnlyBaseChunk} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("TextOnlyBaseChunk has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link TextOnlyBaseChunk} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (content != null) declaredFields.put("content", content); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link TextOnlyBaseChunk} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java index 2a30f5ad7..c0b7c9f9f 100644 --- a/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java +++ b/grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java @@ -135,11 +135,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link TextSearchRequest} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("TextSearchRequest has no field with name '" + name + "'."); @@ -147,6 +149,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link TextSearchRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (query != null) declaredFields.put("query", query); + if (filters != null) declaredFields.put("filters", filters); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link TextSearchRequest} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. diff --git a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index e9800c4ab..9447cc5b3 100644 --- a/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java +++ b/grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -5,9 +5,9 @@ import com.github.tomakehurst.wiremock.junit5.WireMockExtension; import com.sap.ai.sdk.core.AiCoreService; -import com.sap.ai.sdk.grounding.api.PipelinesApi; -import com.sap.ai.sdk.grounding.api.RetrievalApi; -import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.ai.sdk.grounding.client.PipelinesApi; +import com.sap.ai.sdk.grounding.client.RetrievalApi; +import com.sap.ai.sdk.grounding.client.VectorApi; import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DataRepositoryType; diff --git a/pom.xml b/pom.xml index 33bd76a4c..a93dad0ce 100644 --- a/pom.xml +++ b/pom.xml @@ -626,7 +626,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/model/* com/sap/ai/sdk/foundationmodels/openai/generated/model/* com/sap/ai/sdk/orchestration/model/* - com/sap/ai/sdk/grounding/api/* + com/sap/ai/sdk/grounding/client/* com/sap/ai/sdk/grounding/model/* @@ -650,7 +650,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* com/sap/ai/sdk/foundationmodels/openai/generated/model/* - com/sap/ai/sdk/grounding/api/* + com/sap/ai/sdk/grounding/client/* com/sap/ai/sdk/grounding/model/* com/sap/ai/sdk/app/**/* diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 90b56b4f7..c1a427c72 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -5,9 +5,9 @@ import static java.util.stream.Collectors.joining; import com.sap.ai.sdk.grounding.GroundingClient; -import com.sap.ai.sdk.grounding.api.PipelinesApi; -import com.sap.ai.sdk.grounding.api.RetrievalApi; -import com.sap.ai.sdk.grounding.api.VectorApi; +import com.sap.ai.sdk.grounding.client.PipelinesApi; +import com.sap.ai.sdk.grounding.client.RetrievalApi; +import com.sap.ai.sdk.grounding.client.VectorApi; import com.sap.ai.sdk.grounding.model.BaseDocument; import com.sap.ai.sdk.grounding.model.Collection; import com.sap.ai.sdk.grounding.model.CollectionRequest;