diff --git a/.github/workflows/pr-lint.yaml b/.github/workflows/pr-lint.yaml index ce7b350c8..01b1ea592 100644 --- a/.github/workflows/pr-lint.yaml +++ b/.github/workflows/pr-lint.yaml @@ -30,6 +30,7 @@ jobs: Grounding RPT Batch + Tabular headerPattern: '^(\w.+): (?:\[(\w.+)\] )?(.+)$' headerPatternCorrespondence: type, scope, subject # for available types, check: diff --git a/.github/workflows/spec-update-cleanup.yaml b/.github/workflows/spec-update-cleanup.yaml index 2b7ee109d..6e2fa9509 100644 --- a/.github/workflows/spec-update-cleanup.yaml +++ b/.github/workflows/spec-update-cleanup.yaml @@ -13,6 +13,9 @@ on: - orchestration - prompt-registry - sap-rpt + - batch + - tabular-orchestration + - tabular-predict default: orchestration ref: description: 'Original branch or tag the branch was created from' diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 7477e8f37..799e20c80 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -25,6 +25,8 @@ on: - prompt-registry - sap-rpt - batch + - tabular-orchestration + - tabular-predict default: orchestration ref: description: 'Branch or tag to checkout the spec file from' @@ -171,6 +173,16 @@ jobs: FILE_PATH='core-services/batch/src/main/resources/spec/batch-service.yaml' MODULE_PATH='core-services/batch' ;; + tabular-orchestration) #https://github.tools.sap/AI/context-registry/blob/main/docs/public/business_api_hub/api_hub_merged_spec.yaml + API_URL="$API_BASE_URL/AI/context-registry/contents/docs/public/business_api_hub/api_hub_merged_spec.yaml?ref=$REF" + FILE_PATH='core-services/tabular-orchestration/src/main/resources/spec/tabular-orchestration.yaml' + MODULE_PATH='core-services/tabular-orchestration' + ;; + tabular-predict) #https://github.tools.sap/AI/context-registry/blob/main/docs/public/business_api_hub/api_hub_merged_spec.yaml + API_URL="$API_BASE_URL/AI/context-registry/contents/docs/public/business_api_hub/tabular-predict.json?ref=$REF" + FILE_PATH='core-services/tabular-orchestration/src/main/resources/spec/tabular-predict.json' + MODULE_PATH='core-services/tabular-orchestration' + ;; esac echo "module_path=$MODULE_PATH" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/weekly-spec-update.yaml b/.github/workflows/weekly-spec-update.yaml index 67081eb00..029840757 100644 --- a/.github/workflows/weekly-spec-update.yaml +++ b/.github/workflows/weekly-spec-update.yaml @@ -20,6 +20,8 @@ jobs: - orchestration - sap-rpt - batch + - tabular-orchestration + - tabular-predict steps: - name: 'Checkout repository' diff --git a/.pipeline/checkstyle-suppressions.xml b/.pipeline/checkstyle-suppressions.xml index 4190a8ca4..d39e58042 100644 --- a/.pipeline/checkstyle-suppressions.xml +++ b/.pipeline/checkstyle-suppressions.xml @@ -8,14 +8,12 @@ - - - + diff --git a/.pipeline/spotbugs-exclusions.xml b/.pipeline/spotbugs-exclusions.xml index dc556e197..5d99250e4 100644 --- a/.pipeline/spotbugs-exclusions.xml +++ b/.pipeline/spotbugs-exclusions.xml @@ -11,6 +11,7 @@ + diff --git a/core-services/tabular-orchestration/pom.xml b/core-services/tabular-orchestration/pom.xml new file mode 100644 index 000000000..845551a87 --- /dev/null +++ b/core-services/tabular-orchestration/pom.xml @@ -0,0 +1,203 @@ + + + 4.0.0 + + com.sap.ai.sdk + sdk-parent + 1.26.0-SNAPSHOT + ../../pom.xml + + tabular-orchestration + Orchestration tabular prediction 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 tabular prediction 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 + ai-core-sdk@sap.com + SAP SE + https://www.sap.com + + + + scm:git:git://github.com/SAP/ai-sdk-java.git + scm:git:ssh://github.com:SAP/ai-sdk-java.git + https://github.com/SAP/ai-sdk-java/tree/main + + + ${project.basedir}/../../ + 80% + 91% + 89% + 50% + 88% + 100% + + + + + + com.sap.ai.sdk + core + + + com.sap.cloud.sdk.cloudplatform + cloudplatform-connectivity + + + com.sap.cloud.sdk.datamodel + openapi-core-apache + + + com.google.code.findbugs + jsr305 + + + com.google.guava + guava + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-core + + + + org.projectlombok + lombok + provided + + + + com.sap.cloud.sdk.cloudplatform + connectivity-apache-httpclient5 + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.wiremock + wiremock + test + + + org.assertj + assertj-core + test + + + + + + + com.github.siom79.japicmp + japicmp-maven-plugin + + + api-compatibility + + + + com.sap.ai.sdk.tabular.generated + + + + + + + + + + + + generate + + false + + generate + + + + + + com.sap.cloud.sdk.datamodel + openapi-generator-maven-plugin + + ${project.basedir}/src/main/java + true + COMPILE + true + + + + tabular-orchestration + + generate + + generate-sources + + ${project.basedir}/src/main/resources/spec/tabular-orchestration.yaml + com.sap.ai.sdk.tabular.generated.orchestration.model + com.sap.ai.sdk.tabular.generated.orchestration.client + + apache-httpclient + create + + protected + true + true + \. + 4 + true + true + true + true + + + + + tabular-prediction + + generate + + generate-sources + + ${project.basedir}/src/main/resources/spec/tabular-predict.json + com.sap.ai.sdk.tabular.generated.predict.model + com.sap.ai.sdk.tabular.generated.predict.client + + apache-httpclient + create + + protected + true + true + true + true + true + + + + + + + + + + diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/TabularClient.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/TabularClient.java new file mode 100644 index 000000000..ca984d6df --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/TabularClient.java @@ -0,0 +1,153 @@ +package com.sap.ai.sdk.tabular; + +import com.google.common.annotations.Beta; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.tabular.generated.orchestration.client.DataDestinationsApi; +import com.sap.ai.sdk.tabular.generated.orchestration.client.ScenarioConfigurationManagerApi; +import com.sap.ai.sdk.tabular.generated.orchestration.client.TabularArtifactsApi; +import com.sap.ai.sdk.tabular.generated.predict.client.PredictApi; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import com.sap.cloud.sdk.cloudplatform.connectivity.Header; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.experimental.Tolerate; +import lombok.val; + +/** + * Service class for the Tabular Orchestration APIs. + * + * @since 1.26.0 + */ +@RequiredArgsConstructor(access = AccessLevel.PUBLIC) +@Getter(value = AccessLevel.PROTECTED) +@Beta +public class TabularClient { + @Nonnull private final AiCoreService service; + @Nonnull private final String basePath; + @Nonnull private final List
customHeaders = new ArrayList<>(); + + // Only set in tests, to bypass real deployment resolution for the Predict API. + @Nullable private HttpDestination predictDestinationOverride; + + static final String DEFAULT_BASE_PATH = "/v2/tcr/"; + private static final String PREDICT_SCENARIO_ID = "tabular-orchestration"; + + /** Default constructor. */ + @Tolerate + public TabularClient() { + this(new AiCoreService()); + } + + /** + * Constructor with custom AI Core service instance. + * + * @param service The instance of AI Core service + */ + public TabularClient(final @Nonnull AiCoreService service) { + this(service, DEFAULT_BASE_PATH); + } + + /** + * Get the Data Destinations API. + * + * @return The Data Destinations API. + */ + @Nonnull + public DataDestinationsApi dataDestinations() { + return new DataDestinationsApi(getOrchestrationClient()); + } + + /** + * Get the Tabular Artifacts API. + * + * @return The Tabular Artifacts API. + */ + @Nonnull + public TabularArtifactsApi tabularArtifacts() { + return new TabularArtifactsApi(getOrchestrationClient()); + } + + /** + * Get the Scenario Configuration Manager API. + * + * @return The Scenario Configuration Manager API. + */ + @Nonnull + public ScenarioConfigurationManagerApi scenarioConfiguration() { + return new ScenarioConfigurationManagerApi(getOrchestrationClient()); + } + + /** + * Get the Predict API. + * + * @return The Predict API. + */ + @Nonnull + public PredictApi predict() { + return predict("default"); + } + + /** + * Get the Predict API. + * + * @param resourceGroup The resource group to use for getting the tabular deployment and making + * the prediction request. + * @return The Predict API. + */ + @Nonnull + public PredictApi predict(@Nonnull final String resourceGroup) { + final HttpDestination inferenceDestination = + predictDestinationOverride != null + ? predictDestinationOverride + : getService().getInferenceDestination(resourceGroup).forScenario(PREDICT_SCENARIO_ID); + val destination = + DefaultHttpDestination.fromDestination(inferenceDestination).headers(customHeaders).build(); + return new PredictApi(ApiClient.create(destination)); + } + + /** + * Create a new Tabular client with a custom header added to every call made with this client + * + * @param key the key of the custom header to add + * @param value the value of the custom header to add + * @return a new client. + */ + @Nonnull + public TabularClient withHeader(@Nonnull final String key, @Nonnull final String value) { + final var newClient = new TabularClient(this.service, this.basePath); + newClient.customHeaders.addAll(this.customHeaders); + newClient.customHeaders.add(new Header(key, value)); + return newClient; + } + + /** + * Override the destination used for {@link #predict()}, bypassing deployment resolution. + * + *

This is intended for testing purposes only. + * + * @param destination The destination to use for Predict API calls. + * @return this client, for chaining. + */ + @Nonnull + TabularClient withPredictDestination(@Nonnull final HttpDestination destination) { + this.predictDestinationOverride = destination; + return this; + } + + @Nonnull + private ApiClient getOrchestrationClient() { + final HttpDestination base = getService().getBaseDestination(); + final URI rootUri = base.getUri().resolve(getBasePath()); + val destination = + DefaultHttpDestination.fromDestination(base).uri(rootUri).headers(customHeaders).build(); + return ApiClient.create(destination); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/DataDestinationsApi.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/DataDestinationsApi.java new file mode 100644 index 000000000..496c6974f --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/DataDestinationsApi.java @@ -0,0 +1,760 @@ +package com.sap.ai.sdk.tabular.generated.orchestration.client; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.ai.sdk.tabular.generated.orchestration.model.AsyncCreateDataDestinationResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CreateDataDestination; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetDataDestination; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetDataDestinations; +import com.sap.ai.sdk.tabular.generated.orchestration.model.PatchDataDestination; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ValidateDataDestinationRequest; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ValidateDataDestinationResponse; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Context Registry in version 1.0.0. + * + *

Context Registry is a service for managing tabular data contexts for AI applications. It + * provides capabilities to register data destinations (object stores and data sharing platforms), + * create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios + * for context selection in AI-driven business solutions. + */ +public class DataDestinationsApi extends BaseApi { + + /** + * Instantiates this API class to invoke operations on the Context Registry. + * + * @param httpDestination The destination that API should be used with + */ + public DataDestinationsApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Context Registry based on a given + * {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + public DataDestinationsApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Creates a new API instance with additional default headers. + * + * @param defaultHeaders Additional headers to include in all requests + * @return A new API instance with the combined headers + */ + public DataDestinationsApi withDefaultHeaders(@Nonnull final Map defaultHeaders) { + final var api = new DataDestinationsApi(apiClient); + api.defaultHeaders.putAll(this.defaultHeaders); + api.defaultHeaders.putAll(defaultHeaders); + return api; + } + + /** + * Async Data Destination Creation + * + *

Create a data destination asynchronously. Schema validation happens synchronously; + * credential validation and secret storage run in a background task. Poll GET + * /dataDestinations/{name} to track progress via status and errorMessage. Returns 202 (not exists + * or ERROR retry), 409 (ACTIVE or DELETING), 422 (retry exhausted). + * + *

202 - Accepted - background task launched + * + *

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

409 - The resource conflicts with existing resources or has dependencies + * + *

422 - The request is valid but cannot be processed due to semantic errors + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param dataDestinationName Unique identifier for the data destination + * @param createDataDestination The value for the parameter createDataDestination + * @return AsyncCreateDataDestinationResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public AsyncCreateDataDestinationResponse createUpdateDataDestination( + @Nonnull final String aiResourceGroup, + @Nonnull final String dataDestinationName, + @Nonnull final CreateDataDestination createDataDestination) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createUpdateDataDestination") + .statusCode(400); + } + + // verify the required parameter 'dataDestinationName' is set + if (dataDestinationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'dataDestinationName' when calling createUpdateDataDestination") + .statusCode(400); + } + + // verify the required parameter 'createDataDestination' is set + if (createDataDestination == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'createDataDestination' when calling createUpdateDataDestination") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/dataDestinations/{dataDestinationName}" + .replaceAll( + "\\{" + "dataDestinationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(dataDestinationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + createDataDestination, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Delete Data Destination + * + *

Mark the data destination for deletion. Synchronously checks for dependent TabularArtifacts; + * returns 202 immediately after marking DELETING. The cron reaper handles secret deletion and + * hard delete. + * + *

202 - Accepted — data destination marked DELETING; cron handles cleanup + * + *

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

404 - The specified resource was not found + * + *

409 - The resource conflicts with existing resources or has dependencies + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param dataDestinationName The ID of the data destination 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 deleteDataDestinationByName( + @Nonnull final String aiResourceGroup, @Nonnull final String dataDestinationName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteDataDestinationByName") + .statusCode(400); + } + + // verify the required parameter 'dataDestinationName' is set + if (dataDestinationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'dataDestinationName' when calling deleteDataDestinationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/dataDestinations/{dataDestinationName}" + .replaceAll( + "\\{" + "dataDestinationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(dataDestinationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get Data Destination Details + * + *

Get metadata of a specific data destination (excluding credentials) + * + *

200 - Returns the data destination for the given ID + * + *

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

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param dataDestinationName The ID of the data destination to get + * @return GetDataDestination + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetDataDestination getDataDestinationByName( + @Nonnull final String aiResourceGroup, @Nonnull final String dataDestinationName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDataDestinationByName") + .statusCode(400); + } + + // verify the required parameter 'dataDestinationName' is set + if (dataDestinationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'dataDestinationName' when calling getDataDestinationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/dataDestinations/{dataDestinationName}" + .replaceAll( + "\\{" + "dataDestinationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(dataDestinationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get Data Destinations + * + *

Get all data destinations in the tenant (resource group) + * + *

200 - Returns all data destinations for the tenant + * + *

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

500 - Server error + * + * @param aiResourceGroup (required) Resource Group ID + * @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 GetDataDestinations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetDataDestinations getAllDataDestinations( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllDataDestinations") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/dataDestinations"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("$top", $top)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$skip", $skip)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$count", $count)); + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get Data Destinations + * + *

Get all data destinations in the tenant (resource group) + * + *

200 - Returns all data destinations for the tenant + * + *

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

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @return GetDataDestinations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetDataDestinations getAllDataDestinations(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getAllDataDestinations(aiResourceGroup, null, null, null); + } + + /** + * Update Data Destination + * + *

Update a data destination (excluding name and type) + * + *

204 - No Content + * + *

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

404 - The specified resource was not found + * + *

409 - The resource conflicts with existing resources or has dependencies + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param dataDestinationName The ID of the data destination to update + * @param patchDataDestination The value for the parameter patchDataDestination + * @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 patchDataDestinationByName( + @Nonnull final String aiResourceGroup, + @Nonnull final String dataDestinationName, + @Nonnull final PatchDataDestination patchDataDestination) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling patchDataDestinationByName") + .statusCode(400); + } + + // verify the required parameter 'dataDestinationName' is set + if (dataDestinationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'dataDestinationName' when calling patchDataDestinationByName") + .statusCode(400); + } + + // verify the required parameter 'patchDataDestination' is set + if (patchDataDestination == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'patchDataDestination' when calling patchDataDestinationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/dataDestinations/{dataDestinationName}" + .replaceAll( + "\\{" + "dataDestinationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(dataDestinationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + patchDataDestination, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Search Data Destinations + * + *

Search data destinations by label key-value pairs + * + *

200 - Returns data destinations matching the label selector + * + *

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

500 - Server error + * + * @param aiResourceGroup (required) Resource Group ID + * @param controllersDataDestinationV1EndpointsSearchDataDestinationsRequest (required) The value + * for the parameter controllersDataDestinationV1EndpointsSearchDataDestinationsRequest + * @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 GetDataDestinations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetDataDestinations searchDestinations( + @Nonnull final String aiResourceGroup, + @Nonnull + final ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest + controllersDataDestinationV1EndpointsSearchDataDestinationsRequest, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling searchDestinations") + .statusCode(400); + } + + // verify the required parameter + // 'controllersDataDestinationV1EndpointsSearchDataDestinationsRequest' is set + if (controllersDataDestinationV1EndpointsSearchDataDestinationsRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'controllersDataDestinationV1EndpointsSearchDataDestinationsRequest' when calling searchDataDestinations") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/dataDestinations/search"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("$top", $top)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$skip", $skip)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$count", $count)); + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + controllersDataDestinationV1EndpointsSearchDataDestinationsRequest, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Search Data Destinations + * + *

Search data destinations by label key-value pairs + * + *

200 - Returns data destinations matching the label selector + * + *

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

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param controllersDataDestinationV1EndpointsSearchDataDestinationsRequest The value for the + * parameter controllersDataDestinationV1EndpointsSearchDataDestinationsRequest + * @return GetDataDestinations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetDataDestinations searchDestinations( + @Nonnull final String aiResourceGroup, + @Nonnull + final ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest + controllersDataDestinationV1EndpointsSearchDataDestinationsRequest) + throws OpenApiRequestException { + return searchDestinations( + aiResourceGroup, + controllersDataDestinationV1EndpointsSearchDataDestinationsRequest, + null, + null, + null); + } + + /** + * Validate Data Destination (pre-creation) + * + *

Test provider connectivity before saving. Nothing is persisted. + * + *

200 - Validation result + * + *

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

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param validateDataDestinationRequest The value for the parameter + * validateDataDestinationRequest + * @return ValidateDataDestinationResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public ValidateDataDestinationResponse validateDataDestination( + @Nonnull final String aiResourceGroup, + @Nonnull final ValidateDataDestinationRequest validateDataDestinationRequest) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling validateDataDestination") + .statusCode(400); + } + + // verify the required parameter 'validateDataDestinationRequest' is set + if (validateDataDestinationRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'validateDataDestinationRequest' when calling validateDataDestination") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/dataDestinations/validate"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + validateDataDestinationRequest, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Validate Data Destination (post-creation) + * + *

Re-verify an already-saved destination using stored credentials. + * + *

200 - Validation result + * + *

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

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param dataDestinationName The name of the data destination to validate + * @return ValidateDataDestinationResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public ValidateDataDestinationResponse validateDataDestinationByName( + @Nonnull final String aiResourceGroup, @Nonnull final String dataDestinationName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling validateDataDestinationByName") + .statusCode(400); + } + + // verify the required parameter 'dataDestinationName' is set + if (dataDestinationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'dataDestinationName' when calling validateDataDestinationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/dataDestinations/{dataDestinationName}/validate" + .replaceAll( + "\\{" + "dataDestinationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(dataDestinationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/ScenarioConfigurationManagerApi.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/ScenarioConfigurationManagerApi.java new file mode 100644 index 000000000..2c32d3c33 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/ScenarioConfigurationManagerApi.java @@ -0,0 +1,596 @@ +package com.sap.ai.sdk.tabular.generated.orchestration.client; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CreateScenarioConfiguration; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetScenarioConfigurations; +import com.sap.ai.sdk.tabular.generated.orchestration.model.PatchScenarioConfiguration; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ScenarioConfigurationNameObject; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ScenarioConfigurationObject; +import com.sap.ai.sdk.tabular.generated.orchestration.model.SearchScenarioConfiguration; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Context Registry in version 1.0.0. + * + *

Context Registry is a service for managing tabular data contexts for AI applications. It + * provides capabilities to register data destinations (object stores and data sharing platforms), + * create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios + * for context selection in AI-driven business solutions. + */ +public class ScenarioConfigurationManagerApi extends BaseApi { + + /** + * Instantiates this API class to invoke operations on the Context Registry. + * + * @param httpDestination The destination that API should be used with + */ + public ScenarioConfigurationManagerApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Context Registry based on a given + * {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + public ScenarioConfigurationManagerApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Creates a new API instance with additional default headers. + * + * @param defaultHeaders Additional headers to include in all requests + * @return A new API instance with the combined headers + */ + public ScenarioConfigurationManagerApi withDefaultHeaders( + @Nonnull final Map defaultHeaders) { + final var api = new ScenarioConfigurationManagerApi(apiClient); + api.defaultHeaders.putAll(this.defaultHeaders); + api.defaultHeaders.putAll(defaultHeaders); + return api; + } + + /** + * Async Scenario Configuration Creation + * + *

Create a scenario configuration asynchronously. Schema validation happens synchronously; + * background processing runs asynchronously. Poll GET /scenarioConfigurations/{name} to track + * progress via status and errorMessage. Returns 202 (not exists or ERROR retry), 409 (ACTIVE or + * DELETING), 422 (retry exhausted). + * + *

202 - Accepted - background task launched + * + *

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

409 - The resource conflicts with existing resources or has dependencies + * + *

422 - The request is valid but cannot be processed due to semantic errors + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param scenarioConfigurationName Name of the scenario configuration + * @param createScenarioConfiguration The value for the parameter createScenarioConfiguration + * @return ScenarioConfigurationNameObject + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public ScenarioConfigurationNameObject createScenarioConfiguration( + @Nonnull final String aiResourceGroup, + @Nonnull final String scenarioConfigurationName, + @Nonnull final CreateScenarioConfiguration createScenarioConfiguration) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createScenarioConfiguration") + .statusCode(400); + } + + // verify the required parameter 'scenarioConfigurationName' is set + if (scenarioConfigurationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'scenarioConfigurationName' when calling createScenarioConfiguration") + .statusCode(400); + } + + // verify the required parameter 'createScenarioConfiguration' is set + if (createScenarioConfiguration == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'createScenarioConfiguration' when calling createScenarioConfiguration") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/scenarioConfigurations/{scenarioConfigurationName}" + .replaceAll( + "\\{" + "scenarioConfigurationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(scenarioConfigurationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + createScenarioConfiguration, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Delete Scenario Configuration + * + *

Delete a scenario configuration by name + * + *

204 - No Content + * + *

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

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param scenarioConfigurationName The name of the scenario configuration 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 deleteScenarioConfigurationByName( + @Nonnull final String aiResourceGroup, @Nonnull final String scenarioConfigurationName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteScenarioConfigurationByName") + .statusCode(400); + } + + // verify the required parameter 'scenarioConfigurationName' is set + if (scenarioConfigurationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'scenarioConfigurationName' when calling deleteScenarioConfigurationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/scenarioConfigurations/{scenarioConfigurationName}" + .replaceAll( + "\\{" + "scenarioConfigurationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(scenarioConfigurationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get All Scenario Configurations + * + *

Get all scenario configurations in the tenant (resource group) + * + *

200 - Returns all scenario configurations for the tenant + * + *

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

500 - Server error + * + * @param aiResourceGroup (required) Resource Group ID + * @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 GetScenarioConfigurations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetScenarioConfigurations getAllScenarioConfigurations( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllScenarioConfigurations") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/scenarioConfigurations"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("$top", $top)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$skip", $skip)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$count", $count)); + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get All Scenario Configurations + * + *

Get all scenario configurations in the tenant (resource group) + * + *

200 - Returns all scenario configurations for the tenant + * + *

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

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @return GetScenarioConfigurations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetScenarioConfigurations getAllScenarioConfigurations( + @Nonnull final String aiResourceGroup) throws OpenApiRequestException { + return getAllScenarioConfigurations(aiResourceGroup, null, null, null); + } + + /** + * Get Scenario Configuration By Name + * + *

Get a scenario configuration by its name + * + *

200 - Returns the scenario configuration object + * + *

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

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param scenarioConfigurationName The name of the scenario configuration to retrieve + * @return ScenarioConfigurationObject + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public ScenarioConfigurationObject getScenarioConfigurationByName( + @Nonnull final String aiResourceGroup, @Nonnull final String scenarioConfigurationName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getScenarioConfigurationByName") + .statusCode(400); + } + + // verify the required parameter 'scenarioConfigurationName' is set + if (scenarioConfigurationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'scenarioConfigurationName' when calling getScenarioConfigurationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/scenarioConfigurations/{scenarioConfigurationName}" + .replaceAll( + "\\{" + "scenarioConfigurationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(scenarioConfigurationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Update Scenario Configuration + * + *

Update a scenario configuration (excluding name) + * + *

204 - No Content + * + *

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

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param scenarioConfigurationName The name of the scenario configuration to update + * @param patchScenarioConfiguration The value for the parameter patchScenarioConfiguration + * @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 patchScenarioConfigurationByName( + @Nonnull final String aiResourceGroup, + @Nonnull final String scenarioConfigurationName, + @Nonnull final PatchScenarioConfiguration patchScenarioConfiguration) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling patchScenarioConfigurationByName") + .statusCode(400); + } + + // verify the required parameter 'scenarioConfigurationName' is set + if (scenarioConfigurationName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'scenarioConfigurationName' when calling patchScenarioConfigurationByName") + .statusCode(400); + } + + // verify the required parameter 'patchScenarioConfiguration' is set + if (patchScenarioConfiguration == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'patchScenarioConfiguration' when calling patchScenarioConfigurationByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/scenarioConfigurations/{scenarioConfigurationName}" + .replaceAll( + "\\{" + "scenarioConfigurationName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(scenarioConfigurationName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + patchScenarioConfiguration, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Search Scenario Configurations by Labels + * + *

Search for scenario configurations that match ALL specified labels (AND logic) + * + *

200 - Returns scenario configurations matching all specified labels + * + *

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

500 - Server error + * + * @param aiResourceGroup (required) Resource Group ID + * @param searchScenarioConfiguration (required) The value for the parameter + * searchScenarioConfiguration + * @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 GetScenarioConfigurations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetScenarioConfigurations searchScenarioConfigurationsByLabel( + @Nonnull final String aiResourceGroup, + @Nonnull final SearchScenarioConfiguration searchScenarioConfiguration, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling searchScenarioConfigurationsByLabel") + .statusCode(400); + } + + // verify the required parameter 'searchScenarioConfiguration' is set + if (searchScenarioConfiguration == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'searchScenarioConfiguration' when calling searchScenarioConfigurationsByLabel") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/scenarioConfigurations/search"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("$top", $top)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$skip", $skip)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$count", $count)); + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + searchScenarioConfiguration, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Search Scenario Configurations by Labels + * + *

Search for scenario configurations that match ALL specified labels (AND logic) + * + *

200 - Returns scenario configurations matching all specified labels + * + *

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

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param searchScenarioConfiguration The value for the parameter searchScenarioConfiguration + * @return GetScenarioConfigurations + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetScenarioConfigurations searchScenarioConfigurationsByLabel( + @Nonnull final String aiResourceGroup, + @Nonnull final SearchScenarioConfiguration searchScenarioConfiguration) + throws OpenApiRequestException { + return searchScenarioConfigurationsByLabel( + aiResourceGroup, searchScenarioConfiguration, null, null, null); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/TabularArtifactsApi.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/TabularArtifactsApi.java new file mode 100644 index 000000000..a284649e9 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/client/TabularArtifactsApi.java @@ -0,0 +1,480 @@ +package com.sap.ai.sdk.tabular.generated.orchestration.client; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CreateTARequest; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactDataPreview; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactDetails; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactListResponse; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Context Registry in version 1.0.0. + * + *

Context Registry is a service for managing tabular data contexts for AI applications. It + * provides capabilities to register data destinations (object stores and data sharing platforms), + * create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios + * for context selection in AI-driven business solutions. + */ +public class TabularArtifactsApi extends BaseApi { + + /** + * Instantiates this API class to invoke operations on the Context Registry. + * + * @param httpDestination The destination that API should be used with + */ + public TabularArtifactsApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Context Registry based on a given + * {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + public TabularArtifactsApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Creates a new API instance with additional default headers. + * + * @param defaultHeaders Additional headers to include in all requests + * @return A new API instance with the combined headers + */ + public TabularArtifactsApi withDefaultHeaders(@Nonnull final Map defaultHeaders) { + final var api = new TabularArtifactsApi(apiClient); + api.defaultHeaders.putAll(this.defaultHeaders); + api.defaultHeaders.putAll(defaultHeaders); + return api; + } + + /** + * Async Tabular Artifact Creation + * + *

Create a Tabular Artifact asynchronously. Schema validation happens synchronously; resource + * creation runs in a background task. Poll GET /tabularArtifacts/{name} to track progress via + * status and errorMessage. Returns 202 (not exists or ERROR retry), 409 (ACTIVE or DELETING), 422 + * (retry exhausted). + * + *

202 - Accepted - Tabular Artifact creation request accepted + * + *

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

409 - The resource conflicts with existing resources or has dependencies + * + *

422 - The request is valid but cannot be processed due to semantic errors + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param tabularArtifactName Unique name of the Tabular Artifact + * @param createTARequest The value for the parameter createTARequest + * @return ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response + createTabularArtifact( + @Nonnull final String aiResourceGroup, + @Nonnull final String tabularArtifactName, + @Nonnull final CreateTARequest createTARequest) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling createTabularArtifact") + .statusCode(400); + } + + // verify the required parameter 'tabularArtifactName' is set + if (tabularArtifactName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'tabularArtifactName' when calling createTabularArtifact") + .statusCode(400); + } + + // verify the required parameter 'createTARequest' is set + if (createTARequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'createTARequest' when calling createTabularArtifact") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/tabularArtifacts/{tabularArtifactName}" + .replaceAll( + "\\{" + "tabularArtifactName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(tabularArtifactName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference + localVarReturnType = + new TypeReference< + ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response>() {}; + + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + createTARequest, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Delete Tabular Artifact + * + *

Delete a specific Tabular Artifact by name + * + *

202 - Accepted — the Tabular Artifact has been marked for deletion and will be + * removed asynchronously + * + *

404 - The specified resource was not found + * + *

409 - The resource conflicts with existing resources or has dependencies + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param tabularArtifactName Unique name of the Tabular Artifact. Must match allowed pattern and + * length constraints. + * @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 deleteTabularArtifact( + @Nonnull final String aiResourceGroup, @Nonnull final String tabularArtifactName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling deleteTabularArtifact") + .statusCode(400); + } + + // verify the required parameter 'tabularArtifactName' is set + if (tabularArtifactName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'tabularArtifactName' when calling deleteTabularArtifact") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/tabularArtifacts/{tabularArtifactName}" + .replaceAll( + "\\{" + "tabularArtifactName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(tabularArtifactName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get all Tabular Artifacts + * + *

Retrieve list of Tabular Artifacts with pagination + * + *

200 - Tabular Artifacts retrieved successfully + * + *

500 - Server error + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup (required) Resource Group ID + * @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 TabularArtifactListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public TabularArtifactListResponse getAllTabularArtifacts( + @Nonnull final String aiResourceGroup, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllTabularArtifacts") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/tabularArtifacts"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("$top", $top)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$skip", $skip)); + localVarQueryParams.addAll(ApiClient.parameterToPair("$count", $count)); + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get all Tabular Artifacts + * + *

Retrieve list of Tabular Artifacts with pagination + * + *

200 - Tabular Artifacts retrieved successfully + * + *

500 - Server error + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup Resource Group ID + * @return TabularArtifactListResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public TabularArtifactListResponse getAllTabularArtifacts(@Nonnull final String aiResourceGroup) + throws OpenApiRequestException { + return getAllTabularArtifacts(aiResourceGroup, null, null, null); + } + + /** + * Get Tabular Artifact Details with Metadata + * + *

Retrieve details of a specific Tabular Artifact by name including schema metadata. + * + *

200 - Tabular Artifact details retrieved successfully + * + *

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param tabularArtifactName Unique name of the Tabular Artifact. Must match allowed pattern and + * length constraints. + * @return TabularArtifactDetails + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public TabularArtifactDetails getTabularArtifactByName( + @Nonnull final String aiResourceGroup, @Nonnull final String tabularArtifactName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getTabularArtifactByName") + .statusCode(400); + } + + // verify the required parameter 'tabularArtifactName' is set + if (tabularArtifactName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'tabularArtifactName' when calling getTabularArtifactByName") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/tabularArtifacts/{tabularArtifactName}" + .replaceAll( + "\\{" + "tabularArtifactName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(tabularArtifactName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Get Tabular Artifact Data Preview + * + *

Retrieve a preview of data rows from the Virtual Table (first 10 records) + * + *

200 - Tabular Artifact data preview retrieved successfully + * + *

404 - The specified resource was not found + * + *

500 - Server error + * + * @param aiResourceGroup Resource Group ID + * @param tabularArtifactName Unique name of the Tabular Artifact. Must match allowed pattern and + * length constraints. + * @return TabularArtifactDataPreview + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public TabularArtifactDataPreview getTabularArtifactData( + @Nonnull final String aiResourceGroup, @Nonnull final String tabularArtifactName) + throws OpenApiRequestException { + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getTabularArtifactData") + .statusCode(400); + } + + // verify the required parameter 'tabularArtifactName' is set + if (tabularArtifactName == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'tabularArtifactName' when calling getTabularArtifactData") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/tabularArtifacts/{tabularArtifactName}/data" + .replaceAll( + "\\{" + "tabularArtifactName" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(tabularArtifactName))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ApiError.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ApiError.java new file mode 100644 index 000000000..be492f43a --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ApiError.java @@ -0,0 +1,360 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** 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. */ + 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. + * + * @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 + "'."); + } + 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. + * + * @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/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AsyncCreateDataDestinationResponse.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AsyncCreateDataDestinationResponse.java new file mode 100644 index 000000000..3491180b0 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AsyncCreateDataDestinationResponse.java @@ -0,0 +1,249 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** AsyncCreateDataDestinationResponse */ +// CHECKSTYLE:OFF +public class AsyncCreateDataDestinationResponse +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("subjectPatterns") + private List subjectPatterns = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AsyncCreateDataDestinationResponse. */ + protected AsyncCreateDataDestinationResponse() {} + + /** + * Set the name of this {@link AsyncCreateDataDestinationResponse} instance and return the same + * instance. + * + * @param name Name of the data destination being created + * @return The same instance of this {@link AsyncCreateDataDestinationResponse} class + */ + @Nonnull + public AsyncCreateDataDestinationResponse name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * Name of the data destination being created + * + * @return name The name of this {@link AsyncCreateDataDestinationResponse} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link AsyncCreateDataDestinationResponse} instance. + * + * @param name Name of the data destination being created + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the subjectPatterns of this {@link AsyncCreateDataDestinationResponse} instance and return + * the same instance. + * + * @param subjectPatterns Subject pattern for HDL authentication and btp cred store + * @return The same instance of this {@link AsyncCreateDataDestinationResponse} class + */ + @Nonnull + public AsyncCreateDataDestinationResponse subjectPatterns( + @Nullable final List subjectPatterns) { + this.subjectPatterns = subjectPatterns; + return this; + } + + /** + * Add one subjectPatterns instance to this {@link AsyncCreateDataDestinationResponse}. + * + * @param subjectPatternsItem The subjectPatterns that should be added + * @return The same instance of type {@link AsyncCreateDataDestinationResponse} + */ + @Nonnull + public AsyncCreateDataDestinationResponse addSubjectPatternsItem( + @Nonnull final String subjectPatternsItem) { + if (this.subjectPatterns == null) { + this.subjectPatterns = new ArrayList<>(); + } + this.subjectPatterns.add(subjectPatternsItem); + return this; + } + + /** + * Subject pattern for HDL authentication and btp cred store + * + * @return subjectPatterns The subjectPatterns of this {@link AsyncCreateDataDestinationResponse} + * instance. + */ + @Nonnull + public List getSubjectPatterns() { + return subjectPatterns; + } + + /** + * Set the subjectPatterns of this {@link AsyncCreateDataDestinationResponse} instance. + * + * @param subjectPatterns Subject pattern for HDL authentication and btp cred store + */ + public void setSubjectPatterns(@Nullable final List subjectPatterns) { + this.subjectPatterns = subjectPatterns; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AsyncCreateDataDestinationResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AsyncCreateDataDestinationResponse} + * 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( + "AsyncCreateDataDestinationResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AsyncCreateDataDestinationResponse} 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 (subjectPatterns != null) declaredFields.put("subjectPatterns", subjectPatterns); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AsyncCreateDataDestinationResponse} 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 AsyncCreateDataDestinationResponse asyncCreateDataDestinationResponse = + (AsyncCreateDataDestinationResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, asyncCreateDataDestinationResponse.cloudSdkCustomFields) + && Objects.equals(this.name, asyncCreateDataDestinationResponse.name) + && Objects.equals(this.subjectPatterns, asyncCreateDataDestinationResponse.subjectPatterns); + } + + @Override + public int hashCode() { + return Objects.hash(name, subjectPatterns, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AsyncCreateDataDestinationResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subjectPatterns: ").append(toIndentedString(subjectPatterns)).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 + * AsyncCreateDataDestinationResponse} instance with all required arguments. + */ + public static Builder create() { + return (name) -> new AsyncCreateDataDestinationResponse().name(name); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link AsyncCreateDataDestinationResponse} instance. + * + * @param name Name of the data destination being created + * @return The AsyncCreateDataDestinationResponse instance. + */ + AsyncCreateDataDestinationResponse name(@Nonnull final String name); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinition.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinition.java new file mode 100644 index 000000000..3d4a6163c --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinition.java @@ -0,0 +1,221 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** AutoDefinition */ +// CHECKSTYLE:OFF +public class AutoDefinition implements CSNDefinition +// CHECKSTYLE:ON +{ + @JsonProperty("definitionType") + private DefinitionType definitionType; + + @JsonProperty("autoConfig") + private AutoDefinitionAutoConfig autoConfig; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AutoDefinition. */ + protected AutoDefinition() {} + + /** + * Set the definitionType of this {@link AutoDefinition} instance and return the same instance. + * + * @param definitionType The definitionType of this {@link AutoDefinition} + * @return The same instance of this {@link AutoDefinition} class + */ + @Nonnull + public AutoDefinition definitionType(@Nonnull final DefinitionType definitionType) { + this.definitionType = definitionType; + return this; + } + + /** + * Get definitionType + * + * @return definitionType The definitionType of this {@link AutoDefinition} instance. + */ + @Nonnull + public DefinitionType getDefinitionType() { + return definitionType; + } + + /** + * Set the definitionType of this {@link AutoDefinition} instance. + * + * @param definitionType The definitionType of this {@link AutoDefinition} + */ + public void setDefinitionType(@Nonnull final DefinitionType definitionType) { + this.definitionType = definitionType; + } + + /** + * Set the autoConfig of this {@link AutoDefinition} instance and return the same instance. + * + * @param autoConfig The autoConfig of this {@link AutoDefinition} + * @return The same instance of this {@link AutoDefinition} class + */ + @Nonnull + public AutoDefinition autoConfig(@Nullable final AutoDefinitionAutoConfig autoConfig) { + this.autoConfig = autoConfig; + return this; + } + + /** + * Get autoConfig + * + * @return autoConfig The autoConfig of this {@link AutoDefinition} instance. + */ + @Nonnull + public AutoDefinitionAutoConfig getAutoConfig() { + return autoConfig; + } + + /** + * Set the autoConfig of this {@link AutoDefinition} instance. + * + * @param autoConfig The autoConfig of this {@link AutoDefinition} + */ + public void setAutoConfig(@Nullable final AutoDefinitionAutoConfig autoConfig) { + this.autoConfig = autoConfig; + } + + /** + * Get the names of the unrecognizable properties of the {@link AutoDefinition}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AutoDefinition} 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("AutoDefinition has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AutoDefinition} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (definitionType != null) declaredFields.put("definitionType", definitionType); + if (autoConfig != null) declaredFields.put("autoConfig", autoConfig); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AutoDefinition} 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 AutoDefinition autoDefinition = (AutoDefinition) o; + return Objects.equals(this.cloudSdkCustomFields, autoDefinition.cloudSdkCustomFields) + && Objects.equals(this.definitionType, autoDefinition.definitionType) + && Objects.equals(this.autoConfig, autoDefinition.autoConfig); + } + + @Override + public int hashCode() { + return Objects.hash(definitionType, autoConfig, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AutoDefinition {\n"); + sb.append(" definitionType: ").append(toIndentedString(definitionType)).append("\n"); + sb.append(" autoConfig: ").append(toIndentedString(autoConfig)).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 AutoDefinition} + * instance with all required arguments. + */ + public static Builder create() { + return (definitionType) -> new AutoDefinition().definitionType(definitionType); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the definitionType of this {@link AutoDefinition} instance. + * + * @param definitionType The definitionType of this {@link AutoDefinition} + * @return The AutoDefinition instance. + */ + AutoDefinition definitionType(@Nonnull final DefinitionType definitionType); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinitionAutoConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinitionAutoConfig.java new file mode 100644 index 000000000..a20a3502a --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinitionAutoConfig.java @@ -0,0 +1,173 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** Optional configuration for AUTO schema derivation */ +// CHECKSTYLE:OFF +public class AutoDefinitionAutoConfig +// CHECKSTYLE:ON +{ + @JsonProperty("csvOptions") + private AutoDefinitionAutoConfigCsvOptions csvOptions; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AutoDefinitionAutoConfig. */ + protected AutoDefinitionAutoConfig() {} + + /** + * Set the csvOptions of this {@link AutoDefinitionAutoConfig} instance and return the same + * instance. + * + * @param csvOptions The csvOptions of this {@link AutoDefinitionAutoConfig} + * @return The same instance of this {@link AutoDefinitionAutoConfig} class + */ + @Nonnull + public AutoDefinitionAutoConfig csvOptions( + @Nullable final AutoDefinitionAutoConfigCsvOptions csvOptions) { + this.csvOptions = csvOptions; + return this; + } + + /** + * Get csvOptions + * + * @return csvOptions The csvOptions of this {@link AutoDefinitionAutoConfig} instance. + */ + @Nonnull + public AutoDefinitionAutoConfigCsvOptions getCsvOptions() { + return csvOptions; + } + + /** + * Set the csvOptions of this {@link AutoDefinitionAutoConfig} instance. + * + * @param csvOptions The csvOptions of this {@link AutoDefinitionAutoConfig} + */ + public void setCsvOptions(@Nullable final AutoDefinitionAutoConfigCsvOptions csvOptions) { + this.csvOptions = csvOptions; + } + + /** + * Get the names of the unrecognizable properties of the {@link AutoDefinitionAutoConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AutoDefinitionAutoConfig} 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( + "AutoDefinitionAutoConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AutoDefinitionAutoConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (csvOptions != null) declaredFields.put("csvOptions", csvOptions); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AutoDefinitionAutoConfig} 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 AutoDefinitionAutoConfig autoDefinitionAutoConfig = (AutoDefinitionAutoConfig) o; + return Objects.equals(this.cloudSdkCustomFields, autoDefinitionAutoConfig.cloudSdkCustomFields) + && Objects.equals(this.csvOptions, autoDefinitionAutoConfig.csvOptions); + } + + @Override + public int hashCode() { + return Objects.hash(csvOptions, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AutoDefinitionAutoConfig {\n"); + sb.append(" csvOptions: ").append(toIndentedString(csvOptions)).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 AutoDefinitionAutoConfig} instance. No arguments are required. */ + public static AutoDefinitionAutoConfig create() { + return new AutoDefinitionAutoConfig(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinitionAutoConfigCsvOptions.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinitionAutoConfigCsvOptions.java new file mode 100644 index 000000000..af7e8de59 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AutoDefinitionAutoConfigCsvOptions.java @@ -0,0 +1,223 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** Optional CSV-specific options (only for CSV type files) */ +// CHECKSTYLE:OFF +public class AutoDefinitionAutoConfigCsvOptions +// CHECKSTYLE:ON +{ + @JsonProperty("columnListInFirstRow") + private Boolean columnListInFirstRow = true; + + @JsonProperty("delimiter") + private String delimiter = ","; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AutoDefinitionAutoConfigCsvOptions. */ + protected AutoDefinitionAutoConfigCsvOptions() {} + + /** + * Set the columnListInFirstRow of this {@link AutoDefinitionAutoConfigCsvOptions} instance and + * return the same instance. + * + * @param columnListInFirstRow Whether CSV has column names in first row + * @return The same instance of this {@link AutoDefinitionAutoConfigCsvOptions} class + */ + @Nonnull + public AutoDefinitionAutoConfigCsvOptions columnListInFirstRow( + @Nullable final Boolean columnListInFirstRow) { + this.columnListInFirstRow = columnListInFirstRow; + return this; + } + + /** + * Whether CSV has column names in first row + * + * @return columnListInFirstRow The columnListInFirstRow of this {@link + * AutoDefinitionAutoConfigCsvOptions} instance. + */ + @Nonnull + public Boolean isColumnListInFirstRow() { + return columnListInFirstRow; + } + + /** + * Set the columnListInFirstRow of this {@link AutoDefinitionAutoConfigCsvOptions} instance. + * + * @param columnListInFirstRow Whether CSV has column names in first row + */ + public void setColumnListInFirstRow(@Nullable final Boolean columnListInFirstRow) { + this.columnListInFirstRow = columnListInFirstRow; + } + + /** + * Set the delimiter of this {@link AutoDefinitionAutoConfigCsvOptions} instance and return the + * same instance. + * + * @param delimiter CSV delimiter character + * @return The same instance of this {@link AutoDefinitionAutoConfigCsvOptions} class + */ + @Nonnull + public AutoDefinitionAutoConfigCsvOptions delimiter(@Nullable final String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * CSV delimiter character + * + * @return delimiter The delimiter of this {@link AutoDefinitionAutoConfigCsvOptions} instance. + */ + @Nonnull + public String getDelimiter() { + return delimiter; + } + + /** + * Set the delimiter of this {@link AutoDefinitionAutoConfigCsvOptions} instance. + * + * @param delimiter CSV delimiter character + */ + public void setDelimiter(@Nullable final String delimiter) { + this.delimiter = delimiter; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AutoDefinitionAutoConfigCsvOptions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AutoDefinitionAutoConfigCsvOptions} + * 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( + "AutoDefinitionAutoConfigCsvOptions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AutoDefinitionAutoConfigCsvOptions} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (columnListInFirstRow != null) + declaredFields.put("columnListInFirstRow", columnListInFirstRow); + if (delimiter != null) declaredFields.put("delimiter", delimiter); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AutoDefinitionAutoConfigCsvOptions} 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 AutoDefinitionAutoConfigCsvOptions autoDefinitionAutoConfigCsvOptions = + (AutoDefinitionAutoConfigCsvOptions) o; + return Objects.equals( + this.cloudSdkCustomFields, autoDefinitionAutoConfigCsvOptions.cloudSdkCustomFields) + && Objects.equals( + this.columnListInFirstRow, autoDefinitionAutoConfigCsvOptions.columnListInFirstRow) + && Objects.equals(this.delimiter, autoDefinitionAutoConfigCsvOptions.delimiter); + } + + @Override + public int hashCode() { + return Objects.hash(columnListInFirstRow, delimiter, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AutoDefinitionAutoConfigCsvOptions {\n"); + sb.append(" columnListInFirstRow: ") + .append(toIndentedString(columnListInFirstRow)) + .append("\n"); + sb.append(" delimiter: ").append(toIndentedString(delimiter)).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 AutoDefinitionAutoConfigCsvOptions} instance. No arguments are required. + */ + public static AutoDefinitionAutoConfigCsvOptions create() { + return new AutoDefinitionAutoConfigCsvOptions(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureConnectionConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureConnectionConfig.java new file mode 100644 index 000000000..dc68f18c2 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureConnectionConfig.java @@ -0,0 +1,301 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** AzureConnectionConfig */ +// CHECKSTYLE:OFF +public class AzureConnectionConfig +// CHECKSTYLE:ON +{ + @JsonProperty("account_name") + private String accountName; + + @JsonProperty("container_uri") + private String containerUri; + + @JsonProperty("sas_token") + private String sasToken; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureConnectionConfig. */ + protected AzureConnectionConfig() {} + + /** + * Set the accountName of this {@link AzureConnectionConfig} instance and return the same + * instance. + * + * @param accountName Azure storage account name (maps to user= in HANA credential) + * @return The same instance of this {@link AzureConnectionConfig} class + */ + @Nonnull + public AzureConnectionConfig accountName(@Nonnull final String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Azure storage account name (maps to user= in HANA credential) + * + * @return accountName The accountName of this {@link AzureConnectionConfig} instance. + */ + @Nonnull + public String getAccountName() { + return accountName; + } + + /** + * Set the accountName of this {@link AzureConnectionConfig} instance. + * + * @param accountName Azure storage account name (maps to user= in HANA credential) + */ + public void setAccountName(@Nonnull final String accountName) { + this.accountName = accountName; + } + + /** + * Set the containerUri of this {@link AzureConnectionConfig} instance and return the same + * instance. + * + * @param containerUri Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to + * derive the HANA adls endpoint. + * @return The same instance of this {@link AzureConnectionConfig} class + */ + @Nonnull + public AzureConnectionConfig containerUri(@Nonnull final String containerUri) { + this.containerUri = containerUri; + return this; + } + + /** + * Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to derive + * the HANA adls endpoint. + * + * @return containerUri The containerUri of this {@link AzureConnectionConfig} instance. + */ + @Nonnull + public String getContainerUri() { + return containerUri; + } + + /** + * Set the containerUri of this {@link AzureConnectionConfig} instance. + * + * @param containerUri Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to + * derive the HANA adls endpoint. + */ + public void setContainerUri(@Nonnull final String containerUri) { + this.containerUri = containerUri; + } + + /** + * Set the sasToken of this {@link AzureConnectionConfig} instance and return the same instance. + * + * @param sasToken SAS token (raw, percent-encoded characters stored as-is). Must grant read + + * list (r + l) on the container. + * @return The same instance of this {@link AzureConnectionConfig} class + */ + @Nonnull + public AzureConnectionConfig sasToken(@Nonnull final String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * SAS token (raw, percent-encoded characters stored as-is). Must grant read + list (r + l) on the + * container. + * + * @return sasToken The sasToken of this {@link AzureConnectionConfig} instance. + */ + @Nonnull + public String getSasToken() { + return sasToken; + } + + /** + * Set the sasToken of this {@link AzureConnectionConfig} instance. + * + * @param sasToken SAS token (raw, percent-encoded characters stored as-is). Must grant read + + * list (r + l) on the container. + */ + public void setSasToken(@Nonnull final String sasToken) { + this.sasToken = sasToken; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureConnectionConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureConnectionConfig} 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( + "AzureConnectionConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureConnectionConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (accountName != null) declaredFields.put("accountName", accountName); + if (containerUri != null) declaredFields.put("containerUri", containerUri); + if (sasToken != null) declaredFields.put("sasToken", sasToken); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureConnectionConfig} 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 AzureConnectionConfig azureConnectionConfig = (AzureConnectionConfig) o; + return Objects.equals(this.cloudSdkCustomFields, azureConnectionConfig.cloudSdkCustomFields) + && Objects.equals(this.accountName, azureConnectionConfig.accountName) + && Objects.equals(this.containerUri, azureConnectionConfig.containerUri) + && Objects.equals(this.sasToken, azureConnectionConfig.sasToken); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, containerUri, sasToken, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureConnectionConfig {\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" containerUri: ").append(toIndentedString(containerUri)).append("\n"); + sb.append(" sasToken: ").append(toIndentedString(sasToken)).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 AzureConnectionConfig} + * instance with all required arguments. + */ + public static Builder create() { + return (accountName) -> + (containerUri) -> + (sasToken) -> + new AzureConnectionConfig() + .accountName(accountName) + .containerUri(containerUri) + .sasToken(sasToken); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the accountName of this {@link AzureConnectionConfig} instance. + * + * @param accountName Azure storage account name (maps to user= in HANA credential) + * @return The AzureConnectionConfig builder. + */ + Builder1 accountName(@Nonnull final String accountName); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the containerUri of this {@link AzureConnectionConfig} instance. + * + * @param containerUri Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to + * derive the HANA adls endpoint. + * @return The AzureConnectionConfig builder. + */ + Builder2 containerUri(@Nonnull final String containerUri); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sasToken of this {@link AzureConnectionConfig} instance. + * + * @param sasToken SAS token (raw, percent-encoded characters stored as-is). Must grant read + + * list (r + l) on the container. + * @return The AzureConnectionConfig instance. + */ + AzureConnectionConfig sasToken(@Nonnull final String sasToken); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureConnectionConfigBase.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureConnectionConfigBase.java new file mode 100644 index 000000000..ffb61306b --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureConnectionConfigBase.java @@ -0,0 +1,257 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** AzureConnectionConfigBase */ +// CHECKSTYLE:OFF +public class AzureConnectionConfigBase +// CHECKSTYLE:ON +{ + @JsonProperty("account_name") + private String accountName; + + @JsonProperty("container_uri") + private String containerUri; + + @JsonProperty("sas_token") + private String sasToken; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureConnectionConfigBase. */ + protected AzureConnectionConfigBase() {} + + /** + * Set the accountName of this {@link AzureConnectionConfigBase} instance and return the same + * instance. + * + * @param accountName Azure storage account name (maps to user= in HANA credential) + * @return The same instance of this {@link AzureConnectionConfigBase} class + */ + @Nonnull + public AzureConnectionConfigBase accountName(@Nullable final String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Azure storage account name (maps to user= in HANA credential) + * + * @return accountName The accountName of this {@link AzureConnectionConfigBase} instance. + */ + @Nonnull + public String getAccountName() { + return accountName; + } + + /** + * Set the accountName of this {@link AzureConnectionConfigBase} instance. + * + * @param accountName Azure storage account name (maps to user= in HANA credential) + */ + public void setAccountName(@Nullable final String accountName) { + this.accountName = accountName; + } + + /** + * Set the containerUri of this {@link AzureConnectionConfigBase} instance and return the same + * instance. + * + * @param containerUri Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to + * derive the HANA adls endpoint. + * @return The same instance of this {@link AzureConnectionConfigBase} class + */ + @Nonnull + public AzureConnectionConfigBase containerUri(@Nullable final String containerUri) { + this.containerUri = containerUri; + return this; + } + + /** + * Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to derive + * the HANA adls endpoint. + * + * @return containerUri The containerUri of this {@link AzureConnectionConfigBase} instance. + */ + @Nonnull + public String getContainerUri() { + return containerUri; + } + + /** + * Set the containerUri of this {@link AzureConnectionConfigBase} instance. + * + * @param containerUri Full container URI from the BTP Object Store service key (e.g. + * https://account.z2.blob.storage.azure.net/container). TCR strips the https:// prefix to + * derive the HANA adls endpoint. + */ + public void setContainerUri(@Nullable final String containerUri) { + this.containerUri = containerUri; + } + + /** + * Set the sasToken of this {@link AzureConnectionConfigBase} instance and return the same + * instance. + * + * @param sasToken SAS token (raw, percent-encoded characters stored as-is). Must grant read + + * list (r + l) on the container. + * @return The same instance of this {@link AzureConnectionConfigBase} class + */ + @Nonnull + public AzureConnectionConfigBase sasToken(@Nullable final String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * SAS token (raw, percent-encoded characters stored as-is). Must grant read + list (r + l) on the + * container. + * + * @return sasToken The sasToken of this {@link AzureConnectionConfigBase} instance. + */ + @Nonnull + public String getSasToken() { + return sasToken; + } + + /** + * Set the sasToken of this {@link AzureConnectionConfigBase} instance. + * + * @param sasToken SAS token (raw, percent-encoded characters stored as-is). Must grant read + + * list (r + l) on the container. + */ + public void setSasToken(@Nullable final String sasToken) { + this.sasToken = sasToken; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureConnectionConfigBase}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureConnectionConfigBase} 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( + "AzureConnectionConfigBase has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureConnectionConfigBase} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (accountName != null) declaredFields.put("accountName", accountName); + if (containerUri != null) declaredFields.put("containerUri", containerUri); + if (sasToken != null) declaredFields.put("sasToken", sasToken); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureConnectionConfigBase} 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 AzureConnectionConfigBase azureConnectionConfigBase = (AzureConnectionConfigBase) o; + return Objects.equals(this.cloudSdkCustomFields, azureConnectionConfigBase.cloudSdkCustomFields) + && Objects.equals(this.accountName, azureConnectionConfigBase.accountName) + && Objects.equals(this.containerUri, azureConnectionConfigBase.containerUri) + && Objects.equals(this.sasToken, azureConnectionConfigBase.sasToken); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, containerUri, sasToken, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureConnectionConfigBase {\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" containerUri: ").append(toIndentedString(containerUri)).append("\n"); + sb.append(" sasToken: ").append(toIndentedString(sasToken)).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 AzureConnectionConfigBase} instance. No arguments are required. */ + public static AzureConnectionConfigBase create() { + return new AzureConnectionConfigBase(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureDataDestinationCreateRequest.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureDataDestinationCreateRequest.java new file mode 100644 index 000000000..4bf73f5c2 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzureDataDestinationCreateRequest.java @@ -0,0 +1,486 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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.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; + +/** AzureDataDestinationCreateRequest */ +// CHECKSTYLE:OFF +public class AzureDataDestinationCreateRequest implements CreateDataDestination +// CHECKSTYLE:ON +{ + @JsonProperty("description") + private String description; + + /** Adapter type for data access. */ + public enum AdapterTypeEnum { + /** The FILE option of this AzureDataDestinationCreateRequest */ + FILE("File"), + + /** The DELTA_SHARE option of this AzureDataDestinationCreateRequest */ + DELTA_SHARE("DeltaShare"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this AzureDataDestinationCreateRequest */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + AdapterTypeEnum(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 AzureDataDestinationCreateRequest + */ + @JsonCreator + @Nonnull + public static AdapterTypeEnum fromValue(@Nonnull final String value) { + for (AdapterTypeEnum b : AdapterTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("adapterType") + private AdapterTypeEnum adapterType = AdapterTypeEnum.FILE; + + @JsonProperty("labels") + private List labels = new ArrayList<>(); + + /** Gets or Sets type */ + public enum TypeEnum { + /** The AZURE option of this AzureDataDestinationCreateRequest */ + AZURE("AZURE"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this AzureDataDestinationCreateRequest */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 AzureDataDestinationCreateRequest + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("config") + private AzureConnectionConfig config; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureDataDestinationCreateRequest. */ + protected AzureDataDestinationCreateRequest() {} + + /** + * Set the description of this {@link AzureDataDestinationCreateRequest} instance and return the + * same instance. + * + * @param description Optional description of the data destination + * @return The same instance of this {@link AzureDataDestinationCreateRequest} class + */ + @Nonnull + public AzureDataDestinationCreateRequest description(@Nullable final String description) { + this.description = description; + return this; + } + + /** + * Optional description of the data destination + * + * @return description The description of this {@link AzureDataDestinationCreateRequest} instance. + */ + @Nonnull + public String getDescription() { + return description; + } + + /** + * Set the description of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param description Optional description of the data destination + */ + public void setDescription(@Nullable final String description) { + this.description = description; + } + + /** + * Set the adapterType of this {@link AzureDataDestinationCreateRequest} instance and return the + * same instance. + * + * @param adapterType Adapter type for data access. + * @return The same instance of this {@link AzureDataDestinationCreateRequest} class + */ + @Nonnull + public AzureDataDestinationCreateRequest adapterType( + @Nullable final AdapterTypeEnum adapterType) { + this.adapterType = adapterType; + return this; + } + + /** + * Adapter type for data access. + * + * @return adapterType The adapterType of this {@link AzureDataDestinationCreateRequest} instance. + */ + @Nonnull + public AdapterTypeEnum getAdapterType() { + return adapterType; + } + + /** + * Set the adapterType of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param adapterType Adapter type for data access. + */ + public void setAdapterType(@Nullable final AdapterTypeEnum adapterType) { + this.adapterType = adapterType; + } + + /** + * Set the labels of this {@link AzureDataDestinationCreateRequest} instance and return the same + * instance. + * + * @param labels The labels of this {@link AzureDataDestinationCreateRequest} + * @return The same instance of this {@link AzureDataDestinationCreateRequest} class + */ + @Nonnull + public AzureDataDestinationCreateRequest labels(@Nullable final List labels) { + this.labels = labels; + return this; + } + + /** + * Add one labels instance to this {@link AzureDataDestinationCreateRequest}. + * + * @param labelsItem The labels that should be added + * @return The same instance of type {@link AzureDataDestinationCreateRequest} + */ + @Nonnull + public AzureDataDestinationCreateRequest addLabelsItem( + @Nonnull final LabelKeyValuePair labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } + this.labels.add(labelsItem); + return this; + } + + /** + * Get labels + * + * @return labels The labels of this {@link AzureDataDestinationCreateRequest} instance. + */ + @Nonnull + public List getLabels() { + return labels; + } + + /** + * Set the labels of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param labels The labels of this {@link AzureDataDestinationCreateRequest} + */ + public void setLabels(@Nullable final List labels) { + this.labels = labels; + } + + /** + * Set the type of this {@link AzureDataDestinationCreateRequest} instance and return the same + * instance. + * + * @param type The type of this {@link AzureDataDestinationCreateRequest} + * @return The same instance of this {@link AzureDataDestinationCreateRequest} class + */ + @Nonnull + public AzureDataDestinationCreateRequest type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link AzureDataDestinationCreateRequest} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param type The type of this {@link AzureDataDestinationCreateRequest} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the config of this {@link AzureDataDestinationCreateRequest} instance and return the same + * instance. + * + * @param config The config of this {@link AzureDataDestinationCreateRequest} + * @return The same instance of this {@link AzureDataDestinationCreateRequest} class + */ + @Nonnull + public AzureDataDestinationCreateRequest config(@Nonnull final AzureConnectionConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link AzureDataDestinationCreateRequest} instance. + */ + @Nonnull + public AzureConnectionConfig getConfig() { + return config; + } + + /** + * Set the config of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param config The config of this {@link AzureDataDestinationCreateRequest} + */ + public void setConfig(@Nonnull final AzureConnectionConfig config) { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureDataDestinationCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureDataDestinationCreateRequest} + * 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( + "AzureDataDestinationCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureDataDestinationCreateRequest} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (description != null) declaredFields.put("description", description); + if (adapterType != null) declaredFields.put("adapterType", adapterType); + if (labels != null) declaredFields.put("labels", labels); + if (type != null) declaredFields.put("type", type); + if (config != null) declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureDataDestinationCreateRequest} 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 AzureDataDestinationCreateRequest azureDataDestinationCreateRequest = + (AzureDataDestinationCreateRequest) o; + return Objects.equals( + this.cloudSdkCustomFields, azureDataDestinationCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.description, azureDataDestinationCreateRequest.description) + && Objects.equals(this.adapterType, azureDataDestinationCreateRequest.adapterType) + && Objects.equals(this.labels, azureDataDestinationCreateRequest.labels) + && Objects.equals(this.type, azureDataDestinationCreateRequest.type) + && Objects.equals(this.config, azureDataDestinationCreateRequest.config); + } + + @Override + public int hashCode() { + return Objects.hash(description, adapterType, labels, type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureDataDestinationCreateRequest {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" adapterType: ").append(toIndentedString(adapterType)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).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 + * AzureDataDestinationCreateRequest} instance with all required arguments. + */ + public static Builder create() { + return (type) -> (config) -> new AzureDataDestinationCreateRequest().type(type).config(config); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param type The type of this {@link AzureDataDestinationCreateRequest} + * @return The AzureDataDestinationCreateRequest builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the config of this {@link AzureDataDestinationCreateRequest} instance. + * + * @param config The config of this {@link AzureDataDestinationCreateRequest} + * @return The AzureDataDestinationCreateRequest instance. + */ + AzureDataDestinationCreateRequest config(@Nonnull final AzureConnectionConfig config); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzurePatchConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzurePatchConfig.java new file mode 100644 index 000000000..6ff4100bc --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/AzurePatchConfig.java @@ -0,0 +1,170 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** Azure credential fields for PATCH. */ +// CHECKSTYLE:OFF +public class AzurePatchConfig +// CHECKSTYLE:ON +{ + @JsonProperty("sas_token") + private String sasToken; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzurePatchConfig. */ + protected AzurePatchConfig() {} + + /** + * Set the sasToken of this {@link AzurePatchConfig} instance and return the same instance. + * + * @param sasToken SAS token + * @return The same instance of this {@link AzurePatchConfig} class + */ + @Nonnull + public AzurePatchConfig sasToken(@Nullable final String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * SAS token + * + * @return sasToken The sasToken of this {@link AzurePatchConfig} instance. + */ + @Nonnull + public String getSasToken() { + return sasToken; + } + + /** + * Set the sasToken of this {@link AzurePatchConfig} instance. + * + * @param sasToken SAS token + */ + public void setSasToken(@Nullable final String sasToken) { + this.sasToken = sasToken; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzurePatchConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzurePatchConfig} 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("AzurePatchConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzurePatchConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (sasToken != null) declaredFields.put("sasToken", sasToken); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzurePatchConfig} 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 AzurePatchConfig azurePatchConfig = (AzurePatchConfig) o; + return Objects.equals(this.cloudSdkCustomFields, azurePatchConfig.cloudSdkCustomFields) + && Objects.equals(this.sasToken, azurePatchConfig.sasToken); + } + + @Override + public int hashCode() { + return Objects.hash(sasToken, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzurePatchConfig {\n"); + sb.append(" sasToken: ").append(toIndentedString(sasToken)).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 AzurePatchConfig} instance. No arguments are required. */ + public static AzurePatchConfig create() { + return new AzurePatchConfig(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/BaseDataDestinationResponse.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/BaseDataDestinationResponse.java new file mode 100644 index 000000000..c09492eab --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/BaseDataDestinationResponse.java @@ -0,0 +1,469 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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.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; + +/** BaseDataDestinationResponse */ +// CHECKSTYLE:OFF +public class BaseDataDestinationResponse +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("description") + private String description; + + @JsonProperty("labels") + private List labels = new ArrayList<>(); + + @JsonProperty("status") + private DataDestinationStatus status; + + @JsonProperty("errorMessage") + private String errorMessage; + + @JsonProperty("createdAt") + private OffsetDateTime createdAt; + + @JsonProperty("updatedAt") + private OffsetDateTime updatedAt; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for BaseDataDestinationResponse. */ + protected BaseDataDestinationResponse() {} + + /** + * Set the name of this {@link BaseDataDestinationResponse} instance and return the same instance. + * + * @param name The name of this {@link BaseDataDestinationResponse} + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link BaseDataDestinationResponse} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link BaseDataDestinationResponse} instance. + * + * @param name The name of this {@link BaseDataDestinationResponse} + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the description of this {@link BaseDataDestinationResponse} instance and return the same + * instance. + * + * @param description The description of this {@link BaseDataDestinationResponse} + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse description(@Nullable final String description) { + this.description = description; + return this; + } + + /** + * Get description + * + * @return description The description of this {@link BaseDataDestinationResponse} instance. + */ + @Nullable + public String getDescription() { + return description; + } + + /** + * Set the description of this {@link BaseDataDestinationResponse} instance. + * + * @param description The description of this {@link BaseDataDestinationResponse} + */ + public void setDescription(@Nullable final String description) { + this.description = description; + } + + /** + * Set the labels of this {@link BaseDataDestinationResponse} instance and return the same + * instance. + * + * @param labels The labels of this {@link BaseDataDestinationResponse} + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse labels(@Nullable final List labels) { + this.labels = labels; + return this; + } + + /** + * Add one labels instance to this {@link BaseDataDestinationResponse}. + * + * @param labelsItem The labels that should be added + * @return The same instance of type {@link BaseDataDestinationResponse} + */ + @Nonnull + public BaseDataDestinationResponse addLabelsItem(@Nonnull final LabelKeyValuePair labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } + this.labels.add(labelsItem); + return this; + } + + /** + * Get labels + * + * @return labels The labels of this {@link BaseDataDestinationResponse} instance. + */ + @Nonnull + public List getLabels() { + return labels; + } + + /** + * Set the labels of this {@link BaseDataDestinationResponse} instance. + * + * @param labels The labels of this {@link BaseDataDestinationResponse} + */ + public void setLabels(@Nullable final List labels) { + this.labels = labels; + } + + /** + * Set the status of this {@link BaseDataDestinationResponse} instance and return the same + * instance. + * + * @param status The status of this {@link BaseDataDestinationResponse} + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse status(@Nullable final DataDestinationStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link BaseDataDestinationResponse} instance. + */ + @Nonnull + public DataDestinationStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link BaseDataDestinationResponse} instance. + * + * @param status The status of this {@link BaseDataDestinationResponse} + */ + public void setStatus(@Nullable final DataDestinationStatus status) { + this.status = status; + } + + /** + * Set the errorMessage of this {@link BaseDataDestinationResponse} instance and return the same + * instance. + * + * @param errorMessage Detailed error message if the Data Destination creation failed + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse errorMessage(@Nullable final String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Detailed error message if the Data Destination creation failed + * + * @return errorMessage The errorMessage of this {@link BaseDataDestinationResponse} instance. + */ + @Nullable + public String getErrorMessage() { + return errorMessage; + } + + /** + * Set the errorMessage of this {@link BaseDataDestinationResponse} instance. + * + * @param errorMessage Detailed error message if the Data Destination creation failed + */ + public void setErrorMessage(@Nullable final String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * Set the createdAt of this {@link BaseDataDestinationResponse} instance and return the same + * instance. + * + * @param createdAt The createdAt of this {@link BaseDataDestinationResponse} + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse createdAt(@Nonnull final OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt The createdAt of this {@link BaseDataDestinationResponse} instance. + */ + @Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Set the createdAt of this {@link BaseDataDestinationResponse} instance. + * + * @param createdAt The createdAt of this {@link BaseDataDestinationResponse} + */ + public void setCreatedAt(@Nonnull final OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * Set the updatedAt of this {@link BaseDataDestinationResponse} instance and return the same + * instance. + * + * @param updatedAt The updatedAt of this {@link BaseDataDestinationResponse} + * @return The same instance of this {@link BaseDataDestinationResponse} class + */ + @Nonnull + public BaseDataDestinationResponse updatedAt(@Nonnull final OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt The updatedAt of this {@link BaseDataDestinationResponse} instance. + */ + @Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * Set the updatedAt of this {@link BaseDataDestinationResponse} instance. + * + * @param updatedAt The updatedAt of this {@link BaseDataDestinationResponse} + */ + public void setUpdatedAt(@Nonnull final OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * Get the names of the unrecognizable properties of the {@link BaseDataDestinationResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link BaseDataDestinationResponse} + * 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( + "BaseDataDestinationResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link BaseDataDestinationResponse} 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 (description != null) declaredFields.put("description", description); + if (labels != null) declaredFields.put("labels", labels); + if (status != null) declaredFields.put("status", status); + if (errorMessage != null) declaredFields.put("errorMessage", errorMessage); + if (createdAt != null) declaredFields.put("createdAt", createdAt); + if (updatedAt != null) declaredFields.put("updatedAt", updatedAt); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link BaseDataDestinationResponse} 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 BaseDataDestinationResponse baseDataDestinationResponse = (BaseDataDestinationResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, baseDataDestinationResponse.cloudSdkCustomFields) + && Objects.equals(this.name, baseDataDestinationResponse.name) + && Objects.equals(this.description, baseDataDestinationResponse.description) + && Objects.equals(this.labels, baseDataDestinationResponse.labels) + && Objects.equals(this.status, baseDataDestinationResponse.status) + && Objects.equals(this.errorMessage, baseDataDestinationResponse.errorMessage) + && Objects.equals(this.createdAt, baseDataDestinationResponse.createdAt) + && Objects.equals(this.updatedAt, baseDataDestinationResponse.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + description, + labels, + status, + errorMessage, + createdAt, + updatedAt, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class BaseDataDestinationResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 + * BaseDataDestinationResponse} instance with all required arguments. + */ + public static Builder create() { + return (name) -> + (createdAt) -> + (updatedAt) -> + new BaseDataDestinationResponse() + .name(name) + .createdAt(createdAt) + .updatedAt(updatedAt); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link BaseDataDestinationResponse} instance. + * + * @param name The name of this {@link BaseDataDestinationResponse} + * @return The BaseDataDestinationResponse builder. + */ + Builder1 name(@Nonnull final String name); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the createdAt of this {@link BaseDataDestinationResponse} instance. + * + * @param createdAt The createdAt of this {@link BaseDataDestinationResponse} + * @return The BaseDataDestinationResponse builder. + */ + Builder2 createdAt(@Nonnull final OffsetDateTime createdAt); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the updatedAt of this {@link BaseDataDestinationResponse} instance. + * + * @param updatedAt The updatedAt of this {@link BaseDataDestinationResponse} + * @return The BaseDataDestinationResponse instance. + */ + BaseDataDestinationResponse updatedAt(@Nonnull final OffsetDateTime updatedAt); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CSNDefinition.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CSNDefinition.java new file mode 100644 index 000000000..9e2208d01 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CSNDefinition.java @@ -0,0 +1,26 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** CSNDefinition */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "definitionType", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AutoDefinition.class, name = "AUTO"), + @JsonSubTypes.Type(value = DocumentDefinition.class, name = "DOCUMENT"), + @JsonSubTypes.Type(value = ReferenceDefinition.class, name = "REFERENCE"), +}) +public interface CSNDefinition { + Object getDefinitionType(); +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ContextSelectionStrategy.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ContextSelectionStrategy.java new file mode 100644 index 000000000..d0d98bb68 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ContextSelectionStrategy.java @@ -0,0 +1,64 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Strategy for selecting context in the scenario configuration */ +public enum ContextSelectionStrategy { + RANDOM("random"), + + EMBEDDING("embedding"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + ContextSelectionStrategy(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 ContextSelectionStrategy fromValue(@Nonnull final String value) { + for (final ContextSelectionStrategy b : ContextSelectionStrategy.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest.java new file mode 100644 index 000000000..87c19d2b0 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest.java @@ -0,0 +1,243 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest */ +// CHECKSTYLE:OFF +public class ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest +// CHECKSTYLE:ON +{ + @JsonProperty("labels") + private List labels = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest. */ + protected ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest() {} + + /** + * Set the labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance and return the + * same instance. + * + * @param labels The labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} + * @return The same instance of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} class + */ + @Nonnull + public ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest labels( + @Nonnull final List labels) { + this.labels = labels; + return this; + } + + /** + * Add one labels instance to this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest}. + * + * @param labelsItem The labels that should be added + * @return The same instance of type {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} + */ + @Nonnull + public ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest addLabelsItem( + @Nonnull final LabelKeyValuePair labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } + this.labels.add(labelsItem); + return this; + } + + /** + * Get labels + * + * @return labels The labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance. + */ + @Nonnull + public List getLabels() { + return labels; + } + + /** + * Set the labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance. + * + * @param labels The labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} + */ + public void setLabels(@Nonnull final List labels) { + this.labels = labels; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} 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( + "ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (labels != null) declaredFields.put("labels", labels); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} 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 ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest + controllersDataDestinationV1EndpointsSearchDataDestinationsRequest = + (ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest) o; + return Objects.equals( + this.cloudSdkCustomFields, + controllersDataDestinationV1EndpointsSearchDataDestinationsRequest.cloudSdkCustomFields) + && Objects.equals( + this.labels, controllersDataDestinationV1EndpointsSearchDataDestinationsRequest.labels); + } + + @Override + public int hashCode() { + return Objects.hash(labels, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).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 + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance with all required + * arguments. + */ + public static Builder create() { + return (labels) -> + new ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest().labels(labels); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance. + * + * @param labels The labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} + * @return The ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest instance. + */ + ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest labels( + @Nonnull final List labels); + + /** + * Set the labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} instance. + * + * @param labels The labels of this {@link + * ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest} + * @return The ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest instance. + */ + default ControllersDataDestinationV1EndpointsSearchDataDestinationsRequest labels( + @Nonnull final LabelKeyValuePair... labels) { + return labels(Arrays.asList(labels)); + } + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response.java new file mode 100644 index 000000000..f051d88bb --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response.java @@ -0,0 +1,194 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response */ +// CHECKSTYLE:OFF +public class ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response. + */ + protected ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response() {} + + /** + * Set the name of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} instance and return the + * same instance. + * + * @param name Name of the Tabular Artifact being created + * @return The same instance of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} class + */ + @Nonnull + public ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response name( + @Nullable final String name) { + this.name = name; + return this; + } + + /** + * Name of the Tabular Artifact being created + * + * @return name The name of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} instance. + * + * @param name Name of the Tabular Artifact being created + */ + public void setName(@Nullable final String name) { + this.name = name; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} 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( + "ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} 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); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} 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 ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response + controllersTabularArtifactV1EndpointsCreateTabularArtifact202Response = + (ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response) o; + return Objects.equals( + this.cloudSdkCustomFields, + controllersTabularArtifactV1EndpointsCreateTabularArtifact202Response + .cloudSdkCustomFields) + && Objects.equals( + this.name, controllersTabularArtifactV1EndpointsCreateTabularArtifact202Response.name); + } + + @Override + public int hashCode() { + return Objects.hash(name, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).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 ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response} + * instance. No arguments are required. + */ + public static ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response create() { + return new ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CreateDataDestination.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CreateDataDestination.java new file mode 100644 index 000000000..6ef8ea0f3 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CreateDataDestination.java @@ -0,0 +1,30 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** CreateDataDestination */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AzureDataDestinationCreateRequest.class, name = "AZURE"), + @JsonSubTypes.Type( + value = DeltaSharingDataDestinationCreateRequest.class, + name = "DELTA_SHARING"), + @JsonSubTypes.Type(value = GCSDataDestinationCreateRequest.class, name = "GCS"), + @JsonSubTypes.Type(value = HDLDataDestinationCreateRequest.class, name = "HDL"), + @JsonSubTypes.Type(value = S3DataDestinationCreateRequest.class, name = "S3"), +}) +public interface CreateDataDestination { + Object getType(); +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CreateScenarioConfiguration.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CreateScenarioConfiguration.java new file mode 100644 index 000000000..52273455d --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/orchestration/model/CreateScenarioConfiguration.java @@ -0,0 +1,361 @@ +/* + * Context Registry + * Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + * + * + * + * 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.tabular.generated.orchestration.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; + +/** CreateScenarioConfiguration */ +// CHECKSTYLE:OFF +public class CreateScenarioConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("description") + private String description; + + @JsonProperty("contextSelectionStrategy") + private ContextSelectionStrategy contextSelectionStrategy; + + @JsonProperty("tabularArtifacts") + private List tabularArtifacts = new ArrayList<>(); + + @JsonProperty("labels") + private List

No description provided (generated by Openapi Generator + * https://github.com/openapitools/openapi-generator) + */ +public class HealthApi extends BaseApi { + + /** + * Instantiates this API class to invoke operations on the Tabular AI Orchestrator. + * + * @param httpDestination The destination that API should be used with + */ + public HealthApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Tabular AI Orchestrator based on a + * given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + public HealthApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Creates a new API instance with additional default headers. + * + * @param defaultHeaders Additional headers to include in all requests + * @return A new API instance with the combined headers + */ + public HealthApi withDefaultHeaders(@Nonnull final Map defaultHeaders) { + final var api = new HealthApi(apiClient); + api.defaultHeaders.putAll(this.defaultHeaders); + api.defaultHeaders.putAll(defaultHeaders); + return api; + } + + /** + * Health Check + * + *

If this application is up and running, health_check has passed. No need to check for + * dependencies because each dependencies also has their own health_check + * + *

200 - Successful Response + * + * @return HealthResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public HealthResponse healthCheckV1HealthGet() throws OpenApiRequestException { + + // create path and map variables + final String localVarPath = "/health"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/client/PredictApi.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/client/PredictApi.java new file mode 100644 index 000000000..9f36579cb --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/client/PredictApi.java @@ -0,0 +1,126 @@ +package com.sap.ai.sdk.tabular.generated.predict.client; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictRequest; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictResponse; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import javax.annotation.Nonnull; + +/** + * Tabular AI Orchestrator in version 1.6.0. + * + *

No description provided (generated by Openapi Generator + * https://github.com/openapitools/openapi-generator) + */ +public class PredictApi extends BaseApi { + + /** + * Instantiates this API class to invoke operations on the Tabular AI Orchestrator. + * + * @param httpDestination The destination that API should be used with + */ + public PredictApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Tabular AI Orchestrator based on a + * given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + public PredictApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Creates a new API instance with additional default headers. + * + * @param defaultHeaders Additional headers to include in all requests + * @return A new API instance with the combined headers + */ + public PredictApi withDefaultHeaders(@Nonnull final Map defaultHeaders) { + final var api = new PredictApi(apiClient); + api.defaultHeaders.putAll(this.defaultHeaders); + api.defaultHeaders.putAll(defaultHeaders); + return api; + } + + /** + * Make predictions using a Tabular Foundation Model + * + *

Make predictions for tabular data using a deployed Tabular Foundation Model. Required + * Headers: - ai-main-tenant: AI Core main tenant identifier - ai-resource-group: AI Core resource + * group identifier + * + *

200 - Successful Response + * + *

400 - Invalid request data + * + *

401 - Authentication failed + * + *

404 - Model not found + * + *

500 - Internal server error + * + *

502 - External service error + * + *

504 - Request timeout + * + *

422 - Validation Error + * + * @param predictRequest The value for the parameter predictRequest + * @return PredictResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PredictResponse predict(@Nonnull final PredictRequest predictRequest) + throws OpenApiRequestException { + + // verify the required parameter 'predictRequest' is set + if (predictRequest == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'predictRequest' when calling predict") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/predict"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(defaultHeaders); + final Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + predictRequest, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ConditionsInner.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ConditionsInner.java new file mode 100644 index 000000000..dcec06cd9 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ConditionsInner.java @@ -0,0 +1,414 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** ConditionsInner */ +// CHECKSTYLE:OFF +public class ConditionsInner +// CHECKSTYLE:ON +{ + @JsonProperty("field") + private String field; + + @JsonProperty("op") + private String op; + + @JsonProperty("value") + private Object value = null; + + @JsonProperty("logic") + private String logic; + + @JsonProperty("conditions") + private List conditions = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ConditionsInner. */ + protected ConditionsInner() {} + + /** + * Set the field of this {@link ConditionsInner} instance and return the same instance. + * + * @param field Field name to filter on + * @return The same instance of this {@link ConditionsInner} class + */ + @Nonnull + public ConditionsInner field(@Nonnull final String field) { + this.field = field; + return this; + } + + /** + * Field name to filter on + * + * @return field The field of this {@link ConditionsInner} instance. + */ + @Nonnull + public String getField() { + return field; + } + + /** + * Set the field of this {@link ConditionsInner} instance. + * + * @param field Field name to filter on + */ + public void setField(@Nonnull final String field) { + this.field = field; + } + + /** + * Set the op of this {@link ConditionsInner} instance and return the same instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + * @return The same instance of this {@link ConditionsInner} class + */ + @Nonnull + public ConditionsInner op(@Nonnull final String op) { + this.op = op; + return this; + } + + /** + * Filter operator (e.g., 'eq', 'gte', 'lte') + * + * @return op The op of this {@link ConditionsInner} instance. + */ + @Nonnull + public String getOp() { + return op; + } + + /** + * Set the op of this {@link ConditionsInner} instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + */ + public void setOp(@Nonnull final String op) { + this.op = op; + } + + /** + * Set the value of this {@link ConditionsInner} instance and return the same instance. + * + * @param value The value of this {@link ConditionsInner} + * @return The same instance of this {@link ConditionsInner} class + */ + @Nonnull + public ConditionsInner value(@Nullable final Object value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value The value of this {@link ConditionsInner} instance. + */ + @Nullable + public Object getValue() { + return value; + } + + /** + * Set the value of this {@link ConditionsInner} instance. + * + * @param value The value of this {@link ConditionsInner} + */ + public void setValue(@Nullable final Object value) { + this.value = value; + } + + /** + * Set the logic of this {@link ConditionsInner} instance and return the same instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + * @return The same instance of this {@link ConditionsInner} class + */ + @Nonnull + public ConditionsInner logic(@Nonnull final String logic) { + this.logic = logic; + return this; + } + + /** + * Logical operator to combine conditions ('and' or 'or') + * + * @return logic The logic of this {@link ConditionsInner} instance. + */ + @Nonnull + public String getLogic() { + return logic; + } + + /** + * Set the logic of this {@link ConditionsInner} instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + */ + public void setLogic(@Nonnull final String logic) { + this.logic = logic; + } + + /** + * Set the conditions of this {@link ConditionsInner} instance and return the same instance. + * + * @param conditions List of filter conditions + * @return The same instance of this {@link ConditionsInner} class + */ + @Nonnull + public ConditionsInner conditions(@Nonnull final List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Add one conditions instance to this {@link ConditionsInner}. + * + * @param conditionsItem The conditions that should be added + * @return The same instance of type {@link ConditionsInner} + */ + @Nonnull + public ConditionsInner addConditionsItem(@Nonnull final ConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of filter conditions + * + * @return conditions The conditions of this {@link ConditionsInner} instance. + */ + @Nonnull + public List getConditions() { + return conditions; + } + + /** + * Set the conditions of this {@link ConditionsInner} instance. + * + * @param conditions List of filter conditions + */ + public void setConditions(@Nonnull final List conditions) { + this.conditions = conditions; + } + + /** + * Get the names of the unrecognizable properties of the {@link ConditionsInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ConditionsInner} 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("ConditionsInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ConditionsInner} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (field != null) declaredFields.put("field", field); + if (op != null) declaredFields.put("op", op); + if (value != null) declaredFields.put("value", value); + if (logic != null) declaredFields.put("logic", logic); + if (conditions != null) declaredFields.put("conditions", conditions); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ConditionsInner} 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 ConditionsInner conditionsInner = (ConditionsInner) o; + return Objects.equals(this.cloudSdkCustomFields, conditionsInner.cloudSdkCustomFields) + && Objects.equals(this.field, conditionsInner.field) + && Objects.equals(this.op, conditionsInner.op) + && Objects.equals(this.value, conditionsInner.value) + && Objects.equals(this.logic, conditionsInner.logic) + && Objects.equals(this.conditions, conditionsInner.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(field, op, value, logic, conditions, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ConditionsInner {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" logic: ").append(toIndentedString(logic)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).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 ConditionsInner} + * instance with all required arguments. + */ + public static Builder create() { + return (field) -> + (op) -> + (value) -> + (logic) -> + (conditions) -> + new ConditionsInner() + .field(field) + .op(op) + .value(value) + .logic(logic) + .conditions(conditions); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the field of this {@link ConditionsInner} instance. + * + * @param field Field name to filter on + * @return The ConditionsInner builder. + */ + Builder1 field(@Nonnull final String field); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the op of this {@link ConditionsInner} instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + * @return The ConditionsInner builder. + */ + Builder2 op(@Nonnull final String op); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the value of this {@link ConditionsInner} instance. + * + * @param value The value of this {@link ConditionsInner} + * @return The ConditionsInner builder. + */ + Builder3 value(@Nullable final Object value); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the logic of this {@link ConditionsInner} instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + * @return The ConditionsInner builder. + */ + Builder4 logic(@Nonnull final String logic); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the conditions of this {@link ConditionsInner} instance. + * + * @param conditions List of filter conditions + * @return The ConditionsInner instance. + */ + ConditionsInner conditions(@Nonnull final List conditions); + + /** + * Set the conditions of this {@link ConditionsInner} instance. + * + * @param conditions List of filter conditions + * @return The ConditionsInner instance. + */ + default ConditionsInner conditions(@Nonnull final ConditionsInner... conditions) { + return conditions(Arrays.asList(conditions)); + } + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ContextSelectionConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ContextSelectionConfig.java new file mode 100644 index 000000000..df9d1fd8c --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ContextSelectionConfig.java @@ -0,0 +1,326 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Configuration for context selection. */ +// CHECKSTYLE:OFF +public class ContextSelectionConfig +// CHECKSTYLE:ON +{ + @JsonProperty("numRows") + private Integer numRows; + + @JsonProperty("strategy") + private ContextSelectionStrategyEnum strategy; + + @JsonProperty("strategyConfigs") + private StrategyConfigs strategyConfigs; + + @JsonProperty("filterConditions") + private FilterConditions1 filterConditions; + + @JsonProperty("verbose") + private Boolean verbose = false; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ContextSelectionConfig. */ + protected ContextSelectionConfig() {} + + /** + * Set the numRows of this {@link ContextSelectionConfig} instance and return the same instance. + * + * @param numRows Number of rows to select for context. If not provided or set to 0, context + * selection is skipped. Minimum: 0 + * @return The same instance of this {@link ContextSelectionConfig} class + */ + @Nonnull + public ContextSelectionConfig numRows(@Nullable final Integer numRows) { + this.numRows = numRows; + return this; + } + + /** + * Number of rows to select for context. If not provided or set to 0, context selection is + * skipped. minimum: 0 + * + * @return numRows The numRows of this {@link ContextSelectionConfig} instance. + */ + @Nullable + public Integer getNumRows() { + return numRows; + } + + /** + * Set the numRows of this {@link ContextSelectionConfig} instance. + * + * @param numRows Number of rows to select for context. If not provided or set to 0, context + * selection is skipped. Minimum: 0 + */ + public void setNumRows(@Nullable final Integer numRows) { + this.numRows = numRows; + } + + /** + * Set the strategy of this {@link ContextSelectionConfig} instance and return the same instance. + * + * @param strategy Sampling strategy for context selection. + * @return The same instance of this {@link ContextSelectionConfig} class + */ + @Nonnull + public ContextSelectionConfig strategy(@Nullable final ContextSelectionStrategyEnum strategy) { + this.strategy = strategy; + return this; + } + + /** + * Sampling strategy for context selection. + * + * @return strategy The strategy of this {@link ContextSelectionConfig} instance. + */ + @Nonnull + public ContextSelectionStrategyEnum getStrategy() { + return strategy; + } + + /** + * Set the strategy of this {@link ContextSelectionConfig} instance. + * + * @param strategy Sampling strategy for context selection. + */ + public void setStrategy(@Nullable final ContextSelectionStrategyEnum strategy) { + this.strategy = strategy; + } + + /** + * Set the strategyConfigs of this {@link ContextSelectionConfig} instance and return the same + * instance. + * + * @param strategyConfigs The strategyConfigs of this {@link ContextSelectionConfig} + * @return The same instance of this {@link ContextSelectionConfig} class + */ + @Nonnull + public ContextSelectionConfig strategyConfigs(@Nullable final StrategyConfigs strategyConfigs) { + this.strategyConfigs = strategyConfigs; + return this; + } + + /** + * Get strategyConfigs + * + * @return strategyConfigs The strategyConfigs of this {@link ContextSelectionConfig} instance. + */ + @Nullable + public StrategyConfigs getStrategyConfigs() { + return strategyConfigs; + } + + /** + * Set the strategyConfigs of this {@link ContextSelectionConfig} instance. + * + * @param strategyConfigs The strategyConfigs of this {@link ContextSelectionConfig} + */ + public void setStrategyConfigs(@Nullable final StrategyConfigs strategyConfigs) { + this.strategyConfigs = strategyConfigs; + } + + /** + * Set the filterConditions of this {@link ContextSelectionConfig} instance and return the same + * instance. + * + * @param filterConditions The filterConditions of this {@link ContextSelectionConfig} + * @return The same instance of this {@link ContextSelectionConfig} class + */ + @Nonnull + public ContextSelectionConfig filterConditions( + @Nullable final FilterConditions1 filterConditions) { + this.filterConditions = filterConditions; + return this; + } + + /** + * Get filterConditions + * + * @return filterConditions The filterConditions of this {@link ContextSelectionConfig} instance. + */ + @Nullable + public FilterConditions1 getFilterConditions() { + return filterConditions; + } + + /** + * Set the filterConditions of this {@link ContextSelectionConfig} instance. + * + * @param filterConditions The filterConditions of this {@link ContextSelectionConfig} + */ + public void setFilterConditions(@Nullable final FilterConditions1 filterConditions) { + this.filterConditions = filterConditions; + } + + /** + * Set the verbose of this {@link ContextSelectionConfig} instance and return the same instance. + * + * @param verbose When true, show additional debug information for context selection + * @return The same instance of this {@link ContextSelectionConfig} class + */ + @Nonnull + public ContextSelectionConfig verbose(@Nullable final Boolean verbose) { + this.verbose = verbose; + return this; + } + + /** + * When true, show additional debug information for context selection + * + * @return verbose The verbose of this {@link ContextSelectionConfig} instance. + */ + @Nonnull + public Boolean isVerbose() { + return verbose; + } + + /** + * Set the verbose of this {@link ContextSelectionConfig} instance. + * + * @param verbose When true, show additional debug information for context selection + */ + public void setVerbose(@Nullable final Boolean verbose) { + this.verbose = verbose; + } + + /** + * Get the names of the unrecognizable properties of the {@link ContextSelectionConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ContextSelectionConfig} 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( + "ContextSelectionConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ContextSelectionConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (numRows != null) declaredFields.put("numRows", numRows); + if (strategy != null) declaredFields.put("strategy", strategy); + if (strategyConfigs != null) declaredFields.put("strategyConfigs", strategyConfigs); + if (filterConditions != null) declaredFields.put("filterConditions", filterConditions); + if (verbose != null) declaredFields.put("verbose", verbose); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ContextSelectionConfig} 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 ContextSelectionConfig contextSelectionConfig = (ContextSelectionConfig) o; + return Objects.equals(this.cloudSdkCustomFields, contextSelectionConfig.cloudSdkCustomFields) + && Objects.equals(this.numRows, contextSelectionConfig.numRows) + && Objects.equals(this.strategy, contextSelectionConfig.strategy) + && Objects.equals(this.strategyConfigs, contextSelectionConfig.strategyConfigs) + && Objects.equals(this.filterConditions, contextSelectionConfig.filterConditions) + && Objects.equals(this.verbose, contextSelectionConfig.verbose); + } + + @Override + public int hashCode() { + return Objects.hash( + numRows, strategy, strategyConfigs, filterConditions, verbose, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ContextSelectionConfig {\n"); + sb.append(" numRows: ").append(toIndentedString(numRows)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" strategyConfigs: ").append(toIndentedString(strategyConfigs)).append("\n"); + sb.append(" filterConditions: ").append(toIndentedString(filterConditions)).append("\n"); + sb.append(" verbose: ").append(toIndentedString(verbose)).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 ContextSelectionConfig} instance. No arguments are required. */ + public static ContextSelectionConfig create() { + return new ContextSelectionConfig(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ContextSelectionStrategyEnum.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ContextSelectionStrategyEnum.java new file mode 100644 index 000000000..59483f6f8 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ContextSelectionStrategyEnum.java @@ -0,0 +1,68 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Context selection strategies for data sampling. */ +public enum ContextSelectionStrategyEnum { + NONE("none"), + + RANDOM("random"), + + HEURISTIC("heuristic"), + + AUTO("auto"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + ContextSelectionStrategyEnum(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 ContextSelectionStrategyEnum fromValue(@Nonnull final String value) { + for (final ContextSelectionStrategyEnum b : ContextSelectionStrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterCondition.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterCondition.java new file mode 100644 index 000000000..f93534c88 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterCondition.java @@ -0,0 +1,280 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** A single filter condition for context selection. */ +// CHECKSTYLE:OFF +public class FilterCondition +// CHECKSTYLE:ON +{ + @JsonProperty("field") + private String field; + + @JsonProperty("op") + private String op; + + @JsonProperty("value") + private Object value = null; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for FilterCondition. */ + protected FilterCondition() {} + + /** + * Set the field of this {@link FilterCondition} instance and return the same instance. + * + * @param field Field name to filter on + * @return The same instance of this {@link FilterCondition} class + */ + @Nonnull + public FilterCondition field(@Nonnull final String field) { + this.field = field; + return this; + } + + /** + * Field name to filter on + * + * @return field The field of this {@link FilterCondition} instance. + */ + @Nonnull + public String getField() { + return field; + } + + /** + * Set the field of this {@link FilterCondition} instance. + * + * @param field Field name to filter on + */ + public void setField(@Nonnull final String field) { + this.field = field; + } + + /** + * Set the op of this {@link FilterCondition} instance and return the same instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + * @return The same instance of this {@link FilterCondition} class + */ + @Nonnull + public FilterCondition op(@Nonnull final String op) { + this.op = op; + return this; + } + + /** + * Filter operator (e.g., 'eq', 'gte', 'lte') + * + * @return op The op of this {@link FilterCondition} instance. + */ + @Nonnull + public String getOp() { + return op; + } + + /** + * Set the op of this {@link FilterCondition} instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + */ + public void setOp(@Nonnull final String op) { + this.op = op; + } + + /** + * Set the value of this {@link FilterCondition} instance and return the same instance. + * + * @param value The value of this {@link FilterCondition} + * @return The same instance of this {@link FilterCondition} class + */ + @Nonnull + public FilterCondition value(@Nullable final Object value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value The value of this {@link FilterCondition} instance. + */ + @Nullable + public Object getValue() { + return value; + } + + /** + * Set the value of this {@link FilterCondition} instance. + * + * @param value The value of this {@link FilterCondition} + */ + public void setValue(@Nullable final Object value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link FilterCondition}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FilterCondition} 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("FilterCondition has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FilterCondition} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (field != null) declaredFields.put("field", field); + if (op != null) declaredFields.put("op", op); + if (value != null) declaredFields.put("value", value); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FilterCondition} 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 FilterCondition filterCondition = (FilterCondition) o; + return Objects.equals(this.cloudSdkCustomFields, filterCondition.cloudSdkCustomFields) + && Objects.equals(this.field, filterCondition.field) + && Objects.equals(this.op, filterCondition.op) + && Objects.equals(this.value, filterCondition.value); + } + + @Override + public int hashCode() { + return Objects.hash(field, op, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class FilterCondition {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).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 FilterCondition} + * instance with all required arguments. + */ + public static Builder create() { + return (field) -> (op) -> (value) -> new FilterCondition().field(field).op(op).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the field of this {@link FilterCondition} instance. + * + * @param field Field name to filter on + * @return The FilterCondition builder. + */ + Builder1 field(@Nonnull final String field); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the op of this {@link FilterCondition} instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + * @return The FilterCondition builder. + */ + Builder2 op(@Nonnull final String op); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the value of this {@link FilterCondition} instance. + * + * @param value The value of this {@link FilterCondition} + * @return The FilterCondition instance. + */ + FilterCondition value(@Nullable final Object value); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterConditions.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterConditions.java new file mode 100644 index 000000000..db7aef352 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterConditions.java @@ -0,0 +1,260 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Filter conditions for context selection. */ +// CHECKSTYLE:OFF +public class FilterConditions +// CHECKSTYLE:ON +{ + @JsonProperty("logic") + private String logic; + + @JsonProperty("conditions") + private List conditions = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for FilterConditions. */ + protected FilterConditions() {} + + /** + * Set the logic of this {@link FilterConditions} instance and return the same instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + * @return The same instance of this {@link FilterConditions} class + */ + @Nonnull + public FilterConditions logic(@Nonnull final String logic) { + this.logic = logic; + return this; + } + + /** + * Logical operator to combine conditions ('and' or 'or') + * + * @return logic The logic of this {@link FilterConditions} instance. + */ + @Nonnull + public String getLogic() { + return logic; + } + + /** + * Set the logic of this {@link FilterConditions} instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + */ + public void setLogic(@Nonnull final String logic) { + this.logic = logic; + } + + /** + * Set the conditions of this {@link FilterConditions} instance and return the same instance. + * + * @param conditions List of filter conditions + * @return The same instance of this {@link FilterConditions} class + */ + @Nonnull + public FilterConditions conditions(@Nonnull final List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Add one conditions instance to this {@link FilterConditions}. + * + * @param conditionsItem The conditions that should be added + * @return The same instance of type {@link FilterConditions} + */ + @Nonnull + public FilterConditions addConditionsItem(@Nonnull final ConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of filter conditions + * + * @return conditions The conditions of this {@link FilterConditions} instance. + */ + @Nonnull + public List getConditions() { + return conditions; + } + + /** + * Set the conditions of this {@link FilterConditions} instance. + * + * @param conditions List of filter conditions + */ + public void setConditions(@Nonnull final List conditions) { + this.conditions = conditions; + } + + /** + * Get the names of the unrecognizable properties of the {@link FilterConditions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FilterConditions} 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("FilterConditions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FilterConditions} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (logic != null) declaredFields.put("logic", logic); + if (conditions != null) declaredFields.put("conditions", conditions); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FilterConditions} 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 FilterConditions filterConditions = (FilterConditions) o; + return Objects.equals(this.cloudSdkCustomFields, filterConditions.cloudSdkCustomFields) + && Objects.equals(this.logic, filterConditions.logic) + && Objects.equals(this.conditions, filterConditions.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(logic, conditions, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class FilterConditions {\n"); + sb.append(" logic: ").append(toIndentedString(logic)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).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 FilterConditions} + * instance with all required arguments. + */ + public static Builder create() { + return (logic) -> (conditions) -> new FilterConditions().logic(logic).conditions(conditions); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the logic of this {@link FilterConditions} instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + * @return The FilterConditions builder. + */ + Builder1 logic(@Nonnull final String logic); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the conditions of this {@link FilterConditions} instance. + * + * @param conditions List of filter conditions + * @return The FilterConditions instance. + */ + FilterConditions conditions(@Nonnull final List conditions); + + /** + * Set the conditions of this {@link FilterConditions} instance. + * + * @param conditions List of filter conditions + * @return The FilterConditions instance. + */ + default FilterConditions conditions(@Nonnull final ConditionsInner... conditions) { + return conditions(Arrays.asList(conditions)); + } + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterConditions1.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterConditions1.java new file mode 100644 index 000000000..88cd06c7c --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/FilterConditions1.java @@ -0,0 +1,414 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Filter conditions for context selection */ +// CHECKSTYLE:OFF +public class FilterConditions1 +// CHECKSTYLE:ON +{ + @JsonProperty("logic") + private String logic; + + @JsonProperty("conditions") + private List conditions = new ArrayList<>(); + + @JsonProperty("field") + private String field; + + @JsonProperty("op") + private String op; + + @JsonProperty("value") + private Object value = null; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for FilterConditions1. */ + protected FilterConditions1() {} + + /** + * Set the logic of this {@link FilterConditions1} instance and return the same instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + * @return The same instance of this {@link FilterConditions1} class + */ + @Nonnull + public FilterConditions1 logic(@Nonnull final String logic) { + this.logic = logic; + return this; + } + + /** + * Logical operator to combine conditions ('and' or 'or') + * + * @return logic The logic of this {@link FilterConditions1} instance. + */ + @Nonnull + public String getLogic() { + return logic; + } + + /** + * Set the logic of this {@link FilterConditions1} instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + */ + public void setLogic(@Nonnull final String logic) { + this.logic = logic; + } + + /** + * Set the conditions of this {@link FilterConditions1} instance and return the same instance. + * + * @param conditions List of filter conditions + * @return The same instance of this {@link FilterConditions1} class + */ + @Nonnull + public FilterConditions1 conditions(@Nonnull final List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Add one conditions instance to this {@link FilterConditions1}. + * + * @param conditionsItem The conditions that should be added + * @return The same instance of type {@link FilterConditions1} + */ + @Nonnull + public FilterConditions1 addConditionsItem(@Nonnull final ConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of filter conditions + * + * @return conditions The conditions of this {@link FilterConditions1} instance. + */ + @Nonnull + public List getConditions() { + return conditions; + } + + /** + * Set the conditions of this {@link FilterConditions1} instance. + * + * @param conditions List of filter conditions + */ + public void setConditions(@Nonnull final List conditions) { + this.conditions = conditions; + } + + /** + * Set the field of this {@link FilterConditions1} instance and return the same instance. + * + * @param field Field name to filter on + * @return The same instance of this {@link FilterConditions1} class + */ + @Nonnull + public FilterConditions1 field(@Nonnull final String field) { + this.field = field; + return this; + } + + /** + * Field name to filter on + * + * @return field The field of this {@link FilterConditions1} instance. + */ + @Nonnull + public String getField() { + return field; + } + + /** + * Set the field of this {@link FilterConditions1} instance. + * + * @param field Field name to filter on + */ + public void setField(@Nonnull final String field) { + this.field = field; + } + + /** + * Set the op of this {@link FilterConditions1} instance and return the same instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + * @return The same instance of this {@link FilterConditions1} class + */ + @Nonnull + public FilterConditions1 op(@Nonnull final String op) { + this.op = op; + return this; + } + + /** + * Filter operator (e.g., 'eq', 'gte', 'lte') + * + * @return op The op of this {@link FilterConditions1} instance. + */ + @Nonnull + public String getOp() { + return op; + } + + /** + * Set the op of this {@link FilterConditions1} instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + */ + public void setOp(@Nonnull final String op) { + this.op = op; + } + + /** + * Set the value of this {@link FilterConditions1} instance and return the same instance. + * + * @param value The value of this {@link FilterConditions1} + * @return The same instance of this {@link FilterConditions1} class + */ + @Nonnull + public FilterConditions1 value(@Nullable final Object value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value The value of this {@link FilterConditions1} instance. + */ + @Nullable + public Object getValue() { + return value; + } + + /** + * Set the value of this {@link FilterConditions1} instance. + * + * @param value The value of this {@link FilterConditions1} + */ + public void setValue(@Nullable final Object value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link FilterConditions1}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FilterConditions1} 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("FilterConditions1 has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FilterConditions1} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (logic != null) declaredFields.put("logic", logic); + if (conditions != null) declaredFields.put("conditions", conditions); + if (field != null) declaredFields.put("field", field); + if (op != null) declaredFields.put("op", op); + if (value != null) declaredFields.put("value", value); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FilterConditions1} 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 FilterConditions1 filterConditions1 = (FilterConditions1) o; + return Objects.equals(this.cloudSdkCustomFields, filterConditions1.cloudSdkCustomFields) + && Objects.equals(this.logic, filterConditions1.logic) + && Objects.equals(this.conditions, filterConditions1.conditions) + && Objects.equals(this.field, filterConditions1.field) + && Objects.equals(this.op, filterConditions1.op) + && Objects.equals(this.value, filterConditions1.value); + } + + @Override + public int hashCode() { + return Objects.hash(logic, conditions, field, op, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class FilterConditions1 {\n"); + sb.append(" logic: ").append(toIndentedString(logic)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).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 FilterConditions1} + * instance with all required arguments. + */ + public static Builder create() { + return (logic) -> + (conditions) -> + (field) -> + (op) -> + (value) -> + new FilterConditions1() + .logic(logic) + .conditions(conditions) + .field(field) + .op(op) + .value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the logic of this {@link FilterConditions1} instance. + * + * @param logic Logical operator to combine conditions ('and' or 'or') + * @return The FilterConditions1 builder. + */ + Builder1 logic(@Nonnull final String logic); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the conditions of this {@link FilterConditions1} instance. + * + * @param conditions List of filter conditions + * @return The FilterConditions1 builder. + */ + Builder2 conditions(@Nonnull final List conditions); + + /** + * Set the conditions of this {@link FilterConditions1} instance. + * + * @param conditions List of filter conditions + * @return The FilterConditions1 builder. + */ + default Builder2 conditions(@Nonnull final ConditionsInner... conditions) { + return conditions(Arrays.asList(conditions)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the field of this {@link FilterConditions1} instance. + * + * @param field Field name to filter on + * @return The FilterConditions1 builder. + */ + Builder3 field(@Nonnull final String field); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the op of this {@link FilterConditions1} instance. + * + * @param op Filter operator (e.g., 'eq', 'gte', 'lte') + * @return The FilterConditions1 builder. + */ + Builder4 op(@Nonnull final String op); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the value of this {@link FilterConditions1} instance. + * + * @param value The value of this {@link FilterConditions1} + * @return The FilterConditions1 instance. + */ + FilterConditions1 value(@Nullable final Object value); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/HTTPValidationError.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/HTTPValidationError.java new file mode 100644 index 000000000..077e2ca05 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/HTTPValidationError.java @@ -0,0 +1,188 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** HTTPValidationError */ +// CHECKSTYLE:OFF +public class HTTPValidationError +// CHECKSTYLE:ON +{ + @JsonProperty("detail") + private List detail = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for HTTPValidationError. */ + protected HTTPValidationError() {} + + /** + * Set the detail of this {@link HTTPValidationError} instance and return the same instance. + * + * @param detail The detail of this {@link HTTPValidationError} + * @return The same instance of this {@link HTTPValidationError} class + */ + @Nonnull + public HTTPValidationError detail(@Nullable final List detail) { + this.detail = detail; + return this; + } + + /** + * Add one detail instance to this {@link HTTPValidationError}. + * + * @param detailItem The detail that should be added + * @return The same instance of type {@link HTTPValidationError} + */ + @Nonnull + public HTTPValidationError addDetailItem(@Nonnull final ValidationError detailItem) { + if (this.detail == null) { + this.detail = new ArrayList<>(); + } + this.detail.add(detailItem); + return this; + } + + /** + * Get detail + * + * @return detail The detail of this {@link HTTPValidationError} instance. + */ + @Nonnull + public List getDetail() { + return detail; + } + + /** + * Set the detail of this {@link HTTPValidationError} instance. + * + * @param detail The detail of this {@link HTTPValidationError} + */ + public void setDetail(@Nullable final List detail) { + this.detail = detail; + } + + /** + * Get the names of the unrecognizable properties of the {@link HTTPValidationError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link HTTPValidationError} 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( + "HTTPValidationError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link HTTPValidationError} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (detail != null) declaredFields.put("detail", detail); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link HTTPValidationError} 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 HTTPValidationError htTPValidationError = (HTTPValidationError) o; + return Objects.equals(this.cloudSdkCustomFields, htTPValidationError.cloudSdkCustomFields) + && Objects.equals(this.detail, htTPValidationError.detail); + } + + @Override + public int hashCode() { + return Objects.hash(detail, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class HTTPValidationError {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).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 HTTPValidationError} instance. No arguments are required. */ + public static HTTPValidationError create() { + return new HTTPValidationError(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/HealthResponse.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/HealthResponse.java new file mode 100644 index 000000000..8e73aa35a --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/HealthResponse.java @@ -0,0 +1,232 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** HealthResponse */ +// CHECKSTYLE:OFF +public class HealthResponse +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private Integer code; + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for HealthResponse. */ + protected HealthResponse() {} + + /** + * Set the code of this {@link HealthResponse} instance and return the same instance. + * + * @param code The code of this {@link HealthResponse} + * @return The same instance of this {@link HealthResponse} class + */ + @Nonnull + public HealthResponse code(@Nonnull final Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code The code of this {@link HealthResponse} instance. + */ + @Nonnull + public Integer getCode() { + return code; + } + + /** + * Set the code of this {@link HealthResponse} instance. + * + * @param code The code of this {@link HealthResponse} + */ + public void setCode(@Nonnull final Integer code) { + this.code = code; + } + + /** + * Set the message of this {@link HealthResponse} instance and return the same instance. + * + * @param message The message of this {@link HealthResponse} + * @return The same instance of this {@link HealthResponse} class + */ + @Nonnull + public HealthResponse message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link HealthResponse} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link HealthResponse} instance. + * + * @param message The message of this {@link HealthResponse} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link HealthResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link HealthResponse} 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("HealthResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link HealthResponse} 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 HealthResponse} 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 HealthResponse healthResponse = (HealthResponse) o; + return Objects.equals(this.cloudSdkCustomFields, healthResponse.cloudSdkCustomFields) + && Objects.equals(this.code, healthResponse.code) + && Objects.equals(this.message, healthResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class HealthResponse {\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 type-safe, fluent-api builder object to construct a new {@link HealthResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (code) -> (message) -> new HealthResponse().code(code).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link HealthResponse} instance. + * + * @param code The code of this {@link HealthResponse} + * @return The HealthResponse builder. + */ + Builder1 code(@Nonnull final Integer code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link HealthResponse} instance. + * + * @param message The message of this {@link HealthResponse} + * @return The HealthResponse instance. + */ + HealthResponse message(@Nonnull final String message); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/LocationInner.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/LocationInner.java new file mode 100644 index 000000000..1742d9fe2 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/LocationInner.java @@ -0,0 +1,49 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.model; + +import javax.annotation.Nonnull; + +/** LocationInner */ +public interface LocationInner { + /** Helper class to create {@code String } that implements {@link LocationInner}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements LocationInner {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } + + /** Helper class to create {@code Integer } that implements {@link LocationInner}. */ + record InnerInteger(@com.fasterxml.jackson.annotation.JsonValue @Nonnull Integer value) + implements LocationInner {} + + /** + * Creator to enable deserialization of {@code Integer }. + * + * @param val the value to use + * @return a new instance of {@link InnerInteger}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerInteger create(@Nonnull final Integer val) { + return new InnerInteger(val); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictMetadata.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictMetadata.java new file mode 100644 index 000000000..57338d591 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictMetadata.java @@ -0,0 +1,336 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Metadata about the prediction. */ +// CHECKSTYLE:OFF +public class PredictMetadata +// CHECKSTYLE:ON +{ + @JsonProperty("num_columns") + private Integer numColumns; + + @JsonProperty("num_rows") + private Integer numRows; + + @JsonProperty("num_predictions") + private Integer numPredictions; + + @JsonProperty("num_query_rows") + private Integer numQueryRows; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PredictMetadata. */ + protected PredictMetadata() {} + + /** + * Set the numColumns of this {@link PredictMetadata} instance and return the same instance. + * + * @param numColumns The numColumns of this {@link PredictMetadata} + * @return The same instance of this {@link PredictMetadata} class + */ + @Nonnull + public PredictMetadata numColumns(@Nonnull final Integer numColumns) { + this.numColumns = numColumns; + return this; + } + + /** + * Get numColumns + * + * @return numColumns The numColumns of this {@link PredictMetadata} instance. + */ + @Nonnull + public Integer getNumColumns() { + return numColumns; + } + + /** + * Set the numColumns of this {@link PredictMetadata} instance. + * + * @param numColumns The numColumns of this {@link PredictMetadata} + */ + public void setNumColumns(@Nonnull final Integer numColumns) { + this.numColumns = numColumns; + } + + /** + * Set the numRows of this {@link PredictMetadata} instance and return the same instance. + * + * @param numRows The numRows of this {@link PredictMetadata} + * @return The same instance of this {@link PredictMetadata} class + */ + @Nonnull + public PredictMetadata numRows(@Nonnull final Integer numRows) { + this.numRows = numRows; + return this; + } + + /** + * Get numRows + * + * @return numRows The numRows of this {@link PredictMetadata} instance. + */ + @Nonnull + public Integer getNumRows() { + return numRows; + } + + /** + * Set the numRows of this {@link PredictMetadata} instance. + * + * @param numRows The numRows of this {@link PredictMetadata} + */ + public void setNumRows(@Nonnull final Integer numRows) { + this.numRows = numRows; + } + + /** + * Set the numPredictions of this {@link PredictMetadata} instance and return the same instance. + * + * @param numPredictions The numPredictions of this {@link PredictMetadata} + * @return The same instance of this {@link PredictMetadata} class + */ + @Nonnull + public PredictMetadata numPredictions(@Nonnull final Integer numPredictions) { + this.numPredictions = numPredictions; + return this; + } + + /** + * Get numPredictions + * + * @return numPredictions The numPredictions of this {@link PredictMetadata} instance. + */ + @Nonnull + public Integer getNumPredictions() { + return numPredictions; + } + + /** + * Set the numPredictions of this {@link PredictMetadata} instance. + * + * @param numPredictions The numPredictions of this {@link PredictMetadata} + */ + public void setNumPredictions(@Nonnull final Integer numPredictions) { + this.numPredictions = numPredictions; + } + + /** + * Set the numQueryRows of this {@link PredictMetadata} instance and return the same instance. + * + * @param numQueryRows The numQueryRows of this {@link PredictMetadata} + * @return The same instance of this {@link PredictMetadata} class + */ + @Nonnull + public PredictMetadata numQueryRows(@Nonnull final Integer numQueryRows) { + this.numQueryRows = numQueryRows; + return this; + } + + /** + * Get numQueryRows + * + * @return numQueryRows The numQueryRows of this {@link PredictMetadata} instance. + */ + @Nonnull + public Integer getNumQueryRows() { + return numQueryRows; + } + + /** + * Set the numQueryRows of this {@link PredictMetadata} instance. + * + * @param numQueryRows The numQueryRows of this {@link PredictMetadata} + */ + public void setNumQueryRows(@Nonnull final Integer numQueryRows) { + this.numQueryRows = numQueryRows; + } + + /** + * Get the names of the unrecognizable properties of the {@link PredictMetadata}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PredictMetadata} 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("PredictMetadata has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PredictMetadata} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (numColumns != null) declaredFields.put("numColumns", numColumns); + if (numRows != null) declaredFields.put("numRows", numRows); + if (numPredictions != null) declaredFields.put("numPredictions", numPredictions); + if (numQueryRows != null) declaredFields.put("numQueryRows", numQueryRows); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PredictMetadata} 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 PredictMetadata predictMetadata = (PredictMetadata) o; + return Objects.equals(this.cloudSdkCustomFields, predictMetadata.cloudSdkCustomFields) + && Objects.equals(this.numColumns, predictMetadata.numColumns) + && Objects.equals(this.numRows, predictMetadata.numRows) + && Objects.equals(this.numPredictions, predictMetadata.numPredictions) + && Objects.equals(this.numQueryRows, predictMetadata.numQueryRows); + } + + @Override + public int hashCode() { + return Objects.hash(numColumns, numRows, numPredictions, numQueryRows, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PredictMetadata {\n"); + sb.append(" numColumns: ").append(toIndentedString(numColumns)).append("\n"); + sb.append(" numRows: ").append(toIndentedString(numRows)).append("\n"); + sb.append(" numPredictions: ").append(toIndentedString(numPredictions)).append("\n"); + sb.append(" numQueryRows: ").append(toIndentedString(numQueryRows)).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 PredictMetadata} + * instance with all required arguments. + */ + public static Builder create() { + return (numColumns) -> + (numRows) -> + (numPredictions) -> + (numQueryRows) -> + new PredictMetadata() + .numColumns(numColumns) + .numRows(numRows) + .numPredictions(numPredictions) + .numQueryRows(numQueryRows); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the numColumns of this {@link PredictMetadata} instance. + * + * @param numColumns The numColumns of this {@link PredictMetadata} + * @return The PredictMetadata builder. + */ + Builder1 numColumns(@Nonnull final Integer numColumns); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the numRows of this {@link PredictMetadata} instance. + * + * @param numRows The numRows of this {@link PredictMetadata} + * @return The PredictMetadata builder. + */ + Builder2 numRows(@Nonnull final Integer numRows); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the numPredictions of this {@link PredictMetadata} instance. + * + * @param numPredictions The numPredictions of this {@link PredictMetadata} + * @return The PredictMetadata builder. + */ + Builder3 numPredictions(@Nonnull final Integer numPredictions); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the numQueryRows of this {@link PredictMetadata} instance. + * + * @param numQueryRows The numQueryRows of this {@link PredictMetadata} + * @return The PredictMetadata instance. + */ + PredictMetadata numQueryRows(@Nonnull final Integer numQueryRows); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictRequest.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictRequest.java new file mode 100644 index 000000000..cbf1f88ba --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictRequest.java @@ -0,0 +1,623 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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.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; + +/** Request schema for prediction endpoint. */ +// CHECKSTYLE:OFF +public class PredictRequest +// CHECKSTYLE:ON +{ + @JsonProperty("modelName") + private TFMEnum modelName; + + @JsonProperty("scenarioConfigName") + private String scenarioConfigName; + + @JsonProperty("contextSelectionConfig") + private ContextSelectionConfig contextSelectionConfig; + + @JsonProperty("predictionConfig") + private PredictionConfig predictionConfig; + + @JsonProperty("modelConfig") + private Map modelConfig; + + @JsonProperty("columns") + private Map> columns; + + @JsonProperty("contextColumns") + private Map> contextColumns; + + @JsonProperty("rows") + private List> rows; + + @JsonProperty("contextRows") + private List> contextRows; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PredictRequest. */ + protected PredictRequest() {} + + /** + * Set the modelName of this {@link PredictRequest} instance and return the same instance. + * + * @param modelName Name of the deployed model + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest modelName(@Nonnull final TFMEnum modelName) { + this.modelName = modelName; + return this; + } + + /** + * Name of the deployed model + * + * @return modelName The modelName of this {@link PredictRequest} instance. + */ + @Nonnull + public TFMEnum getModelName() { + return modelName; + } + + /** + * Set the modelName of this {@link PredictRequest} instance. + * + * @param modelName Name of the deployed model + */ + public void setModelName(@Nonnull final TFMEnum modelName) { + this.modelName = modelName; + } + + /** + * Set the scenarioConfigName of this {@link PredictRequest} instance and return the same + * instance. + * + * @param scenarioConfigName Scenario configuration identifier + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest scenarioConfigName(@Nonnull final String scenarioConfigName) { + this.scenarioConfigName = scenarioConfigName; + return this; + } + + /** + * Scenario configuration identifier + * + * @return scenarioConfigName The scenarioConfigName of this {@link PredictRequest} instance. + */ + @Nonnull + public String getScenarioConfigName() { + return scenarioConfigName; + } + + /** + * Set the scenarioConfigName of this {@link PredictRequest} instance. + * + * @param scenarioConfigName Scenario configuration identifier + */ + public void setScenarioConfigName(@Nonnull final String scenarioConfigName) { + this.scenarioConfigName = scenarioConfigName; + } + + /** + * Set the contextSelectionConfig of this {@link PredictRequest} instance and return the same + * instance. + * + * @param contextSelectionConfig Context selection configuration + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest contextSelectionConfig( + @Nullable final ContextSelectionConfig contextSelectionConfig) { + this.contextSelectionConfig = contextSelectionConfig; + return this; + } + + /** + * Context selection configuration + * + * @return contextSelectionConfig The contextSelectionConfig of this {@link PredictRequest} + * instance. + */ + @Nonnull + public ContextSelectionConfig getContextSelectionConfig() { + return contextSelectionConfig; + } + + /** + * Set the contextSelectionConfig of this {@link PredictRequest} instance. + * + * @param contextSelectionConfig Context selection configuration + */ + public void setContextSelectionConfig( + @Nullable final ContextSelectionConfig contextSelectionConfig) { + this.contextSelectionConfig = contextSelectionConfig; + } + + /** + * Set the predictionConfig of this {@link PredictRequest} instance and return the same instance. + * + * @param predictionConfig Prediction configuration + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest predictionConfig(@Nonnull final PredictionConfig predictionConfig) { + this.predictionConfig = predictionConfig; + return this; + } + + /** + * Prediction configuration + * + * @return predictionConfig The predictionConfig of this {@link PredictRequest} instance. + */ + @Nonnull + public PredictionConfig getPredictionConfig() { + return predictionConfig; + } + + /** + * Set the predictionConfig of this {@link PredictRequest} instance. + * + * @param predictionConfig Prediction configuration + */ + public void setPredictionConfig(@Nonnull final PredictionConfig predictionConfig) { + this.predictionConfig = predictionConfig; + } + + /** + * Set the modelConfig of this {@link PredictRequest} instance and return the same instance. + * + * @param modelConfig Model-specific configuration passed through to the underlying TFM as + * top-level fields of the prediction request payload + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest modelConfig(@Nullable final Map modelConfig) { + this.modelConfig = modelConfig; + return this; + } + + /** + * Put one modelConfig instance to this {@link PredictRequest} instance. + * + * @param key The String key of this modelConfig instance + * @param modelConfigItem The modelConfig that should be added under the given key + * @return The same instance of type {@link PredictRequest} + */ + @Nonnull + public PredictRequest putmodelConfigItem( + @Nonnull final String key, @Nullable final Object modelConfigItem) { + if (this.modelConfig == null) { + this.modelConfig = new HashMap<>(); + } + this.modelConfig.put(key, modelConfigItem); + return this; + } + + /** + * Model-specific configuration passed through to the underlying TFM as top-level fields of the + * prediction request payload + * + * @return modelConfig The modelConfig of this {@link PredictRequest} instance. + */ + @Nonnull + public Map getModelConfig() { + return modelConfig; + } + + /** + * Set the modelConfig of this {@link PredictRequest} instance. + * + * @param modelConfig Model-specific configuration passed through to the underlying TFM as + * top-level fields of the prediction request payload + */ + public void setModelConfig(@Nullable final Map modelConfig) { + this.modelConfig = modelConfig; + } + + /** + * Set the columns of this {@link PredictRequest} instance and return the same instance. + * + * @param columns Query-only rows in columnar form. An object mapping from column name to array of + * column values. + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest columns(@Nullable final Map> columns) { + this.columns = columns; + return this; + } + + /** + * Put one columns instance to this {@link PredictRequest} instance. + * + * @param key The String key of this columns instance + * @param columnsItem The columns that should be added under the given key + * @return The same instance of type {@link PredictRequest} + */ + @Nonnull + public PredictRequest putcolumnsItem( + @Nonnull final String key, @Nonnull final List columnsItem) { + if (this.columns == null) { + this.columns = new HashMap<>(); + } + this.columns.put(key, columnsItem); + return this; + } + + /** + * Query-only rows in columnar form. An object mapping from column name to array of column values. + * + * @return columns The columns of this {@link PredictRequest} instance. + */ + @Nullable + public Map> getColumns() { + return columns; + } + + /** + * Set the columns of this {@link PredictRequest} instance. + * + * @param columns Query-only rows in columnar form. An object mapping from column name to array of + * column values. + */ + public void setColumns(@Nullable final Map> columns) { + this.columns = columns; + } + + /** + * Set the contextColumns of this {@link PredictRequest} instance and return the same instance. + * + * @param contextColumns (Optional) Context rows in columnar form, only relevant if + * 'columns' is provided. An object mapping from column name to array of column + * values. + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest contextColumns(@Nullable final Map> contextColumns) { + this.contextColumns = contextColumns; + return this; + } + + /** + * Put one contextColumns instance to this {@link PredictRequest} instance. + * + * @param key The String key of this contextColumns instance + * @param contextColumnsItem The contextColumns that should be added under the given key + * @return The same instance of type {@link PredictRequest} + */ + @Nonnull + public PredictRequest putcontextColumnsItem( + @Nonnull final String key, @Nonnull final List contextColumnsItem) { + if (this.contextColumns == null) { + this.contextColumns = new HashMap<>(); + } + this.contextColumns.put(key, contextColumnsItem); + return this; + } + + /** + * (Optional) Context rows in columnar form, only relevant if 'columns' is provided. An + * object mapping from column name to array of column values. + * + * @return contextColumns The contextColumns of this {@link PredictRequest} instance. + */ + @Nullable + public Map> getContextColumns() { + return contextColumns; + } + + /** + * Set the contextColumns of this {@link PredictRequest} instance. + * + * @param contextColumns (Optional) Context rows in columnar form, only relevant if + * 'columns' is provided. An object mapping from column name to array of column + * values. + */ + public void setContextColumns(@Nullable final Map> contextColumns) { + this.contextColumns = contextColumns; + } + + /** + * Set the rows of this {@link PredictRequest} instance and return the same instance. + * + * @param rows Query-only rows in row form. An array of objects representing table rows. + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest rows(@Nullable final List> rows) { + this.rows = rows; + return this; + } + + /** + * Add one rows instance to this {@link PredictRequest}. + * + * @param rowsItem The rows that should be added + * @return The same instance of type {@link PredictRequest} + */ + @Nonnull + public PredictRequest addRowsItem(@Nonnull final Map rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Query-only rows in row form. An array of objects representing table rows. + * + * @return rows The rows of this {@link PredictRequest} instance. + */ + @Nullable + public List> getRows() { + return rows; + } + + /** + * Set the rows of this {@link PredictRequest} instance. + * + * @param rows Query-only rows in row form. An array of objects representing table rows. + */ + public void setRows(@Nullable final List> rows) { + this.rows = rows; + } + + /** + * Set the contextRows of this {@link PredictRequest} instance and return the same instance. + * + * @param contextRows (Optional) Context rows in row form, only relevant if 'rows' is + * provided. An array of objects representing table rows. + * @return The same instance of this {@link PredictRequest} class + */ + @Nonnull + public PredictRequest contextRows(@Nullable final List> contextRows) { + this.contextRows = contextRows; + return this; + } + + /** + * Add one contextRows instance to this {@link PredictRequest}. + * + * @param contextRowsItem The contextRows that should be added + * @return The same instance of type {@link PredictRequest} + */ + @Nonnull + public PredictRequest addContextRowsItem(@Nonnull final Map contextRowsItem) { + if (this.contextRows == null) { + this.contextRows = new ArrayList<>(); + } + this.contextRows.add(contextRowsItem); + return this; + } + + /** + * (Optional) Context rows in row form, only relevant if 'rows' is provided. An array of + * objects representing table rows. + * + * @return contextRows The contextRows of this {@link PredictRequest} instance. + */ + @Nullable + public List> getContextRows() { + return contextRows; + } + + /** + * Set the contextRows of this {@link PredictRequest} instance. + * + * @param contextRows (Optional) Context rows in row form, only relevant if 'rows' is + * provided. An array of objects representing table rows. + */ + public void setContextRows(@Nullable final List> contextRows) { + this.contextRows = contextRows; + } + + /** + * Get the names of the unrecognizable properties of the {@link PredictRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PredictRequest} 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("PredictRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PredictRequest} 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); + if (scenarioConfigName != null) declaredFields.put("scenarioConfigName", scenarioConfigName); + if (contextSelectionConfig != null) + declaredFields.put("contextSelectionConfig", contextSelectionConfig); + if (predictionConfig != null) declaredFields.put("predictionConfig", predictionConfig); + if (modelConfig != null) declaredFields.put("modelConfig", modelConfig); + if (columns != null) declaredFields.put("columns", columns); + if (contextColumns != null) declaredFields.put("contextColumns", contextColumns); + if (rows != null) declaredFields.put("rows", rows); + if (contextRows != null) declaredFields.put("contextRows", contextRows); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PredictRequest} 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 PredictRequest predictRequest = (PredictRequest) o; + return Objects.equals(this.cloudSdkCustomFields, predictRequest.cloudSdkCustomFields) + && Objects.equals(this.modelName, predictRequest.modelName) + && Objects.equals(this.scenarioConfigName, predictRequest.scenarioConfigName) + && Objects.equals(this.contextSelectionConfig, predictRequest.contextSelectionConfig) + && Objects.equals(this.predictionConfig, predictRequest.predictionConfig) + && Objects.equals(this.modelConfig, predictRequest.modelConfig) + && Objects.equals(this.columns, predictRequest.columns) + && Objects.equals(this.contextColumns, predictRequest.contextColumns) + && Objects.equals(this.rows, predictRequest.rows) + && Objects.equals(this.contextRows, predictRequest.contextRows); + } + + @Override + public int hashCode() { + return Objects.hash( + modelName, + scenarioConfigName, + contextSelectionConfig, + predictionConfig, + modelConfig, + columns, + contextColumns, + rows, + contextRows, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PredictRequest {\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" scenarioConfigName: ").append(toIndentedString(scenarioConfigName)).append("\n"); + sb.append(" contextSelectionConfig: ") + .append(toIndentedString(contextSelectionConfig)) + .append("\n"); + sb.append(" predictionConfig: ").append(toIndentedString(predictionConfig)).append("\n"); + sb.append(" modelConfig: ").append(toIndentedString(modelConfig)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" contextColumns: ").append(toIndentedString(contextColumns)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" contextRows: ").append(toIndentedString(contextRows)).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 PredictRequest} + * instance with all required arguments. + */ + public static Builder create() { + return (modelName) -> + (scenarioConfigName) -> + (predictionConfig) -> + new PredictRequest() + .modelName(modelName) + .scenarioConfigName(scenarioConfigName) + .predictionConfig(predictionConfig); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the modelName of this {@link PredictRequest} instance. + * + * @param modelName Name of the deployed model + * @return The PredictRequest builder. + */ + Builder1 modelName(@Nonnull final TFMEnum modelName); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the scenarioConfigName of this {@link PredictRequest} instance. + * + * @param scenarioConfigName Scenario configuration identifier + * @return The PredictRequest builder. + */ + Builder2 scenarioConfigName(@Nonnull final String scenarioConfigName); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the predictionConfig of this {@link PredictRequest} instance. + * + * @param predictionConfig Prediction configuration + * @return The PredictRequest instance. + */ + PredictRequest predictionConfig(@Nonnull final PredictionConfig predictionConfig); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictResponse.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictResponse.java new file mode 100644 index 000000000..6d8d5978f --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictResponse.java @@ -0,0 +1,431 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** + * Response schema for prediction endpoint. Example response: { \"id\": + * \"8f15bafd-5fb8-4a35-bd2f-43c3b5887584\", \"metadata\": { + * \"num_columns\": 5, \"num_predictions\": 1, \"num_query_rows\": 1, + * \"num_rows\": 3 }, \"predictions\": [ { \"category\": [ { + * \"confidence\": 0.71, \"prediction\": \"Electronics\" } ], + * \"id\": 4 } ], \"status\": { \"code\": 0, \"message\": + * \"ok\" } } + */ +// CHECKSTYLE:OFF +public class PredictResponse +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("metadata") + private PredictMetadata metadata; + + @JsonProperty("predictions") + private List> predictions = new ArrayList<>(); + + @JsonProperty("status") + private PredictStatus status; + + @JsonProperty("additional_information") + private List additionalInformation = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PredictResponse. */ + protected PredictResponse() {} + + /** + * Set the id of this {@link PredictResponse} instance and return the same instance. + * + * @param id The id of this {@link PredictResponse} + * @return The same instance of this {@link PredictResponse} class + */ + @Nonnull + public PredictResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PredictResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link PredictResponse} instance. + * + * @param id The id of this {@link PredictResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the metadata of this {@link PredictResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link PredictResponse} + * @return The same instance of this {@link PredictResponse} class + */ + @Nonnull + public PredictResponse metadata(@Nonnull final PredictMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link PredictResponse} instance. + */ + @Nonnull + public PredictMetadata getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link PredictResponse} instance. + * + * @param metadata The metadata of this {@link PredictResponse} + */ + public void setMetadata(@Nonnull final PredictMetadata metadata) { + this.metadata = metadata; + } + + /** + * Set the predictions of this {@link PredictResponse} instance and return the same instance. + * + * @param predictions The predictions of this {@link PredictResponse} + * @return The same instance of this {@link PredictResponse} class + */ + @Nonnull + public PredictResponse predictions(@Nonnull final List> predictions) { + this.predictions = predictions; + return this; + } + + /** + * Add one predictions instance to this {@link PredictResponse}. + * + * @param predictionsItem The predictions that should be added + * @return The same instance of type {@link PredictResponse} + */ + @Nonnull + public PredictResponse addPredictionsItem(@Nonnull final Map predictionsItem) { + if (this.predictions == null) { + this.predictions = new ArrayList<>(); + } + this.predictions.add(predictionsItem); + return this; + } + + /** + * Get predictions + * + * @return predictions The predictions of this {@link PredictResponse} instance. + */ + @Nonnull + public List> getPredictions() { + return predictions; + } + + /** + * Set the predictions of this {@link PredictResponse} instance. + * + * @param predictions The predictions of this {@link PredictResponse} + */ + public void setPredictions(@Nonnull final List> predictions) { + this.predictions = predictions; + } + + /** + * Set the status of this {@link PredictResponse} instance and return the same instance. + * + * @param status The status of this {@link PredictResponse} + * @return The same instance of this {@link PredictResponse} class + */ + @Nonnull + public PredictResponse status(@Nonnull final PredictStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link PredictResponse} instance. + */ + @Nonnull + public PredictStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link PredictResponse} instance. + * + * @param status The status of this {@link PredictResponse} + */ + public void setStatus(@Nonnull final PredictStatus status) { + this.status = status; + } + + /** + * Set the additionalInformation of this {@link PredictResponse} instance and return the same + * instance. + * + * @param additionalInformation Warnings or informational messages from context selection + * @return The same instance of this {@link PredictResponse} class + */ + @Nonnull + public PredictResponse additionalInformation(@Nullable final List additionalInformation) { + this.additionalInformation = additionalInformation; + return this; + } + + /** + * Add one additionalInformation instance to this {@link PredictResponse}. + * + * @param additionalInformationItem The additionalInformation that should be added + * @return The same instance of type {@link PredictResponse} + */ + @Nonnull + public PredictResponse addAdditionalInformationItem( + @Nonnull final String additionalInformationItem) { + if (this.additionalInformation == null) { + this.additionalInformation = new ArrayList<>(); + } + this.additionalInformation.add(additionalInformationItem); + return this; + } + + /** + * Warnings or informational messages from context selection + * + * @return additionalInformation The additionalInformation of this {@link PredictResponse} + * instance. + */ + @Nonnull + public List getAdditionalInformation() { + return additionalInformation; + } + + /** + * Set the additionalInformation of this {@link PredictResponse} instance. + * + * @param additionalInformation Warnings or informational messages from context selection + */ + public void setAdditionalInformation(@Nullable final List additionalInformation) { + this.additionalInformation = additionalInformation; + } + + /** + * Get the names of the unrecognizable properties of the {@link PredictResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PredictResponse} 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("PredictResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PredictResponse} 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 (predictions != null) declaredFields.put("predictions", predictions); + if (status != null) declaredFields.put("status", status); + if (additionalInformation != null) + declaredFields.put("additionalInformation", additionalInformation); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PredictResponse} 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 PredictResponse predictResponse = (PredictResponse) o; + return Objects.equals(this.cloudSdkCustomFields, predictResponse.cloudSdkCustomFields) + && Objects.equals(this.id, predictResponse.id) + && Objects.equals(this.metadata, predictResponse.metadata) + && Objects.equals(this.predictions, predictResponse.predictions) + && Objects.equals(this.status, predictResponse.status) + && Objects.equals(this.additionalInformation, predictResponse.additionalInformation); + } + + @Override + public int hashCode() { + return Objects.hash( + id, metadata, predictions, status, additionalInformation, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PredictResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" predictions: ").append(toIndentedString(predictions)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalInformation: ") + .append(toIndentedString(additionalInformation)) + .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 PredictResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (metadata) -> + (predictions) -> + (status) -> + new PredictResponse() + .id(id) + .metadata(metadata) + .predictions(predictions) + .status(status); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link PredictResponse} instance. + * + * @param id The id of this {@link PredictResponse} + * @return The PredictResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link PredictResponse} instance. + * + * @param metadata The metadata of this {@link PredictResponse} + * @return The PredictResponse builder. + */ + Builder2 metadata(@Nonnull final PredictMetadata metadata); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the predictions of this {@link PredictResponse} instance. + * + * @param predictions The predictions of this {@link PredictResponse} + * @return The PredictResponse builder. + */ + Builder3 predictions(@Nonnull final List> predictions); + + /** + * Set the predictions of this {@link PredictResponse} instance. + * + * @param predictions The predictions of this {@link PredictResponse} + * @return The PredictResponse builder. + */ + default Builder3 predictions(@Nonnull final Map... predictions) { + return predictions(Arrays.asList(predictions)); + } + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the status of this {@link PredictResponse} instance. + * + * @param status The status of this {@link PredictResponse} + * @return The PredictResponse instance. + */ + PredictResponse status(@Nonnull final PredictStatus status); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictStatus.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictStatus.java new file mode 100644 index 000000000..e8989ef96 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictStatus.java @@ -0,0 +1,232 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Status of the prediction. */ +// CHECKSTYLE:OFF +public class PredictStatus +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private Integer code; + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PredictStatus. */ + protected PredictStatus() {} + + /** + * Set the code of this {@link PredictStatus} instance and return the same instance. + * + * @param code The code of this {@link PredictStatus} + * @return The same instance of this {@link PredictStatus} class + */ + @Nonnull + public PredictStatus code(@Nonnull final Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code The code of this {@link PredictStatus} instance. + */ + @Nonnull + public Integer getCode() { + return code; + } + + /** + * Set the code of this {@link PredictStatus} instance. + * + * @param code The code of this {@link PredictStatus} + */ + public void setCode(@Nonnull final Integer code) { + this.code = code; + } + + /** + * Set the message of this {@link PredictStatus} instance and return the same instance. + * + * @param message The message of this {@link PredictStatus} + * @return The same instance of this {@link PredictStatus} class + */ + @Nonnull + public PredictStatus message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link PredictStatus} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link PredictStatus} instance. + * + * @param message The message of this {@link PredictStatus} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link PredictStatus}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PredictStatus} 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("PredictStatus has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PredictStatus} 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 PredictStatus} 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 PredictStatus predictStatus = (PredictStatus) o; + return Objects.equals(this.cloudSdkCustomFields, predictStatus.cloudSdkCustomFields) + && Objects.equals(this.code, predictStatus.code) + && Objects.equals(this.message, predictStatus.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PredictStatus {\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 type-safe, fluent-api builder object to construct a new {@link PredictStatus} instance + * with all required arguments. + */ + public static Builder create() { + return (code) -> (message) -> new PredictStatus().code(code).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link PredictStatus} instance. + * + * @param code The code of this {@link PredictStatus} + * @return The PredictStatus builder. + */ + Builder1 code(@Nonnull final Integer code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link PredictStatus} instance. + * + * @param message The message of this {@link PredictStatus} + * @return The PredictStatus instance. + */ + PredictStatus message(@Nonnull final String message); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictionConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictionConfig.java new file mode 100644 index 000000000..8b5eba7db --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/PredictionConfig.java @@ -0,0 +1,215 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** + * Configuration for what to predict. Model-agnostic prediction config. Only contains fields shared + * across all TFMs. Model-specific fields belong in `PredictRequest.modelConfig`. + */ +// CHECKSTYLE:OFF +public class PredictionConfig +// CHECKSTYLE:ON +{ + @JsonProperty("targetColumns") + private List targetColumns = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PredictionConfig. */ + protected PredictionConfig() {} + + /** + * Set the targetColumns of this {@link PredictionConfig} instance and return the same instance. + * + * @param targetColumns List of target columns with prediction configuration + * @return The same instance of this {@link PredictionConfig} class + */ + @Nonnull + public PredictionConfig targetColumns(@Nonnull final List targetColumns) { + this.targetColumns = targetColumns; + return this; + } + + /** + * Add one targetColumns instance to this {@link PredictionConfig}. + * + * @param targetColumnsItem The targetColumns that should be added + * @return The same instance of type {@link PredictionConfig} + */ + @Nonnull + public PredictionConfig addTargetColumnsItem(@Nonnull final TargetColumn targetColumnsItem) { + if (this.targetColumns == null) { + this.targetColumns = new ArrayList<>(); + } + this.targetColumns.add(targetColumnsItem); + return this; + } + + /** + * List of target columns with prediction configuration + * + * @return targetColumns The targetColumns of this {@link PredictionConfig} instance. + */ + @Nonnull + public List getTargetColumns() { + return targetColumns; + } + + /** + * Set the targetColumns of this {@link PredictionConfig} instance. + * + * @param targetColumns List of target columns with prediction configuration + */ + public void setTargetColumns(@Nonnull final List targetColumns) { + this.targetColumns = targetColumns; + } + + /** + * Get the names of the unrecognizable properties of the {@link PredictionConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PredictionConfig} 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("PredictionConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PredictionConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (targetColumns != null) declaredFields.put("targetColumns", targetColumns); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PredictionConfig} 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 PredictionConfig predictionConfig = (PredictionConfig) o; + return Objects.equals(this.cloudSdkCustomFields, predictionConfig.cloudSdkCustomFields) + && Objects.equals(this.targetColumns, predictionConfig.targetColumns); + } + + @Override + public int hashCode() { + return Objects.hash(targetColumns, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PredictionConfig {\n"); + sb.append(" targetColumns: ").append(toIndentedString(targetColumns)).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 PredictionConfig} + * instance with all required arguments. + */ + public static Builder create() { + return (targetColumns) -> new PredictionConfig().targetColumns(targetColumns); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the targetColumns of this {@link PredictionConfig} instance. + * + * @param targetColumns List of target columns with prediction configuration + * @return The PredictionConfig instance. + */ + PredictionConfig targetColumns(@Nonnull final List targetColumns); + + /** + * Set the targetColumns of this {@link PredictionConfig} instance. + * + * @param targetColumns List of target columns with prediction configuration + * @return The PredictionConfig instance. + */ + default PredictionConfig targetColumns(@Nonnull final TargetColumn... targetColumns) { + return targetColumns(Arrays.asList(targetColumns)); + } + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/SamplingHeuristicConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/SamplingHeuristicConfig.java new file mode 100644 index 000000000..804f7933e --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/SamplingHeuristicConfig.java @@ -0,0 +1,409 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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.math.BigDecimal; +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; + +/** Strategy-specific configuration parameters for Heuristic. */ +// CHECKSTYLE:OFF +public class SamplingHeuristicConfig +// CHECKSTYLE:ON +{ + @JsonProperty("indexColumn") + private String indexColumn; + + @JsonProperty("methodRatio") + private BigDecimal methodRatio; + + @JsonProperty("fuzzyNumPct") + private BigDecimal fuzzyNumPct; + + @JsonProperty("poolSize") + private Integer poolSize; + + @JsonProperty("fuzzyDateDays") + private Integer fuzzyDateDays; + + @JsonProperty("allowTimeoutFallback") + private Boolean allowTimeoutFallback = false; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SamplingHeuristicConfig. */ + protected SamplingHeuristicConfig() {} + + /** + * Set the indexColumn of this {@link SamplingHeuristicConfig} instance and return the same + * instance. + * + * @param indexColumn Name of the unique row-identifier column (e.g. 'ROW_INDEX'). + * Required for Heuristic scoring and deduplication. + * @return The same instance of this {@link SamplingHeuristicConfig} class + */ + @Nonnull + public SamplingHeuristicConfig indexColumn(@Nonnull final String indexColumn) { + this.indexColumn = indexColumn; + return this; + } + + /** + * Name of the unique row-identifier column (e.g. 'ROW_INDEX'). Required for Heuristic + * scoring and deduplication. + * + * @return indexColumn The indexColumn of this {@link SamplingHeuristicConfig} instance. + */ + @Nonnull + public String getIndexColumn() { + return indexColumn; + } + + /** + * Set the indexColumn of this {@link SamplingHeuristicConfig} instance. + * + * @param indexColumn Name of the unique row-identifier column (e.g. 'ROW_INDEX'). + * Required for Heuristic scoring and deduplication. + */ + public void setIndexColumn(@Nonnull final String indexColumn) { + this.indexColumn = indexColumn; + } + + /** + * Set the methodRatio of this {@link SamplingHeuristicConfig} instance and return the same + * instance. + * + * @param methodRatio Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + * @return The same instance of this {@link SamplingHeuristicConfig} class + */ + @Nonnull + public SamplingHeuristicConfig methodRatio(@Nullable final BigDecimal methodRatio) { + this.methodRatio = methodRatio; + return this; + } + + /** + * Fraction of numRows filled by scoring method (remainder is random fill). Must be between 0 and + * 1. + * + * @return methodRatio The methodRatio of this {@link SamplingHeuristicConfig} instance. + */ + @Nullable + public BigDecimal getMethodRatio() { + return methodRatio; + } + + /** + * Set the methodRatio of this {@link SamplingHeuristicConfig} instance. + * + * @param methodRatio Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + */ + public void setMethodRatio(@Nullable final BigDecimal methodRatio) { + this.methodRatio = methodRatio; + } + + /** + * Set the fuzzyNumPct of this {@link SamplingHeuristicConfig} instance and return the same + * instance. + * + * @param fuzzyNumPct Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + * @return The same instance of this {@link SamplingHeuristicConfig} class + */ + @Nonnull + public SamplingHeuristicConfig fuzzyNumPct(@Nullable final BigDecimal fuzzyNumPct) { + this.fuzzyNumPct = fuzzyNumPct; + return this; + } + + /** + * Fraction of numRows filled by scoring method (remainder is random fill). Must be between 0 and + * 1. + * + * @return fuzzyNumPct The fuzzyNumPct of this {@link SamplingHeuristicConfig} instance. + */ + @Nullable + public BigDecimal getFuzzyNumPct() { + return fuzzyNumPct; + } + + /** + * Set the fuzzyNumPct of this {@link SamplingHeuristicConfig} instance. + * + * @param fuzzyNumPct Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + */ + public void setFuzzyNumPct(@Nullable final BigDecimal fuzzyNumPct) { + this.fuzzyNumPct = fuzzyNumPct; + } + + /** + * Set the poolSize of this {@link SamplingHeuristicConfig} instance and return the same instance. + * + * @param poolSize If set, scoring runs against a random subsample of this many rows instead of + * the full table. None = full table scan. + * @return The same instance of this {@link SamplingHeuristicConfig} class + */ + @Nonnull + public SamplingHeuristicConfig poolSize(@Nullable final Integer poolSize) { + this.poolSize = poolSize; + return this; + } + + /** + * If set, scoring runs against a random subsample of this many rows instead of the full table. + * None = full table scan. + * + * @return poolSize The poolSize of this {@link SamplingHeuristicConfig} instance. + */ + @Nullable + public Integer getPoolSize() { + return poolSize; + } + + /** + * Set the poolSize of this {@link SamplingHeuristicConfig} instance. + * + * @param poolSize If set, scoring runs against a random subsample of this many rows instead of + * the full table. None = full table scan. + */ + public void setPoolSize(@Nullable final Integer poolSize) { + this.poolSize = poolSize; + } + + /** + * Set the fuzzyDateDays of this {@link SamplingHeuristicConfig} instance and return the same + * instance. + * + * @param fuzzyDateDays Day window for fuzzy date matching. A date column scores 1 if + * abs(DAYS_BETWEEN(row_date, query_date)) <= dateFuzzyDays. Set to 0 for exact date + * match. + * @return The same instance of this {@link SamplingHeuristicConfig} class + */ + @Nonnull + public SamplingHeuristicConfig fuzzyDateDays(@Nullable final Integer fuzzyDateDays) { + this.fuzzyDateDays = fuzzyDateDays; + return this; + } + + /** + * Day window for fuzzy date matching. A date column scores 1 if abs(DAYS_BETWEEN(row_date, + * query_date)) <= dateFuzzyDays. Set to 0 for exact date match. + * + * @return fuzzyDateDays The fuzzyDateDays of this {@link SamplingHeuristicConfig} instance. + */ + @Nullable + public Integer getFuzzyDateDays() { + return fuzzyDateDays; + } + + /** + * Set the fuzzyDateDays of this {@link SamplingHeuristicConfig} instance. + * + * @param fuzzyDateDays Day window for fuzzy date matching. A date column scores 1 if + * abs(DAYS_BETWEEN(row_date, query_date)) <= dateFuzzyDays. Set to 0 for exact date + * match. + */ + public void setFuzzyDateDays(@Nullable final Integer fuzzyDateDays) { + this.fuzzyDateDays = fuzzyDateDays; + } + + /** + * Set the allowTimeoutFallback of this {@link SamplingHeuristicConfig} instance and return the + * same instance. + * + * @param allowTimeoutFallback When true, heuristic sampling falls back to random on timeout + * instead of raising an error. Set by the orchestrator when strategy=AUTO. + * @return The same instance of this {@link SamplingHeuristicConfig} class + */ + @Nonnull + public SamplingHeuristicConfig allowTimeoutFallback( + @Nullable final Boolean allowTimeoutFallback) { + this.allowTimeoutFallback = allowTimeoutFallback; + return this; + } + + /** + * When true, heuristic sampling falls back to random on timeout instead of raising an error. Set + * by the orchestrator when strategy=AUTO. + * + * @return allowTimeoutFallback The allowTimeoutFallback of this {@link SamplingHeuristicConfig} + * instance. + */ + @Nonnull + public Boolean isAllowTimeoutFallback() { + return allowTimeoutFallback; + } + + /** + * Set the allowTimeoutFallback of this {@link SamplingHeuristicConfig} instance. + * + * @param allowTimeoutFallback When true, heuristic sampling falls back to random on timeout + * instead of raising an error. Set by the orchestrator when strategy=AUTO. + */ + public void setAllowTimeoutFallback(@Nullable final Boolean allowTimeoutFallback) { + this.allowTimeoutFallback = allowTimeoutFallback; + } + + /** + * Get the names of the unrecognizable properties of the {@link SamplingHeuristicConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SamplingHeuristicConfig} 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( + "SamplingHeuristicConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SamplingHeuristicConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (indexColumn != null) declaredFields.put("indexColumn", indexColumn); + if (methodRatio != null) declaredFields.put("methodRatio", methodRatio); + if (fuzzyNumPct != null) declaredFields.put("fuzzyNumPct", fuzzyNumPct); + if (poolSize != null) declaredFields.put("poolSize", poolSize); + if (fuzzyDateDays != null) declaredFields.put("fuzzyDateDays", fuzzyDateDays); + if (allowTimeoutFallback != null) + declaredFields.put("allowTimeoutFallback", allowTimeoutFallback); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SamplingHeuristicConfig} 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 SamplingHeuristicConfig samplingHeuristicConfig = (SamplingHeuristicConfig) o; + return Objects.equals(this.cloudSdkCustomFields, samplingHeuristicConfig.cloudSdkCustomFields) + && Objects.equals(this.indexColumn, samplingHeuristicConfig.indexColumn) + && Objects.equals(this.methodRatio, samplingHeuristicConfig.methodRatio) + && Objects.equals(this.fuzzyNumPct, samplingHeuristicConfig.fuzzyNumPct) + && Objects.equals(this.poolSize, samplingHeuristicConfig.poolSize) + && Objects.equals(this.fuzzyDateDays, samplingHeuristicConfig.fuzzyDateDays) + && Objects.equals(this.allowTimeoutFallback, samplingHeuristicConfig.allowTimeoutFallback); + } + + @Override + public int hashCode() { + return Objects.hash( + indexColumn, + methodRatio, + fuzzyNumPct, + poolSize, + fuzzyDateDays, + allowTimeoutFallback, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SamplingHeuristicConfig {\n"); + sb.append(" indexColumn: ").append(toIndentedString(indexColumn)).append("\n"); + sb.append(" methodRatio: ").append(toIndentedString(methodRatio)).append("\n"); + sb.append(" fuzzyNumPct: ").append(toIndentedString(fuzzyNumPct)).append("\n"); + sb.append(" poolSize: ").append(toIndentedString(poolSize)).append("\n"); + sb.append(" fuzzyDateDays: ").append(toIndentedString(fuzzyDateDays)).append("\n"); + sb.append(" allowTimeoutFallback: ") + .append(toIndentedString(allowTimeoutFallback)) + .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 + * SamplingHeuristicConfig} instance with all required arguments. + */ + public static Builder create() { + return (indexColumn) -> new SamplingHeuristicConfig().indexColumn(indexColumn); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the indexColumn of this {@link SamplingHeuristicConfig} instance. + * + * @param indexColumn Name of the unique row-identifier column (e.g. 'ROW_INDEX'). + * Required for Heuristic scoring and deduplication. + * @return The SamplingHeuristicConfig instance. + */ + SamplingHeuristicConfig indexColumn(@Nonnull final String indexColumn); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/SamplingRandomConfig.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/SamplingRandomConfig.java new file mode 100644 index 000000000..3683fe380 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/SamplingRandomConfig.java @@ -0,0 +1,214 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Strategy-specific configuration parameters for Random. */ +// CHECKSTYLE:OFF +public class SamplingRandomConfig +// CHECKSTYLE:ON +{ + @JsonProperty("indexColumn") + private String indexColumn; + + @JsonProperty("deterministic") + private Boolean deterministic = false; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SamplingRandomConfig. */ + protected SamplingRandomConfig() {} + + /** + * Set the indexColumn of this {@link SamplingRandomConfig} instance and return the same instance. + * + * @param indexColumn Name of the unique row-identifier column. Required when + * deterministic=True. + * @return The same instance of this {@link SamplingRandomConfig} class + */ + @Nonnull + public SamplingRandomConfig indexColumn(@Nullable final String indexColumn) { + this.indexColumn = indexColumn; + return this; + } + + /** + * Name of the unique row-identifier column. Required when deterministic=True. + * + * @return indexColumn The indexColumn of this {@link SamplingRandomConfig} instance. + */ + @Nullable + public String getIndexColumn() { + return indexColumn; + } + + /** + * Set the indexColumn of this {@link SamplingRandomConfig} instance. + * + * @param indexColumn Name of the unique row-identifier column. Required when + * deterministic=True. + */ + public void setIndexColumn(@Nullable final String indexColumn) { + this.indexColumn = indexColumn; + } + + /** + * Set the deterministic of this {@link SamplingRandomConfig} instance and return the same + * instance. + * + * @param deterministic When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), + * producing the same row order on every call for the same data. + * @return The same instance of this {@link SamplingRandomConfig} class + */ + @Nonnull + public SamplingRandomConfig deterministic(@Nullable final Boolean deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), producing the same + * row order on every call for the same data. + * + * @return deterministic The deterministic of this {@link SamplingRandomConfig} instance. + */ + @Nonnull + public Boolean isDeterministic() { + return deterministic; + } + + /** + * Set the deterministic of this {@link SamplingRandomConfig} instance. + * + * @param deterministic When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), + * producing the same row order on every call for the same data. + */ + public void setDeterministic(@Nullable final Boolean deterministic) { + this.deterministic = deterministic; + } + + /** + * Get the names of the unrecognizable properties of the {@link SamplingRandomConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SamplingRandomConfig} 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( + "SamplingRandomConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SamplingRandomConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (indexColumn != null) declaredFields.put("indexColumn", indexColumn); + if (deterministic != null) declaredFields.put("deterministic", deterministic); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SamplingRandomConfig} 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 SamplingRandomConfig samplingRandomConfig = (SamplingRandomConfig) o; + return Objects.equals(this.cloudSdkCustomFields, samplingRandomConfig.cloudSdkCustomFields) + && Objects.equals(this.indexColumn, samplingRandomConfig.indexColumn) + && Objects.equals(this.deterministic, samplingRandomConfig.deterministic); + } + + @Override + public int hashCode() { + return Objects.hash(indexColumn, deterministic, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SamplingRandomConfig {\n"); + sb.append(" indexColumn: ").append(toIndentedString(indexColumn)).append("\n"); + sb.append(" deterministic: ").append(toIndentedString(deterministic)).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 SamplingRandomConfig} instance. No arguments are required. */ + public static SamplingRandomConfig create() { + return new SamplingRandomConfig(); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/StrategyConfigs.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/StrategyConfigs.java new file mode 100644 index 000000000..56a479b65 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/StrategyConfigs.java @@ -0,0 +1,443 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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.math.BigDecimal; +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; + +/** Strategy-specific configuration parameters. */ +// CHECKSTYLE:OFF +public class StrategyConfigs +// CHECKSTYLE:ON +{ + @JsonProperty("indexColumn") + private String indexColumn; + + @JsonProperty("deterministic") + private Boolean deterministic = false; + + @JsonProperty("methodRatio") + private BigDecimal methodRatio; + + @JsonProperty("fuzzyNumPct") + private BigDecimal fuzzyNumPct; + + @JsonProperty("poolSize") + private Integer poolSize; + + @JsonProperty("fuzzyDateDays") + private Integer fuzzyDateDays; + + @JsonProperty("allowTimeoutFallback") + private Boolean allowTimeoutFallback = false; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for StrategyConfigs. */ + protected StrategyConfigs() {} + + /** + * Set the indexColumn of this {@link StrategyConfigs} instance and return the same instance. + * + * @param indexColumn Name of the unique row-identifier column (e.g. 'ROW_INDEX'). + * Required for Heuristic scoring and deduplication. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs indexColumn(@Nonnull final String indexColumn) { + this.indexColumn = indexColumn; + return this; + } + + /** + * Name of the unique row-identifier column (e.g. 'ROW_INDEX'). Required for Heuristic + * scoring and deduplication. + * + * @return indexColumn The indexColumn of this {@link StrategyConfigs} instance. + */ + @Nonnull + public String getIndexColumn() { + return indexColumn; + } + + /** + * Set the indexColumn of this {@link StrategyConfigs} instance. + * + * @param indexColumn Name of the unique row-identifier column (e.g. 'ROW_INDEX'). + * Required for Heuristic scoring and deduplication. + */ + public void setIndexColumn(@Nonnull final String indexColumn) { + this.indexColumn = indexColumn; + } + + /** + * Set the deterministic of this {@link StrategyConfigs} instance and return the same instance. + * + * @param deterministic When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), + * producing the same row order on every call for the same data. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs deterministic(@Nullable final Boolean deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), producing the same + * row order on every call for the same data. + * + * @return deterministic The deterministic of this {@link StrategyConfigs} instance. + */ + @Nonnull + public Boolean isDeterministic() { + return deterministic; + } + + /** + * Set the deterministic of this {@link StrategyConfigs} instance. + * + * @param deterministic When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), + * producing the same row order on every call for the same data. + */ + public void setDeterministic(@Nullable final Boolean deterministic) { + this.deterministic = deterministic; + } + + /** + * Set the methodRatio of this {@link StrategyConfigs} instance and return the same instance. + * + * @param methodRatio Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs methodRatio(@Nullable final BigDecimal methodRatio) { + this.methodRatio = methodRatio; + return this; + } + + /** + * Fraction of numRows filled by scoring method (remainder is random fill). Must be between 0 and + * 1. + * + * @return methodRatio The methodRatio of this {@link StrategyConfigs} instance. + */ + @Nonnull + public BigDecimal getMethodRatio() { + return methodRatio; + } + + /** + * Set the methodRatio of this {@link StrategyConfigs} instance. + * + * @param methodRatio Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + */ + public void setMethodRatio(@Nullable final BigDecimal methodRatio) { + this.methodRatio = methodRatio; + } + + /** + * Set the fuzzyNumPct of this {@link StrategyConfigs} instance and return the same instance. + * + * @param fuzzyNumPct Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs fuzzyNumPct(@Nullable final BigDecimal fuzzyNumPct) { + this.fuzzyNumPct = fuzzyNumPct; + return this; + } + + /** + * Fraction of numRows filled by scoring method (remainder is random fill). Must be between 0 and + * 1. + * + * @return fuzzyNumPct The fuzzyNumPct of this {@link StrategyConfigs} instance. + */ + @Nonnull + public BigDecimal getFuzzyNumPct() { + return fuzzyNumPct; + } + + /** + * Set the fuzzyNumPct of this {@link StrategyConfigs} instance. + * + * @param fuzzyNumPct Fraction of numRows filled by scoring method (remainder is random fill). + * Must be between 0 and 1. + */ + public void setFuzzyNumPct(@Nullable final BigDecimal fuzzyNumPct) { + this.fuzzyNumPct = fuzzyNumPct; + } + + /** + * Set the poolSize of this {@link StrategyConfigs} instance and return the same instance. + * + * @param poolSize If set, scoring runs against a random subsample of this many rows instead of + * the full table. None = full table scan. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs poolSize(@Nullable final Integer poolSize) { + this.poolSize = poolSize; + return this; + } + + /** + * If set, scoring runs against a random subsample of this many rows instead of the full table. + * None = full table scan. + * + * @return poolSize The poolSize of this {@link StrategyConfigs} instance. + */ + @Nonnull + public Integer getPoolSize() { + return poolSize; + } + + /** + * Set the poolSize of this {@link StrategyConfigs} instance. + * + * @param poolSize If set, scoring runs against a random subsample of this many rows instead of + * the full table. None = full table scan. + */ + public void setPoolSize(@Nullable final Integer poolSize) { + this.poolSize = poolSize; + } + + /** + * Set the fuzzyDateDays of this {@link StrategyConfigs} instance and return the same instance. + * + * @param fuzzyDateDays Day window for fuzzy date matching. A date column scores 1 if + * abs(DAYS_BETWEEN(row_date, query_date)) <= dateFuzzyDays. Set to 0 for exact date + * match. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs fuzzyDateDays(@Nullable final Integer fuzzyDateDays) { + this.fuzzyDateDays = fuzzyDateDays; + return this; + } + + /** + * Day window for fuzzy date matching. A date column scores 1 if abs(DAYS_BETWEEN(row_date, + * query_date)) <= dateFuzzyDays. Set to 0 for exact date match. + * + * @return fuzzyDateDays The fuzzyDateDays of this {@link StrategyConfigs} instance. + */ + @Nonnull + public Integer getFuzzyDateDays() { + return fuzzyDateDays; + } + + /** + * Set the fuzzyDateDays of this {@link StrategyConfigs} instance. + * + * @param fuzzyDateDays Day window for fuzzy date matching. A date column scores 1 if + * abs(DAYS_BETWEEN(row_date, query_date)) <= dateFuzzyDays. Set to 0 for exact date + * match. + */ + public void setFuzzyDateDays(@Nullable final Integer fuzzyDateDays) { + this.fuzzyDateDays = fuzzyDateDays; + } + + /** + * Set the allowTimeoutFallback of this {@link StrategyConfigs} instance and return the same + * instance. + * + * @param allowTimeoutFallback When true, heuristic sampling falls back to random on timeout + * instead of raising an error. Set by the orchestrator when strategy=AUTO. + * @return The same instance of this {@link StrategyConfigs} class + */ + @Nonnull + public StrategyConfigs allowTimeoutFallback(@Nullable final Boolean allowTimeoutFallback) { + this.allowTimeoutFallback = allowTimeoutFallback; + return this; + } + + /** + * When true, heuristic sampling falls back to random on timeout instead of raising an error. Set + * by the orchestrator when strategy=AUTO. + * + * @return allowTimeoutFallback The allowTimeoutFallback of this {@link StrategyConfigs} instance. + */ + @Nonnull + public Boolean isAllowTimeoutFallback() { + return allowTimeoutFallback; + } + + /** + * Set the allowTimeoutFallback of this {@link StrategyConfigs} instance. + * + * @param allowTimeoutFallback When true, heuristic sampling falls back to random on timeout + * instead of raising an error. Set by the orchestrator when strategy=AUTO. + */ + public void setAllowTimeoutFallback(@Nullable final Boolean allowTimeoutFallback) { + this.allowTimeoutFallback = allowTimeoutFallback; + } + + /** + * Get the names of the unrecognizable properties of the {@link StrategyConfigs}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link StrategyConfigs} 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("StrategyConfigs has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link StrategyConfigs} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (indexColumn != null) declaredFields.put("indexColumn", indexColumn); + if (deterministic != null) declaredFields.put("deterministic", deterministic); + if (methodRatio != null) declaredFields.put("methodRatio", methodRatio); + if (fuzzyNumPct != null) declaredFields.put("fuzzyNumPct", fuzzyNumPct); + if (poolSize != null) declaredFields.put("poolSize", poolSize); + if (fuzzyDateDays != null) declaredFields.put("fuzzyDateDays", fuzzyDateDays); + if (allowTimeoutFallback != null) + declaredFields.put("allowTimeoutFallback", allowTimeoutFallback); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link StrategyConfigs} 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 StrategyConfigs strategyConfigs = (StrategyConfigs) o; + return Objects.equals(this.cloudSdkCustomFields, strategyConfigs.cloudSdkCustomFields) + && Objects.equals(this.indexColumn, strategyConfigs.indexColumn) + && Objects.equals(this.deterministic, strategyConfigs.deterministic) + && Objects.equals(this.methodRatio, strategyConfigs.methodRatio) + && Objects.equals(this.fuzzyNumPct, strategyConfigs.fuzzyNumPct) + && Objects.equals(this.poolSize, strategyConfigs.poolSize) + && Objects.equals(this.fuzzyDateDays, strategyConfigs.fuzzyDateDays) + && Objects.equals(this.allowTimeoutFallback, strategyConfigs.allowTimeoutFallback); + } + + @Override + public int hashCode() { + return Objects.hash( + indexColumn, + deterministic, + methodRatio, + fuzzyNumPct, + poolSize, + fuzzyDateDays, + allowTimeoutFallback, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class StrategyConfigs {\n"); + sb.append(" indexColumn: ").append(toIndentedString(indexColumn)).append("\n"); + sb.append(" deterministic: ").append(toIndentedString(deterministic)).append("\n"); + sb.append(" methodRatio: ").append(toIndentedString(methodRatio)).append("\n"); + sb.append(" fuzzyNumPct: ").append(toIndentedString(fuzzyNumPct)).append("\n"); + sb.append(" poolSize: ").append(toIndentedString(poolSize)).append("\n"); + sb.append(" fuzzyDateDays: ").append(toIndentedString(fuzzyDateDays)).append("\n"); + sb.append(" allowTimeoutFallback: ") + .append(toIndentedString(allowTimeoutFallback)) + .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 StrategyConfigs} + * instance with all required arguments. + */ + public static Builder create() { + return (indexColumn) -> new StrategyConfigs().indexColumn(indexColumn); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the indexColumn of this {@link StrategyConfigs} instance. + * + * @param indexColumn Name of the unique row-identifier column (e.g. 'ROW_INDEX'). + * Required for Heuristic scoring and deduplication. + * @return The StrategyConfigs instance. + */ + StrategyConfigs indexColumn(@Nonnull final String indexColumn); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TFMEnum.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TFMEnum.java new file mode 100644 index 000000000..f69774795 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TFMEnum.java @@ -0,0 +1,68 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Supported Tabular Foundation Models. */ +public enum TFMEnum { + _1_SMALL("sap-rpt-1-small"), + + _1_LARGE("sap-rpt-1-large"), + + _1_5("sap-rpt-1.5"), + + _1_5_LARGE("sap-rpt-1.5-large"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + TFMEnum(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 TFMEnum fromValue(@Nonnull final String value) { + for (final TFMEnum b : TFMEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TargetColumn.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TargetColumn.java new file mode 100644 index 000000000..41fdcb3be --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TargetColumn.java @@ -0,0 +1,302 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** Configuration for a target column to predict. */ +// CHECKSTYLE:OFF +public class TargetColumn +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("prediction_placeholder") + private String predictionPlaceholder = "[PREDICT]"; + + @JsonProperty("task_type") + private TaskTypeEnum taskType; + + @JsonProperty("top_k") + private Integer topK = 1; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TargetColumn. */ + protected TargetColumn() {} + + /** + * Set the name of this {@link TargetColumn} instance and return the same instance. + * + * @param name Name of the column to predict + * @return The same instance of this {@link TargetColumn} class + */ + @Nonnull + public TargetColumn name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * Name of the column to predict + * + * @return name The name of this {@link TargetColumn} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link TargetColumn} instance. + * + * @param name Name of the column to predict + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the predictionPlaceholder of this {@link TargetColumn} instance and return the same + * instance. + * + * @param predictionPlaceholder (Optional) Placeholder value indicating cells to predict + * @return The same instance of this {@link TargetColumn} class + */ + @Nonnull + public TargetColumn predictionPlaceholder(@Nullable final String predictionPlaceholder) { + this.predictionPlaceholder = predictionPlaceholder; + return this; + } + + /** + * (Optional) Placeholder value indicating cells to predict + * + * @return predictionPlaceholder The predictionPlaceholder of this {@link TargetColumn} instance. + */ + @Nonnull + public String getPredictionPlaceholder() { + return predictionPlaceholder; + } + + /** + * Set the predictionPlaceholder of this {@link TargetColumn} instance. + * + * @param predictionPlaceholder (Optional) Placeholder value indicating cells to predict + */ + public void setPredictionPlaceholder(@Nullable final String predictionPlaceholder) { + this.predictionPlaceholder = predictionPlaceholder; + } + + /** + * Set the taskType of this {@link TargetColumn} instance and return the same instance. + * + * @param taskType (Optional) Type of prediction task (classification or regression) + * @return The same instance of this {@link TargetColumn} class + */ + @Nonnull + public TargetColumn taskType(@Nullable final TaskTypeEnum taskType) { + this.taskType = taskType; + return this; + } + + /** + * (Optional) Type of prediction task (classification or regression) + * + * @return taskType The taskType of this {@link TargetColumn} instance. + */ + @Nonnull + public TaskTypeEnum getTaskType() { + return taskType; + } + + /** + * Set the taskType of this {@link TargetColumn} instance. + * + * @param taskType (Optional) Type of prediction task (classification or regression) + */ + public void setTaskType(@Nullable final TaskTypeEnum taskType) { + this.taskType = taskType; + } + + /** + * Set the topK of this {@link TargetColumn} instance and return the same instance. + * + * @param topK (Optional) Controls how many labels to predict for each column in each row. Only + * applicable to 'classification' task type. + * @return The same instance of this {@link TargetColumn} class + */ + @Nonnull + public TargetColumn topK(@Nullable final Integer topK) { + this.topK = topK; + return this; + } + + /** + * (Optional) Controls how many labels to predict for each column in each row. Only applicable to + * 'classification' task type. + * + * @return topK The topK of this {@link TargetColumn} instance. + */ + @Nonnull + public Integer getTopK() { + return topK; + } + + /** + * Set the topK of this {@link TargetColumn} instance. + * + * @param topK (Optional) Controls how many labels to predict for each column in each row. Only + * applicable to 'classification' task type. + */ + public void setTopK(@Nullable final Integer topK) { + this.topK = topK; + } + + /** + * Get the names of the unrecognizable properties of the {@link TargetColumn}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TargetColumn} 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("TargetColumn has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link TargetColumn} 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 (predictionPlaceholder != null) + declaredFields.put("predictionPlaceholder", predictionPlaceholder); + if (taskType != null) declaredFields.put("taskType", taskType); + if (topK != null) declaredFields.put("topK", topK); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link TargetColumn} 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 TargetColumn targetColumn = (TargetColumn) o; + return Objects.equals(this.cloudSdkCustomFields, targetColumn.cloudSdkCustomFields) + && Objects.equals(this.name, targetColumn.name) + && Objects.equals(this.predictionPlaceholder, targetColumn.predictionPlaceholder) + && Objects.equals(this.taskType, targetColumn.taskType) + && Objects.equals(this.topK, targetColumn.topK); + } + + @Override + public int hashCode() { + return Objects.hash(name, predictionPlaceholder, taskType, topK, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TargetColumn {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" predictionPlaceholder: ") + .append(toIndentedString(predictionPlaceholder)) + .append("\n"); + sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n"); + sb.append(" topK: ").append(toIndentedString(topK)).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 TargetColumn} instance + * with all required arguments. + */ + public static Builder create() { + return (name) -> new TargetColumn().name(name); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link TargetColumn} instance. + * + * @param name Name of the column to predict + * @return The TargetColumn instance. + */ + TargetColumn name(@Nonnull final String name); + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TaskTypeEnum.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TaskTypeEnum.java new file mode 100644 index 000000000..638f23591 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/TaskTypeEnum.java @@ -0,0 +1,64 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** ML task types for predictions. */ +public enum TaskTypeEnum { + CLASSIFICATION("classification"), + + REGRESSION("regression"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + TaskTypeEnum(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 TaskTypeEnum fromValue(@Nonnull final String value) { + for (final TaskTypeEnum b : TaskTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ValidationError.java b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ValidationError.java new file mode 100644 index 000000000..08d3a1d73 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/java/com/sap/ai/sdk/tabular/generated/predict/model/ValidationError.java @@ -0,0 +1,382 @@ +/* + * Tabular AI Orchestrator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * 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.tabular.generated.predict.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; + +/** ValidationError */ +// CHECKSTYLE:OFF +public class ValidationError +// CHECKSTYLE:ON +{ + @JsonProperty("loc") + private List loc = new ArrayList<>(); + + @JsonProperty("msg") + private String msg; + + @JsonProperty("type") + private String type; + + @JsonProperty("input") + private Object input = null; + + @JsonProperty("ctx") + private Object ctx; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ValidationError. */ + protected ValidationError() {} + + /** + * Set the loc of this {@link ValidationError} instance and return the same instance. + * + * @param loc The loc of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError loc(@Nonnull final List loc) { + this.loc = loc; + return this; + } + + /** + * Add one loc instance to this {@link ValidationError}. + * + * @param locItem The loc that should be added + * @return The same instance of type {@link ValidationError} + */ + @Nonnull + public ValidationError addLocItem(@Nonnull final LocationInner locItem) { + if (this.loc == null) { + this.loc = new ArrayList<>(); + } + this.loc.add(locItem); + return this; + } + + /** + * Get loc + * + * @return loc The loc of this {@link ValidationError} instance. + */ + @Nonnull + public List getLoc() { + return loc; + } + + /** + * Set the loc of this {@link ValidationError} instance. + * + * @param loc The loc of this {@link ValidationError} + */ + public void setLoc(@Nonnull final List loc) { + this.loc = loc; + } + + /** + * Set the msg of this {@link ValidationError} instance and return the same instance. + * + * @param msg The msg of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError msg(@Nonnull final String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg The msg of this {@link ValidationError} instance. + */ + @Nonnull + public String getMsg() { + return msg; + } + + /** + * Set the msg of this {@link ValidationError} instance. + * + * @param msg The msg of this {@link ValidationError} + */ + public void setMsg(@Nonnull final String msg) { + this.msg = msg; + } + + /** + * Set the type of this {@link ValidationError} instance and return the same instance. + * + * @param type The type of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError type(@Nonnull final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link ValidationError} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link ValidationError} instance. + * + * @param type The type of this {@link ValidationError} + */ + public void setType(@Nonnull final String type) { + this.type = type; + } + + /** + * Set the input of this {@link ValidationError} instance and return the same instance. + * + * @param input The input of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError input(@Nullable final Object input) { + this.input = input; + return this; + } + + /** + * Get input + * + * @return input The input of this {@link ValidationError} instance. + */ + @Nullable + public Object getInput() { + return input; + } + + /** + * Set the input of this {@link ValidationError} instance. + * + * @param input The input of this {@link ValidationError} + */ + public void setInput(@Nullable final Object input) { + this.input = input; + } + + /** + * Set the ctx of this {@link ValidationError} instance and return the same instance. + * + * @param ctx The ctx of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError ctx(@Nullable final Object ctx) { + this.ctx = ctx; + return this; + } + + /** + * Get ctx + * + * @return ctx The ctx of this {@link ValidationError} instance. + */ + @Nonnull + public Object getCtx() { + return ctx; + } + + /** + * Set the ctx of this {@link ValidationError} instance. + * + * @param ctx The ctx of this {@link ValidationError} + */ + public void setCtx(@Nullable final Object ctx) { + this.ctx = ctx; + } + + /** + * Get the names of the unrecognizable properties of the {@link ValidationError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ValidationError} 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("ValidationError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ValidationError} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (loc != null) declaredFields.put("loc", loc); + if (msg != null) declaredFields.put("msg", msg); + if (type != null) declaredFields.put("type", type); + if (input != null) declaredFields.put("input", input); + if (ctx != null) declaredFields.put("ctx", ctx); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ValidationError} 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 ValidationError validationError = (ValidationError) o; + return Objects.equals(this.cloudSdkCustomFields, validationError.cloudSdkCustomFields) + && Objects.equals(this.loc, validationError.loc) + && Objects.equals(this.msg, validationError.msg) + && Objects.equals(this.type, validationError.type) + && Objects.equals(this.input, validationError.input) + && Objects.equals(this.ctx, validationError.ctx); + } + + @Override + public int hashCode() { + return Objects.hash(loc, msg, type, input, ctx, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ValidationError {\n"); + sb.append(" loc: ").append(toIndentedString(loc)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" ctx: ").append(toIndentedString(ctx)).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 ValidationError} + * instance with all required arguments. + */ + public static Builder create() { + return (loc) -> (msg) -> (type) -> new ValidationError().loc(loc).msg(msg).type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the loc of this {@link ValidationError} instance. + * + * @param loc The loc of this {@link ValidationError} + * @return The ValidationError builder. + */ + Builder1 loc(@Nonnull final List loc); + + /** + * Set the loc of this {@link ValidationError} instance. + * + * @param loc The loc of this {@link ValidationError} + * @return The ValidationError builder. + */ + default Builder1 loc(@Nonnull final LocationInner... loc) { + return loc(Arrays.asList(loc)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the msg of this {@link ValidationError} instance. + * + * @param msg The msg of this {@link ValidationError} + * @return The ValidationError builder. + */ + Builder2 msg(@Nonnull final String msg); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the type of this {@link ValidationError} instance. + * + * @param type The type of this {@link ValidationError} + * @return The ValidationError instance. + */ + ValidationError type(@Nonnull final String type); + } +} diff --git a/core-services/tabular-orchestration/src/main/resources/spec/tabular-orchestration.yaml b/core-services/tabular-orchestration/src/main/resources/spec/tabular-orchestration.yaml new file mode 100644 index 000000000..fb853c138 --- /dev/null +++ b/core-services/tabular-orchestration/src/main/resources/spec/tabular-orchestration.yaml @@ -0,0 +1,1895 @@ +openapi: 3.0.3 +info: + title: Context Registry + version: 1.0.0 + description: Context Registry is a service for managing tabular data contexts for AI applications. It provides capabilities to register data destinations (object stores and data sharing platforms), create tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for context selection in AI-driven business solutions. + contact: + name: SAP AI Core +x-sap-shortText: Manage tabular data contexts for AI applications in SAP AI Core. + +tags: + - name: Data Destinations + description: Manage data destination configurations for unified data source integration + - name: Tabular Artifacts + description: Manage tabular artifacts for structured data access + - name: Scenario Configuration Manager + description: Manage scenario configurations for context selection + +servers: + - url: "https://{landscapehost}/v2/tcr" + description: Production endpoint for SAP AI Core + variables: + landscapehost: + default: api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com + description: SAP AI Core landscape host (e.g., api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com, api.ai.prod.us-east-1.aws.ml.hana.ondemand.com) + +security: + - Oauth2: [] + +paths: + # Data Destinations Endpoints + "/dataDestinations": + get: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.list_data_destinations + summary: Get Data Destinations + description: Get all data destinations in the tenant (resource group) + x-sap-cloud-sdk-operation-name: getAllDataDestinations + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - $ref: "#/components/parameters/top" + - $ref: "#/components/parameters/skip" + - $ref: "#/components/parameters/count" + responses: + "200": + description: Returns all data destinations for the tenant + content: + application/json: + schema: + $ref: "#/components/schemas/GetDataDestinations" + "400": + $ref: "#/components/responses/BadRequest" + "500": + $ref: "#/components/responses/ServerError" + + "/dataDestinations/search": + post: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.search_data_destinations + summary: Search Data Destinations + description: Search data destinations by label key-value pairs + x-sap-cloud-sdk-operation-name: searchDestinations + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - $ref: "#/components/parameters/top" + - $ref: "#/components/parameters/skip" + - $ref: "#/components/parameters/count" + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - labels + properties: + labels: + $ref: "#/components/schemas/Labels" + responses: + "200": + description: Returns data destinations matching the label selector + content: + application/json: + schema: + $ref: "#/components/schemas/GetDataDestinations" + "400": + $ref: "#/components/responses/BadRequest" + "500": + $ref: "#/components/responses/ServerError" + + "/dataDestinations/validate": + post: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.validate_data_destination + summary: Validate Data Destination (pre-creation) + description: Test provider connectivity before saving. Nothing is persisted. + x-sap-cloud-sdk-operation-name: validateDataDestination + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ValidateDataDestinationRequest" + responses: + "200": + description: Validation result + content: + application/json: + schema: + $ref: "#/components/schemas/ValidateDataDestinationResponse" + "400": + $ref: "#/components/responses/BadRequest" + "500": + $ref: "#/components/responses/ServerError" + + "/dataDestinations/{dataDestinationName}": + put: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.create_update_data_destination + summary: Async Data Destination Creation + description: > + Create a data destination asynchronously. Schema validation happens + synchronously; credential validation and secret storage run in a background task. + Poll GET /dataDestinations/{name} to track progress via status and errorMessage. + Returns 202 (not exists or ERROR retry), 409 (ACTIVE or DELETING), 422 (retry exhausted). + x-sap-cloud-sdk-operation-name: createUpdateDataDestination + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: dataDestinationName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 127 + pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + description: Unique identifier for the data destination + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateDataDestination" + responses: + "202": + description: Accepted - background task launched + headers: + Location: + description: URL to poll for creation status + schema: + type: string + format: uri + content: + application/json: + schema: + $ref: "#/components/schemas/AsyncCreateDataDestinationResponse" + "400": + $ref: "#/components/responses/BadRequest" + "409": + $ref: "#/components/responses/Conflict" + "422": + $ref: "#/components/responses/UnprocessableEntity" + "500": + $ref: "#/components/responses/ServerError" + get: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.get_data_destination_by_name + summary: Get Data Destination Details + description: Get metadata of a specific data destination (excluding credentials) + x-sap-cloud-sdk-operation-name: getDataDestinationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: dataDestinationName + in: path + required: true + schema: + type: string + description: The ID of the data destination to get + responses: + "200": + description: Returns the data destination for the given ID + content: + application/json: + schema: + $ref: "#/components/schemas/GetDataDestination" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + delete: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.delete_data_destination_by_name + summary: Delete Data Destination + description: > + Mark the data destination for deletion. Synchronously checks for dependent + TabularArtifacts; returns 202 immediately after marking DELETING. The cron + reaper handles secret deletion and hard delete. + x-sap-cloud-sdk-operation-name: deleteDataDestinationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: dataDestinationName + in: path + required: true + schema: + type: string + description: The ID of the data destination to delete + responses: + "202": + description: Accepted — data destination marked DELETING; cron handles cleanup + headers: + Location: + description: URL to poll for deletion status + schema: + type: string + format: uri + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/ServerError" + patch: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.patch_data_destination_by_name + summary: Update Data Destination + description: Update a data destination (excluding name and type) + x-sap-cloud-sdk-operation-name: patchDataDestinationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: dataDestinationName + in: path + required: true + schema: + type: string + description: The ID of the data destination to update + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PatchDataDestination" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/ServerError" + + "/dataDestinations/{dataDestinationName}/validate": + post: + tags: + - Data Destinations + operationId: controllers.data_destination.v1.endpoints.validate_data_destination_by_name + summary: Validate Data Destination (post-creation) + description: Re-verify an already-saved destination using stored credentials. + x-sap-cloud-sdk-operation-name: validateDataDestinationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: dataDestinationName + in: path + required: true + schema: + type: string + description: The name of the data destination to validate + responses: + "200": + description: Validation result + content: + application/json: + schema: + $ref: "#/components/schemas/ValidateDataDestinationResponse" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + + # Tabular Artifacts Endpoints + "/tabularArtifacts": + get: + tags: + - Tabular Artifacts + operationId: controllers.tabular_artifact.v1.endpoints.get_all_tabular_artifacts + summary: Get all Tabular Artifacts + description: Retrieve list of Tabular Artifacts with pagination + x-sap-cloud-sdk-operation-name: getAllTabularArtifacts + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - $ref: "#/components/parameters/top" + - $ref: "#/components/parameters/skip" + - $ref: "#/components/parameters/count" + responses: + "200": + description: Tabular Artifacts retrieved successfully + content: + application/json: + schema: + $ref: "#/components/schemas/TabularArtifactListResponse" + "500": + $ref: "#/components/responses/ServerError" + "400": + $ref: "#/components/responses/BadRequest" + + "/tabularArtifacts/{tabularArtifactName}": + put: + tags: + - Tabular Artifacts + operationId: controllers.tabular_artifact.v1.endpoints.create_tabular_artifact + summary: Async Tabular Artifact Creation + description: > + Create a Tabular Artifact asynchronously. Schema validation happens + synchronously; resource creation runs in a background task. + Poll GET /tabularArtifacts/{name} to track progress via status and errorMessage. + Returns 202 (not exists or ERROR retry), 409 (ACTIVE or DELETING), 422 (retry exhausted). + x-sap-cloud-sdk-operation-name: createTabularArtifact + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: tabularArtifactName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 80 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: Unique name of the Tabular Artifact + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTARequest" + responses: + "202": + description: Accepted - Tabular Artifact creation request accepted + headers: + Location: + description: URL to check the Tabular Artifact creation status + schema: + $ref: '#/components/schemas/Url' + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the Tabular Artifact being created + additionalProperties: false + example: + name: "customer-ta" + "400": + $ref: "#/components/responses/BadRequest" + "409": + $ref: "#/components/responses/Conflict" + "422": + $ref: "#/components/responses/UnprocessableEntity" + "500": + $ref: '#/components/responses/ServerError' + get: + tags: + - Tabular Artifacts + operationId: controllers.tabular_artifact.v1.endpoints.get_tabular_artifact_by_name + summary: Get Tabular Artifact Details with Metadata + description: > + Retrieve details of a specific Tabular Artifact by name including schema metadata. + x-sap-cloud-sdk-operation-name: getTabularArtifactByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: tabularArtifactName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 80 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: > + Unique name of the Tabular Artifact. + Must match allowed pattern and length constraints. + responses: + "200": + description: Tabular Artifact details retrieved successfully + content: + application/json: + schema: + $ref: "#/components/schemas/TabularArtifactDetails" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + delete: + tags: + - Tabular Artifacts + operationId: controllers.tabular_artifact.v1.endpoints.delete_tabular_artifact + summary: Delete Tabular Artifact + description: Delete a specific Tabular Artifact by name + x-sap-cloud-sdk-operation-name: deleteTabularArtifact + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: tabularArtifactName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 80 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: > + Unique name of the Tabular Artifact. + Must match allowed pattern and length constraints. + responses: + "202": + description: Accepted — the Tabular Artifact has been marked for deletion and will be removed asynchronously + "404": + $ref: "#/components/responses/NotFound" + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/ServerError" + + "/tabularArtifacts/{tabularArtifactName}/data": + get: + tags: + - Tabular Artifacts + operationId: controllers.tabular_artifact.v1.endpoints.get_tabular_artifact_data + summary: Get Tabular Artifact Data Preview + description: Retrieve a preview of data rows from the Virtual Table (first 10 records) + x-sap-cloud-sdk-operation-name: getTabularArtifactData + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: tabularArtifactName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 80 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: > + Unique name of the Tabular Artifact. + Must match allowed pattern and length constraints. + responses: + "200": + description: Tabular Artifact data preview retrieved successfully + content: + application/json: + schema: + $ref: "#/components/schemas/TabularArtifactDataPreview" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + + # Scenario Configuration Manager Endpoints + "/scenarioConfigurations": + get: + tags: + - Scenario Configuration Manager + operationId: controllers.scenario_configuration_manager.v1.endpoints.get_all_scenario_configurations + summary: Get All Scenario Configurations + description: Get all scenario configurations in the tenant (resource group) + x-sap-cloud-sdk-operation-name: getAllScenarioConfigurations + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - $ref: "#/components/parameters/top" + - $ref: "#/components/parameters/skip" + - $ref: "#/components/parameters/count" + responses: + "200": + description: Returns all scenario configurations for the tenant + content: + application/json: + schema: + $ref: "#/components/schemas/GetScenarioConfigurations" + "400": + $ref: "#/components/responses/BadRequest" + "500": + $ref: "#/components/responses/ServerError" + + "/scenarioConfigurations/search": + post: + tags: + - Scenario Configuration Manager + operationId: controllers.scenario_configuration_manager.v1.endpoints.search_scenario_configurations_by_label + summary: Search Scenario Configurations by Labels + description: Search for scenario configurations that match ALL specified labels (AND logic) + x-sap-cloud-sdk-operation-name: searchScenarioConfigurationsByLabel + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - $ref: "#/components/parameters/top" + - $ref: "#/components/parameters/skip" + - $ref: "#/components/parameters/count" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SearchScenarioConfiguration" + responses: + "200": + description: Returns scenario configurations matching all specified labels + content: + application/json: + schema: + $ref: "#/components/schemas/GetScenarioConfigurations" + "400": + $ref: "#/components/responses/BadRequest" + "500": + $ref: "#/components/responses/ServerError" + + "/scenarioConfigurations/{scenarioConfigurationName}": + put: + tags: + - Scenario Configuration Manager + operationId: controllers.scenario_configuration_manager.v1.endpoints.create_scenario_configuration + summary: Async Scenario Configuration Creation + description: > + Create a scenario configuration asynchronously. Schema validation happens + synchronously; background processing runs asynchronously. + Poll GET /scenarioConfigurations/{name} to track progress via status and errorMessage. + Returns 202 (not exists or ERROR retry), 409 (ACTIVE or DELETING), 422 (retry exhausted). + x-sap-cloud-sdk-operation-name: createScenarioConfiguration + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: scenarioConfigurationName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 127 + pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + description: Name of the scenario configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateScenarioConfiguration" + responses: + "202": + description: Accepted - background task launched + headers: + Location: + description: URL to poll for creation status + schema: + type: string + format: uri + content: + application/json: + schema: + $ref: "#/components/schemas/ScenarioConfigurationNameObject" + "400": + $ref: "#/components/responses/BadRequest" + "409": + $ref: "#/components/responses/Conflict" + "422": + $ref: "#/components/responses/UnprocessableEntity" + "500": + $ref: "#/components/responses/ServerError" + get: + tags: + - Scenario Configuration Manager + operationId: controllers.scenario_configuration_manager.v1.endpoints.get_scenario_configuration_by_name + summary: Get Scenario Configuration By Name + description: Get a scenario configuration by its name + x-sap-cloud-sdk-operation-name: getScenarioConfigurationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: scenarioConfigurationName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 127 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: The name of the scenario configuration to retrieve + responses: + "200": + description: Returns the scenario configuration object + content: + application/json: + schema: + $ref: "#/components/schemas/ScenarioConfigurationObject" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + patch: + tags: + - Scenario Configuration Manager + operationId: controllers.scenario_configuration_manager.v1.endpoints.patch_scenario_configuration_by_name + summary: Update Scenario Configuration + description: Update a scenario configuration (excluding name) + x-sap-cloud-sdk-operation-name: patchScenarioConfigurationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: scenarioConfigurationName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 127 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: The name of the scenario configuration to update + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PatchScenarioConfiguration" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + delete: + tags: + - Scenario Configuration Manager + operationId: controllers.scenario_configuration_manager.v1.endpoints.delete_scenario_configuration_by_name + summary: Delete Scenario Configuration + description: Delete a scenario configuration by name + x-sap-cloud-sdk-operation-name: deleteScenarioConfigurationByName + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: scenarioConfigurationName + in: path + required: true + schema: + type: string + description: The name of the scenario configuration to delete + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/ServerError" + +components: + securitySchemes: + Oauth2: + type: oauth2 + description: OAuth client credentials (client ID and secret) are required. These can be requested from SAP BTP cloud cockpit. + flows: + clientCredentials: + tokenUrl: https://(subdomain_identity_zone).authentication.(host)/oauth/token + scopes: {} + + schemas: + # Data Destination Schemas + CreateDataDestination: + discriminator: + propertyName: type + mapping: + HDL: "#/components/schemas/HDLDataDestinationCreateRequest" + S3: "#/components/schemas/S3DataDestinationCreateRequest" + GCS: "#/components/schemas/GCSDataDestinationCreateRequest" + AZURE: "#/components/schemas/AzureDataDestinationCreateRequest" + DELTA_SHARING: "#/components/schemas/DeltaSharingDataDestinationCreateRequest" + oneOf: + - $ref: "#/components/schemas/HDLDataDestinationCreateRequest" + - $ref: "#/components/schemas/S3DataDestinationCreateRequest" + - $ref: "#/components/schemas/GCSDataDestinationCreateRequest" + - $ref: "#/components/schemas/AzureDataDestinationCreateRequest" + - $ref: "#/components/schemas/DeltaSharingDataDestinationCreateRequest" + + DataDestinationCreateBase: + type: object + properties: + description: + type: string + maxLength: 1000 + description: "Optional description of the data destination" + adapterType: + type: string + enum: [File, DeltaShare] + default: File + description: "Adapter type for data access." + labels: + $ref: "#/components/schemas/Labels" + + HDLDataDestinationCreateRequest: + allOf: + - $ref: "#/components/schemas/DataDestinationCreateBase" + - type: object + required: [type, config] + properties: + type: + type: string + enum: [HDL] + config: + $ref: "#/components/schemas/HDLConnectionConfig" + + HDLConnectionConfig: + type: object + required: + - host + properties: + host: + type: string + pattern: '^[a-zA-Z0-9]([a-zA-Z0-9\-\.]*[a-zA-Z0-9])?(:[0-9]+)?$' + example: "ccc727c8-ffff-4c37-ffff-ede322dcfa8f.files.hdl.canary-eu10.hanacloud.ondemand.com" + description: "HDL file container hostname. Only alphanumeric characters, hyphens, dots, and an optional port are allowed. Do not include 'https://' or any URL scheme." + additionalProperties: false + + S3DataDestinationCreateRequest: + allOf: + - $ref: "#/components/schemas/DataDestinationCreateBase" + - type: object + required: [type, config] + properties: + type: + type: string + enum: [S3] + config: + $ref: "#/components/schemas/S3ConnectionConfig" + + GCSDataDestinationCreateRequest: + allOf: + - $ref: "#/components/schemas/DataDestinationCreateBase" + - type: object + required: [type, config] + properties: + type: + type: string + enum: [GCS] + config: + $ref: "#/components/schemas/GCSConnectionConfig" + + AzureDataDestinationCreateRequest: + allOf: + - $ref: "#/components/schemas/DataDestinationCreateBase" + - type: object + required: [type, config] + properties: + type: + type: string + enum: [AZURE] + config: + $ref: "#/components/schemas/AzureConnectionConfig" + + S3ConnectionConfigBase: + type: object + properties: + bucket: + type: string + minLength: 1 + description: S3 bucket name + region: + type: string + minLength: 1 + description: AWS region (e.g. eu-central-1) + access_key_id: + type: string + minLength: 1 + description: AWS access key ID + secret_access_key: + type: string + minLength: 1 + description: "AWS secret access key (raw value — must not be URL-encoded)" + additionalProperties: false + + S3ConnectionConfig: + allOf: + - $ref: "#/components/schemas/S3ConnectionConfigBase" + - type: object + required: [bucket, region, access_key_id, secret_access_key] + + GCSConnectionConfigBase: + type: object + properties: + bucket: + type: string + minLength: 1 + description: GCS bucket name + base64_encoded_private_key_data: + type: string + minLength: 1 + format: byte + description: > + Base64-encoded service account JSON key, as provided directly in the BTP Object Store + service key. TCR decodes this at runtime to extract client_email and private_key for + the HANA OAUTH credential. The decoded value must be valid JSON containing both + client_email and private_key fields. + additionalProperties: false + + GCSConnectionConfig: + allOf: + - $ref: "#/components/schemas/GCSConnectionConfigBase" + - type: object + required: [bucket, base64_encoded_private_key_data] + + AzureConnectionConfigBase: + type: object + properties: + account_name: + type: string + minLength: 1 + description: "Azure storage account name (maps to user= in HANA credential)" + container_uri: + type: string + minLength: 1 + description: > + Full container URI from the BTP Object Store service key + (e.g. https://account.z2.blob.storage.azure.net/container). + TCR strips the https:// prefix to derive the HANA adls endpoint. + sas_token: + type: string + minLength: 1 + description: "SAS token (raw, percent-encoded characters stored as-is). Must grant read + list (r + l) on the container." + additionalProperties: false + + AzureConnectionConfig: + allOf: + - $ref: "#/components/schemas/AzureConnectionConfigBase" + - type: object + required: [account_name, container_uri, sas_token] + + DeltaSharingDataDestinationCreateRequest: + allOf: + - $ref: "#/components/schemas/DataDestinationCreateBase" + - type: object + required: [type, config] + properties: + type: + type: string + enum: [DELTA_SHARING] + config: + $ref: "#/components/schemas/DeltaSharingConnectionConfig" + adapterType: + type: string + enum: [DeltaShare] + default: DeltaShare + description: "Adapter type for Delta Sharing" + + DeltaSharingConnectionConfig: + type: object + required: + - host + properties: + host: + type: string + pattern: '^[a-zA-Z0-9]([a-zA-Z0-9\-\.]*[a-zA-Z0-9])?(:[0-9]+)?$' + example: "ccc727c8-ffff-4c37-ffff-ede322dcfa8f.sharing.hdl.canary-eu10.hanacloud.ondemand.com" + description: "Delta Sharing server hostname. Only alphanumeric characters, hyphens, dots, and an optional port are allowed. Do not include 'https://' or any URL scheme." + provider: + type: string + enum: [hdlf] + description: "Delta Sharing provider. Optional, defaults to hdlf if not specified." + additionalProperties: false + + S3PatchConfig: + type: object + description: "S3 credential fields for PATCH." + additionalProperties: false + properties: + access_key_id: + type: string + minLength: 1 + description: AWS access key ID + secret_access_key: + type: string + minLength: 1 + description: AWS secret access key + + GCSPatchConfig: + type: object + description: "GCS credential fields for PATCH." + additionalProperties: false + properties: + base64_encoded_private_key_data: + type: string + minLength: 1 + format: byte + description: Base64-encoded service account JSON key + + AzurePatchConfig: + type: object + description: "Azure credential fields for PATCH." + additionalProperties: false + properties: + sas_token: + type: string + minLength: 1 + description: SAS token + + Labels: + type: array + items: + $ref: "#/components/schemas/LabelKeyValuePair" + example: + - key: "ext.ai.sap.com/environment" + value: "prod" + + LabelKeyValuePair: + type: object + required: + - key + - value + properties: + key: + type: string + minLength: 1 + maxLength: 63 + pattern: "^(ext|int)\\.ai\\.sap\\.com/(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]){1,48}$" + description: "Label key following SAP AI Core format: (ext|int).ai.sap.com/suffix" + value: + type: string + minLength: 1 + maxLength: 63 + pattern: "^(([A-Za-z0-9][-A-Za-z0-9_./]*)?[A-Za-z0-9])?$" + description: "Label value" + additionalProperties: false + + AsyncCreateDataDestinationResponse: + type: object + required: + - name + properties: + name: + type: string + description: Name of the data destination being created + subjectPatterns: + type: array + items: + type: string + description: "Subject pattern for HDL authentication and btp cred store" + additionalProperties: false + + DataDestinationStatus: + type: string + enum: + - PROCESSING + - ACTIVE + - DELETING + - ERROR + description: > + Lifecycle status of the Data Destination. + PROCESSING — creation is in progress (background task running). + ACTIVE — fully created and available. + ERROR — creation failed; see errorMessage for details. + DELETING — marked for deletion, awaiting async cleanup. + + DataDestinationErrorMessage: + type: string + nullable: true + description: Detailed error message if the Data Destination creation failed + + GetDataDestinations: + type: object + required: + - resources + properties: + count: + type: integer + resources: + type: array + items: + $ref: "#/components/schemas/GetDataDestination" + + GetDataDestination: + discriminator: + propertyName: type + mapping: + HDL: "#/components/schemas/HDLDataDestinationGetResponse" + S3: "#/components/schemas/ObjectStoreDataDestinationGetResponse" + GCS: "#/components/schemas/ObjectStoreDataDestinationGetResponse" + AZURE: "#/components/schemas/ObjectStoreDataDestinationGetResponse" + DELTA_SHARING: "#/components/schemas/DeltaSharingDataDestinationGetResponse" + oneOf: + - $ref: "#/components/schemas/HDLDataDestinationGetResponse" + - $ref: "#/components/schemas/ObjectStoreDataDestinationGetResponse" + - $ref: "#/components/schemas/DeltaSharingDataDestinationGetResponse" + + HDLDataDestinationGetResponse: + allOf: + - $ref: "#/components/schemas/BaseDataDestinationResponse" + - type: object + required: + - type + properties: + type: + type: string + enum: [HDL] + adapterType: + type: string + enum: [File] + subjectPatterns: + type: array + items: + type: string + description: "Subject pattern for HDL authentication and btp cred store" + + ObjectStoreDataDestinationGetResponse: + allOf: + - $ref: "#/components/schemas/BaseDataDestinationResponse" + - type: object + required: + - type + properties: + type: + type: string + enum: [S3, GCS, AZURE] + adapterType: + type: string + enum: [File] + + DeltaSharingDataDestinationGetResponse: + allOf: + - $ref: "#/components/schemas/BaseDataDestinationResponse" + - type: object + required: + - type + properties: + type: + type: string + enum: [DELTA_SHARING] + adapterType: + type: string + enum: [DeltaShare] + + BaseDataDestinationResponse: + type: object + required: + - name + - createdAt + - updatedAt + properties: + name: + type: string + description: + type: string + nullable: true + labels: + $ref: "#/components/schemas/Labels" + status: + $ref: "#/components/schemas/DataDestinationStatus" + errorMessage: + $ref: "#/components/schemas/DataDestinationErrorMessage" + createdAt: + type: string + format: date-time + example: "2024-02-15T12:45:00.000Z" + updatedAt: + type: string + format: date-time + example: "2024-02-15T12:45:00.000Z" + + PatchDataDestination: + type: object + additionalProperties: false + properties: + labels: + $ref: "#/components/schemas/Labels" + description: + type: string + maxLength: 253 + description: "Data destination description." + config: + description: "Credential fields for the destination's provider type." + anyOf: + - $ref: "#/components/schemas/S3PatchConfig" + - $ref: "#/components/schemas/GCSPatchConfig" + - $ref: "#/components/schemas/AzurePatchConfig" + + ValidateDataDestinationRequest: + discriminator: + propertyName: type + mapping: + S3: "#/components/schemas/ValidateS3Request" + GCS: "#/components/schemas/ValidateGCSRequest" + AZURE: "#/components/schemas/ValidateAzureRequest" + oneOf: + - $ref: "#/components/schemas/ValidateS3Request" + - $ref: "#/components/schemas/ValidateGCSRequest" + - $ref: "#/components/schemas/ValidateAzureRequest" + + ValidateS3Request: + type: object + required: [type, config] + properties: + type: + type: string + enum: [S3] + adapterType: + type: string + enum: [File] + default: File + config: + $ref: "#/components/schemas/S3ConnectionConfig" + + ValidateGCSRequest: + type: object + required: [type, config] + properties: + type: + type: string + enum: [GCS] + adapterType: + type: string + enum: [File] + default: File + config: + $ref: "#/components/schemas/GCSConnectionConfig" + + ValidateAzureRequest: + type: object + required: [type, config] + properties: + type: + type: string + enum: [AZURE] + adapterType: + type: string + enum: [File] + default: File + config: + $ref: "#/components/schemas/AzureConnectionConfig" + + ValidateDataDestinationResponse: + discriminator: + propertyName: status + mapping: + OK: "#/components/schemas/ValidationOkResponse" + FAILED: "#/components/schemas/ValidationFailedResponse" + oneOf: + - $ref: "#/components/schemas/ValidationOkResponse" + - $ref: "#/components/schemas/ValidationFailedResponse" + + ValidationOkResponse: + type: object + required: [status] + properties: + status: + type: string + enum: [OK] + additionalProperties: false + + ValidationFailedResponse: + type: object + required: [status, reason] + properties: + status: + type: string + enum: [FAILED] + reason: + type: string + description: "Provider-specific failure reason. Always present when status is FAILED." + additionalProperties: false + + # Tabular Artifact Schemas + DefinitionType: + type: string + enum: + - DOCUMENT + - REFERENCE + - AUTO + + DocumentDefinition: + type: object + required: + - definitionType + - document + properties: + definitionType: + $ref: '#/components/schemas/DefinitionType' + document: + type: object + description: "CSN document content used to create Tabular Artifact (required if definitionType is DOCUMENT)" + additionalProperties: false + + ReferenceDefinition: + type: object + required: + - definitionType + - documentReference + properties: + definitionType: + $ref: '#/components/schemas/DefinitionType' + documentReference: + type: object + required: + - path + properties: + path: + type: string + description: "Absolute path to the file on the data destination (must start with '/')" + pattern: '^\/.*' + example: "/data/ingest/customer_data/csn_metadata.json" + additionalProperties: false + additionalProperties: false + + AutoDefinition: + type: object + required: + - definitionType + properties: + definitionType: + $ref: '#/components/schemas/DefinitionType' + autoConfig: + type: object + description: "Optional configuration for AUTO schema derivation" + properties: + csvOptions: + type: object + description: "Optional CSV-specific options (only for CSV type files)" + properties: + columnListInFirstRow: + type: boolean + default: true + description: "Whether CSV has column names in first row" + delimiter: + type: string + default: "," + description: "CSV delimiter character" + additionalProperties: false + additionalProperties: false + additionalProperties: false + + CSNDefinition: + oneOf: + - $ref: '#/components/schemas/DocumentDefinition' + - $ref: '#/components/schemas/ReferenceDefinition' + - $ref: '#/components/schemas/AutoDefinition' + discriminator: + propertyName: definitionType + mapping: + DOCUMENT: '#/components/schemas/DocumentDefinition' + REFERENCE: '#/components/schemas/ReferenceDefinition' + AUTO: '#/components/schemas/AutoDefinition' + + TabularArtifactListResponse: + type: object + required: + - resources + properties: + count: + type: integer + description: Total number of records + resources: + type: array + items: + $ref: "#/components/schemas/TabularArtifactDetails" + additionalProperties: false + + CreateTARequest: + type: object + required: + - dataDestinationName + - type + - path + - csnMetadata + properties: + dataDestinationName: + type: string + minLength: 1 + maxLength: 127 + description: "Identifier for the target data destination" + type: + type: string + enum: [CSV, PARQUET, DELTA] + description: "Source file format" + example: CSV + path: + type: string + description: | + Absolute path to the data (must start with '/'). + - For file-based artifacts (HDL, S3, GCS, AZURE): Standard file path (e.g., /data/customers.parquet) + - For Delta Sharing artifacts (DELTA_SHARING): Format /// (e.g., /sample_data/tpch/customer) + pattern: '^\/.*' + example: "/data/ingest/customer_data/file1.csv" + csnMetadata: + type: object + additionalProperties: false + description: "Metadata of artifact in CSN format. For AUTO definition type, entityName is optional and will be derived from the file name if not provided." + required: + - definition + properties: + entityName: + type: string + description: "Name of the entity in CSN model. Required for DOCUMENT and REFERENCE types. Optional for AUTO type (defaults to file name without extension)." + selectedColumns: + type: array + description: "List of selected columns from the source file to be included in the TA" + example: ["customer_id", "customer_name", "purchase_amount"] + minItems: 1 + uniqueItems: true + items: + type: string + description: "Name of the column" + definition: + $ref: '#/components/schemas/CSNDefinition' + additionalProperties: false + + TabularArtifactStatus: + type: string + enum: + - PROCESSING + - ERROR + - ACTIVE + - DELETING + description: > + Lifecycle status of the Tabular Artifact. + PROCESSING — the artifact is being created asynchronously (onboarding may be in progress). + ERROR — the artifact creation failed. + ACTIVE — the artifact is fully available. + DELETING — the artifact has been soft-deleted and is awaiting async cleanup. + + TabularArtifactErrorMessage: + type: string + nullable: true + description: Detailed error message if the Tabular Artifact creation failed + + TabularArtifactDetails: + type: object + required: + - id + - name + - tenantId + - resourceGroupId + - dataDestinationName + - path + - type + - status + - createdAt + - updatedAt + properties: + id: + type: string + description: Unique identifier of the Tabular Artifact + name: + type: string + description: Name of the Tabular Artifact + tenantId: + type: string + description: Tenant identifier + resourceGroupId: + type: string + description: Resource group identifier + dataDestinationName: + type: string + virtualTableName: + type: string + nullable: true + remoteSourceName: + type: string + nullable: true + path: + type: string + type: + type: string + enum: [CSV, PARQUET, DELTA] + status: + $ref: '#/components/schemas/TabularArtifactStatus' + errorMessage: + $ref: '#/components/schemas/TabularArtifactErrorMessage' + csnMetadata: + type: object + nullable: true + properties: + entityName: + type: string + description: Name of the entity in CSN model + selectedColumns: + type: array + description: List of selected columns from the source file + items: + type: string + definition: + $ref: '#/components/schemas/CSNDefinition' + metadata: + type: array + description: > + Schema metadata containing column definitions based on CSN + items: + type: object + required: + - type + - columns + properties: + type: + type: string + description: Type of metadata (e.g., csn) + example: "csn" + columns: + type: array + description: Array of column definitions extracted from CSN schema + items: + type: object + required: + - name + - cdsType + properties: + name: + type: string + description: Column name (extracted from CSN element key) + cdsType: + type: string + description: CDS data type (e.g., cds.String, cds.Integer, cds.Decimal, cds.Boolean, cds.Date, cds.DateTime) + example: "cds.String" + length: + type: integer + minimum: 1 + description: Column length (for string types, from CSN element length property) + example: 5000 + precision: + type: integer + minimum: 1 + description: Precision (for decimal types - total number of digits) + example: 15 + scale: + type: integer + minimum: 0 + description: Scale (for decimal types - digits after decimal point) + example: 2 + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + + TabularArtifactDataPreview: + type: object + required: + - name + - columns + - data + properties: + name: + type: string + description: Name of the Tabular Artifact + columns: + type: array + description: Array of column names in the result set + items: + type: string + data: + type: array + description: Array of row objects (up to 10 rows) + items: + type: object + additionalProperties: true + + Url: + type: string + format: uri + + # Scenario Configuration Schemas + CreateScenarioConfiguration: + type: object + required: + - tabularArtifacts + properties: + description: + type: string + maxLength: 253 + nullable: true + description: Optional description text for the scenario configuration + example: "Production HR scenario for customer data analysis" + contextSelectionStrategy: + $ref: "#/components/schemas/ContextSelectionStrategy" + tabularArtifacts: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/TabularArtifactConfig" + description: List of tabular artifacts + labels: + type: array + items: + $ref: "#/components/schemas/Label" + description: Optional labels for metadata tagging + additionalProperties: false + + TabularArtifactConfig: + type: object + required: + - name + properties: + name: + type: string + minLength: 1 + maxLength: 80 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + description: "Name for the Tabular Artifact." + example: "test-ta1" + additionalProperties: false + + Label: + type: object + required: + - key + - value + properties: + key: + type: string + minLength: 1 + maxLength: 63 + pattern: '^(ext)\.ai\.sap\.com\/(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]){1,48}$' + description: Label key must start with 'ext.ai.sap.com/' and follow the pattern + example: "ext.ai.sap.com/environment" + value: + type: string + minLength: 1 + maxLength: 63 + pattern: '^(([A-Za-z0-9][-A-Za-z0-9_.\/]*)?[A-Za-z0-9])?$' + description: Label value + example: "production" + additionalProperties: false + + ContextSelectionStrategy: + type: string + maxLength: 100 + enum: + - random + - embedding + description: Strategy for selecting context in the scenario configuration + example: "embedding" + + SearchScenarioConfiguration: + type: object + required: + - labels + properties: + labels: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/Label" + description: Labels to search for (must match all specified labels) + additionalProperties: false + + ScenarioConfigurationStatus: + type: string + enum: + - PROCESSING + - ACTIVE + - ERROR + - DELETING + description: > + Lifecycle status of the Scenario Configuration. + PROCESSING — creation is in progress. + ACTIVE — fully created and available. + ERROR — creation failed; see errorMessage for details. + DELETING — marked for deletion, awaiting async cleanup. + + ScenarioConfigurationErrorMessage: + type: string + nullable: true + description: Detailed error message if the Scenario Configuration creation failed + + ScenarioConfigurationNameObject: + type: object + required: + - name + properties: + name: + type: string + description: Name of the scenario configuration + + ScenarioConfigurationObject: + type: object + required: + - name + - tabularArtifacts + - createdAt + - updatedAt + properties: + name: + type: string + description: Name of the scenario configuration + example: "scm-bdc-def-v2" + description: + type: string + nullable: true + description: Optional description text + example: "Production BDC scenario for customer data analysis" + contextSelectionStrategy: + $ref: "#/components/schemas/ContextSelectionStrategy" + tabularArtifacts: + type: array + items: + $ref: "#/components/schemas/TabularArtifactConfig" + description: List of tabular artifacts + labels: + type: array + items: + $ref: "#/components/schemas/Label" + description: List of labels for the scenario configuration + status: + $ref: "#/components/schemas/ScenarioConfigurationStatus" + errorMessage: + $ref: "#/components/schemas/ScenarioConfigurationErrorMessage" + createdAt: + type: string + format: date-time + example: "2024-02-15T12:45:00.000Z" + updatedAt: + type: string + format: date-time + example: "2024-02-15T12:45:00.000Z" + + GetScenarioConfigurations: + type: object + required: + - resources + properties: + count: + type: integer + resources: + type: array + items: + $ref: "#/components/schemas/ScenarioConfigurationObject" + + PatchScenarioConfiguration: + type: object + minProperties: 1 + properties: + contextSelectionStrategy: + $ref: "#/components/schemas/ContextSelectionStrategy" + tabularArtifacts: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/TabularArtifactConfig" + description: Updated list of tabular artifacts + labels: + type: array + items: + $ref: "#/components/schemas/Label" + description: Updated labels (replaces all existing labels when provided) + description: + type: string + nullable: true + maxLength: 253 + description: Optional description for the scenario configuration + additionalProperties: false + + # Error Schemas + 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 + + 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 specified resource was not found + + Conflict: + content: + application/json: + schema: + type: object + properties: + error: + $ref: "#/components/schemas/ApiError" + description: The resource conflicts with existing resources or has dependencies + + UnprocessableEntity: + content: + application/json: + schema: + type: object + properties: + error: + $ref: "#/components/schemas/ApiError" + examples: + noVirtualTable: + value: + error: + code: "UNPROCESSABLE_ENTITY" + message: "Tabular artifact exists but has no virtual table" + metadataUnavailable: + value: + error: + code: "UNPROCESSABLE_ENTITY" + message: "Virtual table exists but metadata is not available" + noTabularArtifacts: + value: + error: + code: "UNPROCESSABLE_ENTITY" + message: "Scenario configuration exists but contains no tabular artifacts" + description: The request is valid but cannot be processed due to semantic errors + + ServerError: + content: + application/json: + schema: + type: object + properties: + error: + $ref: "#/components/schemas/ApiError" + description: Server error + + parameters: + top: + name: $top + description: Number of results to display + in: query + required: false + schema: + type: integer + minimum: 0 + maximum: 1000 + 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 diff --git a/core-services/tabular-orchestration/src/main/resources/spec/tabular-predict.json b/core-services/tabular-orchestration/src/main/resources/spec/tabular-predict.json new file mode 100644 index 000000000..ce33c1e8e --- /dev/null +++ b/core-services/tabular-orchestration/src/main/resources/spec/tabular-predict.json @@ -0,0 +1,659 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tabular AI Orchestrator", + "version": "1.6.0" + }, + "paths": { + "/predict": { + "post": { + "tags": [ + "predict" + ], + "summary": "Make predictions using a Tabular Foundation Model", + "description": "Make predictions for tabular data using a deployed Tabular Foundation Model.\n\n Required Headers:\n - ai-main-tenant: AI Core main tenant identifier\n - ai-resource-group: AI Core resource group identifier", + "operationId": "predict", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictResponse" + } + } + } + }, + "400": { + "description": "Invalid request data" + }, + "401": { + "description": "Authentication failed" + }, + "404": { + "description": "Model not found" + }, + "500": { + "description": "Internal server error" + }, + "502": { + "description": "External service error" + }, + "504": { + "description": "Request timeout" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": [ + "health" + ], + "summary": "Health Check", + "description": "If this application is up and running, health_check has passed.\nNo need to check for dependencies because each dependencies also has their own health_check", + "operationId": "health_check_v1_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HealthResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ColumnarData": { + "additionalProperties": { + "items": { + + }, + "type": "array" + }, + "type": "object", + "title": "ColumnarData", + "description": "Columnar data format where each key is a column name\nand the value is a list of values for that column.\n\nExample:\n{\n \"code\": [\"new_code1\", \"new_code2\"],\n \"category\": [\"Electronics\", \"Clothing\"],\n \"price\": [100, 50]\n}" + }, + "ContextSelectionConfig": { + "properties": { + "numRows": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Numrows", + "description": "Number of rows to select for context. If not provided or set to 0, context selection is skipped." + }, + "strategy": { + "$ref": "#/components/schemas/ContextSelectionStrategyEnum", + "description": "Sampling strategy for context selection.", + "default": "random" + }, + "strategyConfigs": { + "anyOf": [ + { + "$ref": "#/components/schemas/SamplingRandomConfig" + }, + { + "$ref": "#/components/schemas/SamplingHeuristicConfig" + }, + { + "type": "null" + } + ], + "title": "strategyConfigs", + "description": "Strategy-specific configuration parameters." + }, + "filterConditions": { + "anyOf": [ + { + "$ref": "#/components/schemas/FilterConditions" + }, + { + "$ref": "#/components/schemas/FilterCondition" + }, + { + "type": "null" + } + ], + "title": "FilterConditions", + "description": "Filter conditions for context selection" + }, + "verbose": { + "type": "boolean", + "title": "Verbose", + "description": "When true, show additional debug information for context selection", + "default": false + } + }, + "type": "object", + "title": "ContextSelectionConfig", + "description": "Configuration for context selection." + }, + "ContextSelectionStrategyEnum": { + "type": "string", + "enum": [ + "none", + "random", + "heuristic", + "auto" + ], + "title": "ContextSelectionStrategyEnum", + "description": "Context selection strategies for data sampling." + }, + "FilterCondition": { + "properties": { + "field": { + "type": "string", + "title": "Field", + "description": "Field name to filter on" + }, + "op": { + "type": "string", + "title": "Op", + "description": "Filter operator (e.g., 'eq', 'gte', 'lte')" + }, + "value": { + "title": "Value", + "description": "Value to compare against" + } + }, + "type": "object", + "required": [ + "field", + "op", + "value" + ], + "title": "FilterCondition", + "description": "A single filter condition for context selection." + }, + "FilterConditions": { + "properties": { + "logic": { + "type": "string", + "title": "Logic", + "description": "Logical operator to combine conditions ('and' or 'or')" + }, + "conditions": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/FilterCondition" + }, + { + "$ref": "#/components/schemas/FilterConditions" + } + ] + }, + "type": "array", + "title": "Conditions", + "description": "List of filter conditions" + } + }, + "type": "object", + "required": [ + "logic", + "conditions" + ], + "title": "FilterConditions", + "description": "Filter conditions for context selection." + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "HealthResponse": { + "properties": { + "code": { + "type": "integer", + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "HealthResponse" + }, + "ModelConfig": { + "properties": { + + }, + "additionalProperties": true, + "type": "object", + "title": "ModelConfig", + "description": "Model-specific configuration passed through to the underlying TFM.\n\nAny fields here are forwarded to the TFM as top-level fields of the prediction request payload. " + }, + "PredictMetadata": { + "properties": { + "num_columns": { + "type": "integer", + "title": "Num Columns" + }, + "num_rows": { + "type": "integer", + "title": "Num Rows" + }, + "num_predictions": { + "type": "integer", + "title": "Num Predictions" + }, + "num_query_rows": { + "type": "integer", + "title": "Num Query Rows" + } + }, + "type": "object", + "required": [ + "num_columns", + "num_rows", + "num_predictions", + "num_query_rows" + ], + "title": "PredictMetadata", + "description": "Metadata about the prediction." + }, + "PredictRequest": { + "properties": { + "modelName": { + "$ref": "#/components/schemas/TFMEnum", + "description": "Name of the deployed model" + }, + "scenarioConfigName": { + "type": "string", + "title": "Scenarioconfigname", + "description": "Scenario configuration identifier" + }, + "contextSelectionConfig": { + "$ref": "#/components/schemas/ContextSelectionConfig", + "description": "Context selection configuration" + }, + "predictionConfig": { + "$ref": "#/components/schemas/PredictionConfig", + "description": "Prediction configuration" + }, + "modelConfig": { + "$ref": "#/components/schemas/ModelConfig", + "description": "Model-specific configuration passed through to the underlying TFM as top-level fields of the prediction request payload" + }, + "columns": { + "anyOf": [ + { + "$ref": "#/components/schemas/ColumnarData" + }, + { + "type": "null" + } + ], + "description": "Query-only rows in columnar form. An object mapping from column name to array of column values." + }, + "contextColumns": { + "anyOf": [ + { + "$ref": "#/components/schemas/ColumnarData" + }, + { + "type": "null" + } + ], + "description": "(Optional) Context rows in columnar form, only relevant if 'columns' is provided. An object mapping from column name to array of column values." + }, + "rows": { + "anyOf": [ + { + "$ref": "#/components/schemas/RowData" + }, + { + "type": "null" + } + ], + "description": "Query-only rows in row form. An array of objects representing table rows." + }, + "contextRows": { + "anyOf": [ + { + "$ref": "#/components/schemas/RowData" + }, + { + "type": "null" + } + ], + "description": "(Optional) Context rows in row form, only relevant if 'rows' is provided. An array of objects representing table rows." + } + }, + "type": "object", + "required": [ + "modelName", + "scenarioConfigName", + "predictionConfig" + ], + "title": "PredictRequest", + "description": "Request schema for prediction endpoint." + }, + "PredictResponse": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "metadata": { + "$ref": "#/components/schemas/PredictMetadata" + }, + "predictions": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Predictions" + }, + "status": { + "$ref": "#/components/schemas/PredictStatus" + }, + "additional_information": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Additional Information", + "description": "Warnings or informational messages from context selection", + "default": [] + } + }, + "type": "object", + "required": [ + "id", + "metadata", + "predictions", + "status" + ], + "title": "PredictResponse", + "description": "Response schema for prediction endpoint.\n\nExample response:\n{\n \"id\": \"8f15bafd-5fb8-4a35-bd2f-43c3b5887584\",\n \"metadata\": {\n \"num_columns\": 5,\n \"num_predictions\": 1,\n \"num_query_rows\": 1,\n \"num_rows\": 3\n },\n \"predictions\": [\n {\n \"category\": [\n {\n \"confidence\": 0.71,\n \"prediction\": \"Electronics\"\n }\n ],\n \"id\": 4\n }\n ],\n \"status\": {\n \"code\": 0,\n \"message\": \"ok\"\n }\n}" + }, + "PredictStatus": { + "properties": { + "code": { + "type": "integer", + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "PredictStatus", + "description": "Status of the prediction." + }, + "PredictionConfig": { + "properties": { + "targetColumns": { + "items": { + "$ref": "#/components/schemas/TargetColumn" + }, + "type": "array", + "minItems": 1, + "title": "Targetcolumns", + "description": "List of target columns with prediction configuration" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "targetColumns" + ], + "title": "PredictionConfig", + "description": "Configuration for what to predict.\n\nModel-agnostic prediction config. Only contains fields shared across\nall TFMs. Model-specific fields belong in `PredictRequest.modelConfig`." + }, + "RowData": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "RowData", + "description": "Row-wise data format where each element is a dictionary\nrepresenting a single row with column names as keys.\n\nExample:\n[\n {\"code\": \"new_code1\", \"category\": \"Electronics\", \"price\": 100},\n {\"code\": \"new_code2\", \"category\": \"Clothing\", \"price\": 50},\n]" + }, + "SamplingHeuristicConfig": { + "properties": { + "indexColumn": { + "type": "string", + "title": "Indexcolumn", + "description": "Name of the unique row-identifier column (e.g. 'ROW_INDEX'). Required for Heuristic scoring and deduplication." + }, + "methodRatio": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Methodratio", + "description": "Fraction of numRows filled by scoring method (remainder is random fill). Must be between 0 and 1.", + "default": 0.67 + }, + "fuzzyNumPct": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Fuzzynumpct", + "description": "Numeric fuzzy threshold as a fraction of the absolute query value. E.g. 0.1 = ±10%.", + "default": 0.1 + }, + "poolSize": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Poolsize", + "description": "If set, scoring runs against a random subsample of this many rows instead of the full table. None = full table scan." + }, + "fuzzyDateDays": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fuzzydatedays", + "description": "Day window for fuzzy date matching. A date column scores 1 if abs(DAYS_BETWEEN(row_date, query_date)) \u003C= dateFuzzyDays. Set to 0 for exact date match.", + "default": 30 + }, + "allowTimeoutFallback": { + "type": "boolean", + "title": "Allowtimeoutfallback", + "description": "When true, heuristic sampling falls back to random on timeout instead of raising an error. Set by the orchestrator when strategy=AUTO.", + "default": false + } + }, + "type": "object", + "required": [ + "indexColumn" + ], + "title": "SamplingHeuristicConfig", + "description": "Strategy-specific configuration parameters for Heuristic." + }, + "SamplingRandomConfig": { + "properties": { + "indexColumn": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Indexcolumn", + "description": "Name of the unique row-identifier column. Required when deterministic=True." + }, + "deterministic": { + "type": "boolean", + "title": "Deterministic", + "description": "When true, uses HASH_SHA256 of indexColumn for ordering instead of RAND(), producing the same row order on every call for the same data.", + "default": false + } + }, + "type": "object", + "title": "SamplingRandomConfig", + "description": "Strategy-specific configuration parameters for Random." + }, + "TFMEnum": { + "type": "string", + "enum": [ + "sap-rpt-1-small", + "sap-rpt-1-large", + "sap-rpt-1.5", + "sap-rpt-1.5-large" + ], + "title": "TFMEnum", + "description": "Supported Tabular Foundation Models." + }, + "TargetColumn": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "Name of the column to predict" + }, + "prediction_placeholder": { + "type": "string", + "title": "Prediction Placeholder", + "description": "(Optional) Placeholder value indicating cells to predict", + "default": "[PREDICT]" + }, + "task_type": { + "$ref": "#/components/schemas/TaskTypeEnum", + "description": "(Optional) Type of prediction task (classification or regression)", + "default": "classification" + }, + "top_k": { + "type": "integer", + "title": "Top K", + "description": "(Optional) Controls how many labels to predict for each column in each row. Only applicable to 'classification' task type.", + "default": 1 + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "TargetColumn", + "description": "Configuration for a target column to predict." + }, + "TaskTypeEnum": { + "type": "string", + "enum": [ + "classification", + "regression" + ], + "title": "TaskTypeEnum", + "description": "ML task types for predictions." + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + } + } + } +} diff --git a/core-services/tabular-orchestration/src/test/java/com/sap/ai/sdk/tabular/TabularUnitTest.java b/core-services/tabular-orchestration/src/test/java/com/sap/ai/sdk/tabular/TabularUnitTest.java new file mode 100644 index 000000000..169634502 --- /dev/null +++ b/core-services/tabular-orchestration/src/test/java/com/sap/ai/sdk/tabular/TabularUnitTest.java @@ -0,0 +1,238 @@ +package com.sap.ai.sdk.tabular; + +import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl; +import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.okJson; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.DataDestinationStatus.ACTIVE; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.DefinitionType.DOCUMENT; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationGetResponse.AdapterTypeEnum.FILE; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationGetResponse.TypeEnum.HDL; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactDetails.TypeEnum.PARQUET; +import static com.sap.ai.sdk.tabular.generated.predict.model.TaskTypeEnum.CLASSIFICATION; +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.tomakehurst.wiremock.client.WireMock; +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.tabular.generated.orchestration.model.ContextSelectionStrategy; +import com.sap.ai.sdk.tabular.generated.orchestration.model.DocumentDefinition; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetDataDestination; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetDataDestinations; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetScenarioConfigurations; +import com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationGetResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ScenarioConfigurationObject; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ScenarioConfigurationStatus; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactDetails; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactListResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactStatus; +import com.sap.ai.sdk.tabular.generated.predict.model.ContextSelectionConfig; +import com.sap.ai.sdk.tabular.generated.predict.model.ContextSelectionStrategyEnum; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictRequest; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictResponse; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictionConfig; +import com.sap.ai.sdk.tabular.generated.predict.model.StrategyConfigs; +import com.sap.ai.sdk.tabular.generated.predict.model.TFMEnum; +import com.sap.ai.sdk.tabular.generated.predict.model.TargetColumn; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import java.util.List; +import java.util.Map; +import lombok.val; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@WireMockTest +public class TabularUnitTest { + private static TabularClient client; + + static final String resourceGroup = "default"; + static final String dataDestinationName = "ai-sdk-hdl-destination"; + static final String artifactName = "product-artifact-lowercase"; + static final String artifactPath = "/data/product_data_hana_lowercase.parquet"; + static final String scenarioConfigName = "product-prediction-scenario-lowercase"; + + @BeforeEach + void setup(final WireMockRuntimeInfo server) { + val base = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); + val service = new AiCoreService().withBaseDestination(base); + client = new TabularClient(service).withPredictDestination(base); + + ApacheHttpClient5Accessor.setHttpClientCache(ApacheHttpClient5Cache.DISABLED); + } + + @Test + void testGetAllDataDestinations() { + final GetDataDestinations response = + client.dataDestinations().getAllDataDestinations(resourceGroup); + assertThat(response.getCount()).isEqualTo(1); + final List resources = response.getResources(); + assertThat(resources.size()).isEqualTo(1); + final HDLDataDestinationGetResponse dataDestination = + (HDLDataDestinationGetResponse) resources.get(0); + assertThat(dataDestination.getName()).isEqualTo("ai-sdk-hdl-destination"); + assertThat(dataDestination.getType()).isEqualTo(HDL); + assertThat(dataDestination.getDescription()).isEqualTo("HDL data destination for AI Core SDK"); + assertThat(dataDestination.getAdapterType()).isEqualTo(FILE); + assertThat(dataDestination.getCreatedAt()).isEqualTo("2026-05-19T11:15:40.062350Z"); + assertThat(dataDestination.getUpdatedAt()).isEqualTo("2026-08-24T08:25:35.730000Z"); + assertThat(dataDestination.getLabels()).isEmpty(); + assertThat(dataDestination.getStatus()).isEqualTo(ACTIVE); + } + + @Test + void testGetAllTabularArtifacts() { + final TabularArtifactListResponse response = + client.tabularArtifacts().getAllTabularArtifacts(resourceGroup); + assertThat(response.getCount()).isEqualTo(1); + final List resources = response.getResources(); + assertThat(resources.size()).isEqualTo(1); + + final TabularArtifactDetails artifact = resources.get(0); + assertThat(artifact.getId()).isEqualTo("1abcd328-9701-4e21-822d-a7f93b12ce12"); + assertThat(artifact.getName()).isEqualTo(artifactName); + assertThat(artifact.getTenantId()).isEqualTo("94bbb59e-56ff-4cf3-9787-f6b28d5e565b"); + assertThat(artifact.getResourceGroupId()).isEqualTo(resourceGroup); + assertThat(artifact.getDataDestinationName()).isEqualTo(dataDestinationName); + assertThat(artifact.getVirtualTableName()) + .isEqualTo("v_fc09a120-360a-5364-b061-a43c2f3d07d3_product-artifact-lowercase"); + assertThat(artifact.getRemoteSourceName()).isEqualTo("rs_b745d23e_ff45_53db_9d66_3573fc42fc80"); + assertThat(artifact.getPath()).isEqualTo(artifactPath); + assertThat(artifact.getType()).isEqualTo(PARQUET); + assertThat(artifact.getStatus()).isEqualTo(TabularArtifactStatus.ACTIVE); + assertThat(artifact.getErrorMessage()).isNull(); + assertThat(artifact.getMetadata()).isEmpty(); + assertThat(artifact.getCreatedAt()).isEqualTo("2026-05-22T06:48:54.858000Z"); + assertThat(artifact.getUpdatedAt()).isEqualTo("2026-08-24T08:25:42.036000Z"); + + final var csnMetadata = artifact.getCsnMetadata(); + assertThat(csnMetadata).isNotNull(); + assertThat(csnMetadata.getEntityName()).isEqualTo("ProductEntity"); + assertThat(csnMetadata.getSelectedColumns()) + .containsExactly("product", "price", "date", "id", "salesgroup"); + + final DocumentDefinition definition = (DocumentDefinition) csnMetadata.getDefinition(); + assertThat(definition.getDefinitionType()).isEqualTo(DOCUMENT); + assertThat(definition.getDocument()).isNotNull(); + } + + @Test + void testGetAllScenarioConfigurations() { + final GetScenarioConfigurations response = + client.scenarioConfiguration().getAllScenarioConfigurations(resourceGroup); + assertThat(response.getCount()).isEqualTo(1); + final List resources = response.getResources(); + assertThat(resources.size()).isEqualTo(1); + + final ScenarioConfigurationObject scenario = resources.get(0); + assertThat(scenario.getName()).isEqualTo(scenarioConfigName); + assertThat(scenario.getDescription()).isNull(); + assertThat(scenario.getContextSelectionStrategy()).isEqualTo(ContextSelectionStrategy.RANDOM); + assertThat(scenario.getTabularArtifacts()).hasSize(1); + assertThat(scenario.getTabularArtifacts().get(0).getName()).isEqualTo(artifactName); + assertThat(scenario.getLabels()).isEmpty(); + assertThat(scenario.getStatus()).isEqualTo(ScenarioConfigurationStatus.ACTIVE); + assertThat(scenario.getErrorMessage()).isNull(); + assertThat(scenario.getCreatedAt()).isEqualTo("2026-05-22T06:49:16.596000Z"); + assertThat(scenario.getUpdatedAt()).isEqualTo("2026-05-22T06:49:16.596000Z"); + } + + @Test + void testPredict() { + val request = + PredictRequest.create() + .modelName(TFMEnum._1_5) + .scenarioConfigName(scenarioConfigName) + .predictionConfig( + PredictionConfig.create() + .targetColumns( + TargetColumn.create().name("salesgroup").taskType(CLASSIFICATION))) + .contextSelectionConfig( + ContextSelectionConfig.create() + .numRows(3) + .strategy(ContextSelectionStrategyEnum.RANDOM) + .strategyConfigs( + StrategyConfigs.create().indexColumn("id").deterministic(true))) + .rows( + List.of( + Map.of( + "product", "Desktop Computer", + "price", 921.5, + "date", "2024-12-02", + "id", "42", + "salesgroup", "[PREDICT]"), + Map.of( + "product", "Macbook", + "price", 1220.99, + "date", "2026-01-31", + "id", "99", + "salesgroup", "[PREDICT]"), + Map.of( + "product", "Office Desk", + "price", 750.5, + "date", "2024-12-05", + "id", "689", + "salesgroup", "[PREDICT]"))) + .modelConfig(Map.of()); + + final PredictResponse response = client.predict().predict(request); + assertThat(response.getId()).isEqualTo("babec616-8085-43ad-a36a-57f0c1484202"); + + assertThat(response.getMetadata().getNumColumns()).isEqualTo(5); + assertThat(response.getMetadata().getNumRows()).isEqualTo(6); + assertThat(response.getMetadata().getNumPredictions()).isEqualTo(3); + assertThat(response.getMetadata().getNumQueryRows()).isEqualTo(3); + + final List> predictions = response.getPredictions(); + assertThat(predictions).hasSize(3); + + @SuppressWarnings("unchecked") + final List> firstPrediction = + (List>) predictions.get(0).get("salesgroup"); + assertThat(firstPrediction).hasSize(1); + assertThat(firstPrediction.get(0).get("confidence")).isEqualTo(1.0); + assertThat(firstPrediction.get(0).get("confidence_interval")).isNull(); + assertThat(firstPrediction.get(0).get("prediction")).isEqualTo("Electronics"); + + @SuppressWarnings("unchecked") + final List> secondPrediction = + (List>) predictions.get(1).get("salesgroup"); + assertThat(secondPrediction.get(0).get("prediction")).isEqualTo("Electronics"); + + @SuppressWarnings("unchecked") + final List> thirdPrediction = + (List>) predictions.get(2).get("salesgroup"); + assertThat(thirdPrediction.get(0).get("prediction")).isEqualTo("Furniture"); + + assertThat(response.getStatus().getCode()).isEqualTo(0); + assertThat(response.getStatus().getMessage()).isEqualTo("ok"); + assertThat(response.getAdditionalInformation()).isEmpty(); + } + + @Test + void testCustomHeaders() { + WireMock.stubFor( + get(anyUrl()) + .withHeader("x-test-header", equalTo("test-value")) + .willReturn( + okJson( + """ + { + "count": 0, + "resources": [] + } + """))); + + val response = + client + .withHeader("x-test-header", "test-value") + .dataDestinations() + .getAllDataDestinations(resourceGroup); + assertThat(response.getCount()).isEqualTo(0); + + WireMock.verify(getRequestedFor(anyUrl()).withHeader("x-test-header", equalTo("test-value"))); + } +} diff --git a/core-services/tabular-orchestration/src/test/resources/mappings/getAllDataDestinations.json b/core-services/tabular-orchestration/src/test/resources/mappings/getAllDataDestinations.json new file mode 100644 index 000000000..7522d4c44 --- /dev/null +++ b/core-services/tabular-orchestration/src/test/resources/mappings/getAllDataDestinations.json @@ -0,0 +1,32 @@ +{ + "request": { + "method": "GET", + "url": "/v2/tcr/dataDestinations", + "headers": { + "Accept": { "equalTo": "application/json" }, + "AI-Resource-Group": { "equalTo": "default" } + } + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "count": 1, + "resources": [ + { + "name": "ai-sdk-hdl-destination", + "type": "HDL", + "description": "HDL data destination for AI Core SDK", + "adapterType": "File", + "createdAt": "2026-05-19T11:15:40.062350Z", + "updatedAt": "2026-08-24T08:25:35.730000Z", + "labels": [], + "status": "ACTIVE" + } + ] + } + } +} + diff --git a/core-services/tabular-orchestration/src/test/resources/mappings/getAllScenarioConfigurations.json b/core-services/tabular-orchestration/src/test/resources/mappings/getAllScenarioConfigurations.json new file mode 100644 index 000000000..360a73e71 --- /dev/null +++ b/core-services/tabular-orchestration/src/test/resources/mappings/getAllScenarioConfigurations.json @@ -0,0 +1,34 @@ +{ + "request": { + "method": "GET", + "url": "/v2/tcr/scenarioConfigurations", + "headers": { + "Accept": { "equalTo": "application/json" }, + "AI-Resource-Group": { "equalTo": "default" } + } + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "count": 1, + "resources": [ + { + "name": "product-prediction-scenario-lowercase", + "contextSelectionStrategy": "random", + "tabularArtifacts": [ + { + "name": "product-artifact-lowercase" + } + ], + "createdAt": "2026-05-22T06:49:16.596000Z", + "updatedAt": "2026-05-22T06:49:16.596000Z", + "status": "ACTIVE" + } + ] + } + } +} + diff --git a/core-services/tabular-orchestration/src/test/resources/mappings/getAllTabularArtifacts.json b/core-services/tabular-orchestration/src/test/resources/mappings/getAllTabularArtifacts.json new file mode 100644 index 000000000..0bc873666 --- /dev/null +++ b/core-services/tabular-orchestration/src/test/resources/mappings/getAllTabularArtifacts.json @@ -0,0 +1,77 @@ +{ + "request": { + "method": "GET", + "url": "/v2/tcr/tabularArtifacts", + "headers": { + "Accept": { + "equalTo": "application/json" + }, + "AI-Resource-Group": { + "equalTo": "default" + } + } + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "count": 1, + "resources": [ + { + "id": "1abcd328-9701-4e21-822d-a7f93b12ce12", + "name": "product-artifact-lowercase", + "tenantId": "94bbb59e-56ff-4cf3-9787-f6b28d5e565b", + "resourceGroupId": "default", + "dataDestinationName": "ai-sdk-hdl-destination", + "virtualTableName": "v_fc09a120-360a-5364-b061-a43c2f3d07d3_product-artifact-lowercase", + "remoteSourceName": "rs_b745d23e_ff45_53db_9d66_3573fc42fc80", + "path": "/data/product_data_hana_lowercase.parquet", + "type": "PARQUET", + "status": "ACTIVE", + "csnMetadata": { + "entityName": "ProductEntity", + "selectedColumns": [ + "product", + "price", + "date", + "id", + "salesgroup" + ], + "definition": { + "definitionType": "DOCUMENT", + "document": { + "definitions": { + "ProductEntity": { + "kind": "entity", + "elements": { + "product": { + "type": "cds.String" + }, + "price": { + "type": "cds.Double" + }, + "date": { + "type": "cds.String" + }, + "id": { + "type": "cds.String" + }, + "salesgroup": { + "type": "cds.String" + } + } + } + } + } + } + }, + "createdAt": "2026-05-22T06:48:54.858000Z", + "updatedAt": "2026-08-24T08:25:42.036000Z" + } + ] + } + } +} + diff --git a/core-services/tabular-orchestration/src/test/resources/mappings/predict.json b/core-services/tabular-orchestration/src/test/resources/mappings/predict.json new file mode 100644 index 000000000..28fbee2dd --- /dev/null +++ b/core-services/tabular-orchestration/src/test/resources/mappings/predict.json @@ -0,0 +1,116 @@ +{ + "request": { + "method": "POST", + "url": "/predict", + "bodyPatterns": [ + { + "equalToJson": { + "modelName": "sap-rpt-1.5", + "scenarioConfigName": "product-prediction-scenario-lowercase", + "contextSelectionConfig": { + "numRows": 3, + "strategy": "random", + "strategyConfigs": { + "indexColumn": "id", + "deterministic": true, + "methodRatio": null, + "fuzzyNumPct": null, + "poolSize": null, + "fuzzyDateDays": null, + "allowTimeoutFallback": false + }, + "filterConditions": null, + "verbose": false + }, + "predictionConfig": { + "targetColumns": [ + { + "name": "salesgroup", + "prediction_placeholder": "[PREDICT]", + "task_type": "classification", + "top_k": 1 + } + ] + }, + "modelConfig": {}, + "columns": null, + "contextColumns": null, + "rows": [ + { + "price": 921.5, + "salesgroup": "[PREDICT]", + "date": "2024-12-02", + "product": "Desktop Computer", + "id": "42" + }, + { + "price": 1220.99, + "salesgroup": "[PREDICT]", + "date": "2026-01-31", + "product": "Macbook", + "id": "99" + }, + { + "price": 750.5, + "salesgroup": "[PREDICT]", + "date": "2024-12-05", + "product": "Office Desk", + "id": "689" + } + ], + "contextRows": null + } + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "jsonBody": { + "id": "babec616-8085-43ad-a36a-57f0c1484202", + "metadata": { + "num_columns": 5, + "num_rows": 6, + "num_predictions": 3, + "num_query_rows": 3 + }, + "predictions": [ + { + "salesgroup": [ + { + "confidence": 1.0, + "confidence_interval": null, + "prediction": "Electronics" + } + ] + }, + { + "salesgroup": [ + { + "confidence": 1.0, + "confidence_interval": null, + "prediction": "Electronics" + } + ] + }, + { + "salesgroup": [ + { + "confidence": 1.0, + "confidence_interval": null, + "prediction": "Furniture" + } + ] + } + ], + "status": { + "code": 0, + "message": "ok" + }, + "additional_information": [] + } + } +} + diff --git a/docs/release_notes.md b/docs/release_notes.md index 5745d6681..df553960d 100644 --- a/docs/release_notes.md +++ b/docs/release_notes.md @@ -12,7 +12,7 @@ ### ✨ New Functionality -- +- [Tabular Orchestration] Added `TabularClient` in `com.sap.ai.sdk:tabular-orchestration` for tabular predictions. ### 📈 Improvements diff --git a/logback.xml b/logback.xml index 07b2c17fa..77b449c90 100644 --- a/logback.xml +++ b/logback.xml @@ -1,20 +1,22 @@ - + + - - - ${LOG_PATTERN} - - + + + ${LOG_PATTERN} + + - - - + + + - - - - - + + + + + diff --git a/pom.xml b/pom.xml index ea44d1946..f82bda7df 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,7 @@ core-services/batch core-services/document-grounding core-services/prompt-registry + core-services/tabular-orchestration foundation-models/openai foundation-models/sap-rpt @@ -346,6 +347,11 @@ sap-rpt ${project.version} + + com.sap.ai.sdk + tabular-orchestration + ${project.version} + com.sap.ai.sdk.app spring-app @@ -801,14 +807,12 @@ 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/foundationmodels/openai/generated/model/* - com/sap/ai/sdk/foundationmodels/rpt/generated/** com/sap/ai/sdk/orchestration/model/* com/sap/ai/sdk/grounding/client/* com/sap/ai/sdk/grounding/model/* com/sap/ai/sdk/prompt/registry/client/* com/sap/ai/sdk/prompt/registry/model/* - com/sap/ai/sdk/batch/generated/** + **/generated/** @@ -830,14 +834,13 @@ 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/foundationmodels/openai/generated/model/* - com/sap/ai/sdk/foundationmodels/rpt/generated/** com/sap/ai/sdk/grounding/client/* com/sap/ai/sdk/grounding/model/* com/sap/ai/sdk/prompt/registry/model/* com/sap/ai/sdk/prompt/registry/client/* com/sap/ai/sdk/app/**/* com/sap/ai/sdk/orchestration/JacksonMixins* + **/generated/** diff --git a/sample-code/spring-app/pom.xml b/sample-code/spring-app/pom.xml index cc01e7844..b5e365dda 100644 --- a/sample-code/spring-app/pom.xml +++ b/sample-code/spring-app/pom.xml @@ -130,6 +130,10 @@ com.sap.ai.sdk.foundationmodels sap-rpt + + com.sap.ai.sdk + tabular-orchestration + com.sap.cloud.sdk.cloudplatform cloudplatform-core diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/TabularController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/TabularController.java new file mode 100644 index 000000000..ce2eb50c4 --- /dev/null +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/TabularController.java @@ -0,0 +1,188 @@ +package com.sap.ai.sdk.app.controllers; + +import static com.sap.ai.sdk.app.services.TabularService.artifactName; +import static com.sap.ai.sdk.app.services.TabularService.dataDestinationName; +import static com.sap.ai.sdk.app.services.TabularService.scenarioConfigName; + +import com.sap.ai.sdk.app.services.TabularService.ArtifactService; +import com.sap.ai.sdk.app.services.TabularService.DataDestinationService; +import com.sap.ai.sdk.app.services.TabularService.PredictionService; +import com.sap.ai.sdk.app.services.TabularService.ScenarioConfigurationService; +import com.sap.ai.sdk.tabular.generated.orchestration.model.AutoDefinition; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CSNDefinition; +import com.sap.ai.sdk.tabular.generated.orchestration.model.DeltaSharingDataDestinationGetResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.DocumentDefinition; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetDataDestination; +import com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationGetResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ObjectStoreDataDestinationGetResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ReferenceDefinition; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ScenarioConfigurationObject; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactDetails; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import lombok.extern.slf4j.Slf4j; +import lombok.val; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * Endpoints for Tabular Orchestration operations. + * + *

Note: This code does not return the SDK model objects as JSON. Instead, it converts them to + * plain {@link Map}s with each model's {@code toMap()} method. Reason: {@code GetDataDestination} + * and {@code CSNDefinition} are interfaces. Jackson cannot serialize these interfaces to JSON. This + * is a known issue in the generated code, not a bug in Spring or Jackson. + */ +@Slf4j +@RestController +@SuppressWarnings("unused") +@RequestMapping("/tabular") +class TabularController { + + private static final DataDestinationService DATA_DESTINATION_SERVICE = + new DataDestinationService(); + private static final ArtifactService ARTIFACT_SERVICE = new ArtifactService(); + private static final ScenarioConfigurationService SCENARIO_CONFIGURATION_SERVICE = + new ScenarioConfigurationService(); + private static final PredictionService PREDICTION_SERVICE = new PredictionService(); + + /** List all data destinations for the default resource group. */ + @GetMapping("/data-destinations/list") + Object getAllDataDestinations( + @Nullable @RequestParam(value = "format", required = false) final String format) { + val response = DATA_DESTINATION_SERVICE.getAllDataDestinations(); + if ("json".equals(format)) { + val resources = response.getResources().stream().map(TabularController::toMap).toList(); + return Map.of("count", response.getCount(), "resources", resources); + } + val types = response.getResources().stream().map(GetDataDestination::getType).toList(); + return "Found data destinations with types: " + types; + } + + /** Create a new Hana Data Lake data destination. */ + @GetMapping("/data-destinations/create") + Object createDataDestination( + @Nullable @RequestParam(value = "format", required = false) final String format) { + val response = DATA_DESTINATION_SERVICE.createHanaDataLakeDataDestination(dataDestinationName); + if ("json".equals(format)) { + return response; + } + return "Created data destination: " + response.getName(); + } + + /** List all tabular artifacts for the default resource group. */ + @GetMapping("/artifacts/list") + Object getAllArtifacts( + @Nullable @RequestParam(value = "format", required = false) final String format) { + val response = ARTIFACT_SERVICE.getAllArtifacts(); + if ("json".equals(format)) { + val resources = response.getResources().stream().map(TabularController::toMap).toList(); + return Map.of("count", response.getCount(), "resources", resources); + } + val names = response.getResources().stream().map(TabularArtifactDetails::getName).toList(); + return "Found tabular artifacts: " + names; + } + + /** Create a new tabular artifact from a Parquet file. */ + @GetMapping("/artifacts/create") + Object createArtifact( + @Nullable @RequestParam(value = "format", required = false) final String format) { + val response = ARTIFACT_SERVICE.createArtifact(artifactName); + if ("json".equals(format)) { + return response; + } + return "Created tabular artifact: " + response.getName(); + } + + /** List all scenario configurations for the default resource group. */ + @GetMapping("/scenario-configurations/list") + Object getAllScenarioConfigurations( + @Nullable @RequestParam(value = "format", required = false) final String format) { + val response = SCENARIO_CONFIGURATION_SERVICE.getAllScenarioConfigurations(); + if ("json".equals(format)) { + return response; + } + val names = response.getResources().stream().map(ScenarioConfigurationObject::getName).toList(); + return "Found scenario configurations: " + names; + } + + /** Create a new scenario configuration for product prediction. */ + @GetMapping("/scenario-configurations/create") + Object createScenarioConfiguration( + @Nullable @RequestParam(value = "format", required = false) final String format) { + val response = SCENARIO_CONFIGURATION_SERVICE.createScenarioConfiguration(scenarioConfigName); + if ("json".equals(format)) { + return response; + } + return "Created scenario configuration: " + response.getName(); + } + + /** Run a prediction using a deployed Tabular Foundation Model. */ + @GetMapping("/predict") + Object predict(@Nullable @RequestParam(value = "format", required = false) final String format) { + val response = PREDICTION_SERVICE.predict(); + if ("json".equals(format)) { + return response.toMap(); + } + val predictions = + response.getPredictions().stream() + .map(TabularController::extractSalesGroupPredictions) + .toList(); + return "Predictions: " + predictions; + } + + /** + * Get the predicted values for "salesgroup" from one prediction row. + * + * @param row One prediction row. + * @return The list of predicted values for "salesgroup". + */ + @Nonnull + @SuppressWarnings("unchecked") + private static List extractSalesGroupPredictions(@Nonnull final Map row) { + val salesgroup = (List>) row.get("salesgroup"); + if (salesgroup == null) { + return List.of(); + } + return salesgroup.stream().map(candidate -> candidate.get("prediction")).toList(); + } + + private static Map toMap(@Nonnull final GetDataDestination destination) { + if (destination instanceof HDLDataDestinationGetResponse hdl) { + return hdl.toMap(); + } else if (destination instanceof ObjectStoreDataDestinationGetResponse objectStore) { + return objectStore.toMap(); + } else if (destination instanceof DeltaSharingDataDestinationGetResponse deltaSharing) { + return deltaSharing.toMap(); + } + return Map.of("type", destination.getType()); + } + + private static Map toMap(@Nonnull final TabularArtifactDetails artifact) { + val map = new LinkedHashMap<>(artifact.toMap()); + val csnMetadata = artifact.getCsnMetadata(); + if (csnMetadata != null) { + val csnMetadataMap = new LinkedHashMap<>(csnMetadata.toMap()); + val definition = csnMetadata.getDefinition(); + csnMetadataMap.put("definition", toMap(definition)); + map.put("csnMetadata", csnMetadataMap); + } + return map; + } + + private static Map toMap(@Nonnull final CSNDefinition definition) { + if (definition instanceof DocumentDefinition document) { + return document.toMap(); + } else if (definition instanceof ReferenceDefinition reference) { + return reference.toMap(); + } else if (definition instanceof AutoDefinition auto) { + return auto.toMap(); + } + return Map.of("definitionType", definition.getDefinitionType()); + } +} diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/TabularService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/TabularService.java new file mode 100644 index 000000000..c8a0901d6 --- /dev/null +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/TabularService.java @@ -0,0 +1,278 @@ +package com.sap.ai.sdk.app.services; + +import static com.sap.ai.sdk.tabular.generated.orchestration.model.CreateTARequest.TypeEnum.PARQUET; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.DefinitionType.DOCUMENT; +import static com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationCreateRequest.TypeEnum.HDL; +import static com.sap.ai.sdk.tabular.generated.predict.model.ContextSelectionStrategyEnum.RANDOM; +import static com.sap.ai.sdk.tabular.generated.predict.model.TaskTypeEnum.CLASSIFICATION; + +import com.sap.ai.sdk.tabular.TabularClient; +import com.sap.ai.sdk.tabular.generated.orchestration.client.DataDestinationsApi; +import com.sap.ai.sdk.tabular.generated.orchestration.client.ScenarioConfigurationManagerApi; +import com.sap.ai.sdk.tabular.generated.orchestration.client.TabularArtifactsApi; +import com.sap.ai.sdk.tabular.generated.orchestration.model.AsyncCreateDataDestinationResponse; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ContextSelectionStrategy; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CreateScenarioConfiguration; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CreateTARequest; +import com.sap.ai.sdk.tabular.generated.orchestration.model.CreateTARequestCsnMetadata; +import com.sap.ai.sdk.tabular.generated.orchestration.model.DocumentDefinition; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetDataDestinations; +import com.sap.ai.sdk.tabular.generated.orchestration.model.GetScenarioConfigurations; +import com.sap.ai.sdk.tabular.generated.orchestration.model.HDLConnectionConfig; +import com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationCreateRequest; +import com.sap.ai.sdk.tabular.generated.orchestration.model.ScenarioConfigurationNameObject; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactConfig; +import com.sap.ai.sdk.tabular.generated.orchestration.model.TabularArtifactListResponse; +import com.sap.ai.sdk.tabular.generated.predict.client.PredictApi; +import com.sap.ai.sdk.tabular.generated.predict.model.ContextSelectionConfig; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictRequest; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictResponse; +import com.sap.ai.sdk.tabular.generated.predict.model.PredictionConfig; +import com.sap.ai.sdk.tabular.generated.predict.model.StrategyConfigs; +import com.sap.ai.sdk.tabular.generated.predict.model.TFMEnum; +import com.sap.ai.sdk.tabular.generated.predict.model.TargetColumn; +import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import lombok.val; +import org.springframework.stereotype.Service; + +/** + * Context Registry is a service for managing tabular data contexts for AI applications. It provides + * capabilities to register data destinations (object stores and data sharing platforms), create + * tabular artifacts from various file formats (CSV, Parquet, Delta), and configure scenarios for + * context selection in AI-driven business solutions. + */ +@Service +public class TabularService { + static final DataDestinationsApi DATA_DESTINATIONS_CLIENT = + new TabularClient().dataDestinations(); + static final TabularArtifactsApi TABULAR_ARTIFACTS_CLIENT = + new TabularClient().tabularArtifacts(); + static final ScenarioConfigurationManagerApi SCENARIO_CONFIG_CLIENT = + new TabularClient().scenarioConfiguration(); + static final PredictApi PREDICT_CLIENT = new TabularClient().predict(); + + /** The test resource group for all tabular operations. */ + public static final String resourceGroup = "ai-sdk-java-e2e"; + + /** The name of the data destination for the tabular artifact. */ + public static final String dataDestinationName = "ai-sdk-hdl-destination"; + + /** The name of the tabular artifact for product prediction. */ + public static final String artifactName = "product-artifact-lowercase"; + + /** The path to the Parquet file in the data destination for the tabular artifact. */ + public static final String artifactPath = "/data/product_data_hana_lowercase.parquet"; + + /** The name of the scenario configuration for product prediction. */ + public static final String scenarioConfigName = "product-prediction-scenario-lowercase"; + + /** + * Manage data destinations (S3 Bucket, Google Cloud Storage, Hana Data lake) for unified data + * source integration. + */ + public static class DataDestinationService { + + /** + * Get all data destinations for the default resource group. + * + * @return The list of data destinations. + */ + @Nonnull + public GetDataDestinations getAllDataDestinations() { + return DATA_DESTINATIONS_CLIENT.getAllDataDestinations(resourceGroup); + } + + /** + * Create a new data destination for Hana Data Lake. + * + * @param dataDestinationName The name of the data destination to create. + * @return The response of the data destination creation request. + */ + @Nonnull + public AsyncCreateDataDestinationResponse createHanaDataLakeDataDestination( + @Nonnull final String dataDestinationName) { + val request = + HDLDataDestinationCreateRequest.create() + .type(HDL) + .config( + HDLConnectionConfig.create() + .host( + "4d37b3ed-2663-4a2d-b04a-10dbe6577e02.files.hdl.prod-eu12.hanacloud.ondemand.com")) + .description("Hana Data lake data destination for AI Core SDK"); + return DATA_DESTINATIONS_CLIENT.createUpdateDataDestination( + resourceGroup, dataDestinationName, request); + } + + /** + * Delete the data destination for Hana Data Lake. + * + * @param dataDestinationName The name of the data destination to delete. + * @return The response of the data destination deletion request. + */ + @Nonnull + public OpenApiResponse deleteHanaDataLakeDataDestination( + @Nonnull final String dataDestinationName) { + return DATA_DESTINATIONS_CLIENT.deleteDataDestinationByName( + resourceGroup, dataDestinationName); + } + } + + /** Manage tabular artifacts for structured files from data-destinations. */ + public static class ArtifactService { + + /** + * Get all tabular artifacts for the default resource group. + * + * @return The list of tabular artifacts. + */ + @Nonnull + public TabularArtifactListResponse getAllArtifacts() { + return TABULAR_ARTIFACTS_CLIENT.getAllTabularArtifacts(resourceGroup); + } + + /** + * Create a new tabular artifact from a Parquet file in the specified data destination. + * + * @param artifactName The name of the tabular artifact to create. + * @return The response of the tabular artifact creation request. + */ + @Nonnull + public ControllersTabularArtifactV1EndpointsCreateTabularArtifact202Response createArtifact( + @Nonnull final String artifactName) { + val productEntityElements = + Map.of( + "product", Map.of("type", "cds.String"), + "price", Map.of("type", "cds.Double"), + "date", Map.of("type", "cds.String"), + "id", Map.of("type", "cds.String"), + "salesgroup", Map.of("type", "cds.String")); + val definitions = + Map.of( + "definitions", + Map.of("ProductEntity", Map.of("kind", "entity", "elements", productEntityElements))); + val request = + CreateTARequest.create() + .dataDestinationName(dataDestinationName) + .type(PARQUET) + .path(artifactPath) + .csnMetadata( + CreateTARequestCsnMetadata.create() + .definition( + DocumentDefinition.create() + .definitionType(DOCUMENT) + .document(definitions)) + .entityName("ProductEntity") + .selectedColumns(productEntityElements.keySet())); + return TABULAR_ARTIFACTS_CLIENT.createTabularArtifact(resourceGroup, artifactName, request); + } + + /** + * Delete the tabular artifact. + * + * @param artifactName The name of the tabular artifact to delete. + * @return The response of the tabular artifact deletion request. + */ + @Nonnull + public OpenApiResponse deleteArtifact(@Nonnull final String artifactName) { + return TABULAR_ARTIFACTS_CLIENT.deleteTabularArtifact(resourceGroup, artifactName); + } + } + + /** Manage scenario configurations for context selection. */ + public static class ScenarioConfigurationService { + + /** + * Get all scenario configurations for the default resource group. + * + * @return The list of scenario configurations. + */ + @Nonnull + public GetScenarioConfigurations getAllScenarioConfigurations() { + return SCENARIO_CONFIG_CLIENT.getAllScenarioConfigurations(resourceGroup); + } + + /** + * Create a new scenario configuration for product prediction using the specified tabular + * artifact. + * + * @param scenarioConfigName The name of the scenario configuration to create. + * @return The response of the scenario configuration creation request. + */ + @Nonnull + public ScenarioConfigurationNameObject createScenarioConfiguration( + @Nonnull final String scenarioConfigName) { + val request = + CreateScenarioConfiguration.create() + .tabularArtifacts(TabularArtifactConfig.create().name(artifactName)) + .description("Sample scenario configuration for product prediction") + .contextSelectionStrategy(ContextSelectionStrategy.RANDOM); + return SCENARIO_CONFIG_CLIENT.createScenarioConfiguration( + resourceGroup, scenarioConfigName, request); + } + + /** + * Delete the scenario configuration. + * + * @param scenarioConfigName The name of the scenario configuration to delete. + * @return The response of the scenario configuration deletion request. + */ + @Nonnull + public OpenApiResponse deleteScenarioConfiguration(@Nonnull final String scenarioConfigName) { + return SCENARIO_CONFIG_CLIENT.deleteScenarioConfigurationByName( + resourceGroup, scenarioConfigName); + } + } + + /** Make predictions for tabular data using a deployed Tabular Foundation Model. */ + public static class PredictionService { + + /** + * Run a prediction using a running tabular-orchestration deployment. + * + * @return The prediction response. + */ + @Nonnull + public PredictResponse predict() { + val request = + PredictRequest.create() + .modelName(TFMEnum._1_5) + .scenarioConfigName(scenarioConfigName) + .predictionConfig( + PredictionConfig.create() + .targetColumns( + TargetColumn.create().name("salesgroup").taskType(CLASSIFICATION))) + .contextSelectionConfig( + ContextSelectionConfig.create() + .numRows(3) + .strategy(RANDOM) + .strategyConfigs( + StrategyConfigs.create().indexColumn("id").deterministic(true))) + .rows( + List.of( + Map.of( + "product", "Desktop Computer", + "price", 921.5, + "date", "2024-12-02", + "id", "42", + "salesgroup", "[PREDICT]"), + Map.of( + "product", "Macbook", + "price", 1220.99, + "date", "2026-01-31", + "id", "99", + "salesgroup", "[PREDICT]"), + Map.of( + "product", "Office Desk", + "price", 750.5, + "date", "2024-12-05", + "id", "689", + "salesgroup", "[PREDICT]"))) + .modelConfig(Map.of()); + return PREDICT_CLIENT.predict(request); + } + } +} 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 e1e45b008..7c00eee38 100644 --- a/sample-code/spring-app/src/main/resources/static/index.html +++ b/sample-code/spring-app/src/main/resources/static/index.html @@ -1689,6 +1689,117 @@
Speech to speech
+ + +
+
+
+
+

🗄️ Tabular Orchestration

+
+ Context Registry is a service for managing tabular data contexts for AI + applications. +
It provides capabilities to register data destinations (object + stores and data sharing platforms), create tabular artifacts from various + file formats (CSV, Parquet, Delta), and configure scenarios for context + selection in AI-driven business solutions. + For more information, check the Context Registry GitHub Repository +
+
+
    +
  • +
    + +
    + List all data destinations (e.g. Hana Data Lake, S3, + Google Cloud Storage) for the default resource group. +
    +
    +
  • +
  • +
    + +
    + Create a new Hana Data Lake data destination. +
    +
    +
  • +
  • +
    + +
    + List all tabular artifacts for the default resource + group. +
    +
    +
  • +
  • +
    + +
    + Create a new tabular artifact from a Parquet file in a + registered data destination. +
    +
    +
  • +
  • +
    + +
    + List all scenario configurations for the default + resource group. +
    +
    +
  • +
  • +
    + +
    + Create a new scenario configuration for product + prediction using a tabular artifact. +
    +
    +
  • +
  • +
    + +
    + Run a prediction using a deployed Tabular Foundation + Model and a scenario configuration. +
    +
    +
  • +
+
+
+
diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/TabularTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/TabularTest.java new file mode 100644 index 000000000..505e69fde --- /dev/null +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/TabularTest.java @@ -0,0 +1,134 @@ +package com.sap.ai.sdk.app.controllers; + +import static com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationGetResponse.TypeEnum.HDL; +import static org.assertj.core.api.Assertions.assertThat; + +import com.sap.ai.sdk.app.services.TabularService.ArtifactService; +import com.sap.ai.sdk.app.services.TabularService.DataDestinationService; +import com.sap.ai.sdk.app.services.TabularService.PredictionService; +import com.sap.ai.sdk.app.services.TabularService.ScenarioConfigurationService; +import com.sap.ai.sdk.tabular.generated.orchestration.model.HDLDataDestinationGetResponse; +import lombok.extern.slf4j.Slf4j; +import lombok.val; +import org.junit.jupiter.api.Test; + +@Slf4j +class TabularTest { + + DataDestinationService dataDestinationService = new DataDestinationService(); + ArtifactService artifactService = new ArtifactService(); + ScenarioConfigurationService scenarioConfigurationService = new ScenarioConfigurationService(); + PredictionService predictionService = new PredictionService(); + + private static final int ACCEPTED = 202; + private static final int NO_CONTENT = 204; + + @Test + void testGetAllDataDestinations() { + val response = dataDestinationService.getAllDataDestinations(); + assertThat(response.getResources()).isNotEmpty(); + } + + @Test + void testCreateDeleteDataDestinations() { + cleanupDataDestinations(); + + val dataDestinationName = "data-destination-e2e-test-java-" + System.currentTimeMillis(); + val createResponse = + dataDestinationService.createHanaDataLakeDataDestination(dataDestinationName); + assertThat(createResponse.getName()).isEqualTo(dataDestinationName); + + val getAllResponse = dataDestinationService.getAllDataDestinations(); + assertThat(getAllResponse.getResources()).isNotEmpty(); + val dataDestination = getAllResponse.getResources().get(0); + assertThat(dataDestination.getType()).isEqualTo(HDL); + val hanaDataLakeDataDestination = (HDLDataDestinationGetResponse) dataDestination; + assertThat(hanaDataLakeDataDestination.getName()).isEqualTo(dataDestinationName); + } + + private void cleanupDataDestinations() { + for (val resource : dataDestinationService.getAllDataDestinations().getResources()) { + if (resource.getType() == HDL + && resource instanceof HDLDataDestinationGetResponse oldDataDestination + && oldDataDestination.getName().startsWith("data-destination-e2e-test-java")) { + val name = oldDataDestination.getName(); + + log.info("Deleting old data destination with name: {}", name); + val deleteResponse = dataDestinationService.deleteHanaDataLakeDataDestination(name); + assertThat(deleteResponse.getStatusCode()).isEqualTo(ACCEPTED); + } + } + } + + @Test + void testGetAllArtifacts() { + val response = artifactService.getAllArtifacts(); + assertThat(response.getResources()).isNotEmpty(); + } + + @Test + void testCreateDeleteArtifact() { + cleanupArtifacts(); + + val artifactName = "artifact-e2e-test-java-" + System.currentTimeMillis(); + val createResponse = artifactService.createArtifact(artifactName); + assertThat(createResponse.getName()).isEqualTo(artifactName); + + val getAllResponse = artifactService.getAllArtifacts(); + assertThat(getAllResponse.getResources()).isNotEmpty(); + val artifact = getAllResponse.getResources().get(0); + assertThat(artifact.getName()).isEqualTo(artifactName); + } + + private void cleanupArtifacts() { + for (val artifact : artifactService.getAllArtifacts().getResources()) { + if (artifact.getName().startsWith("artifact-e2e-test-java")) { + val name = artifact.getName(); + + log.info("Deleting old artifact with name: {}", name); + val deleteResponse = artifactService.deleteArtifact(name); + assertThat(deleteResponse.getStatusCode()).isEqualTo(ACCEPTED); + } + } + } + + @Test + void testGetAllScenarioConfigurations() { + val response = scenarioConfigurationService.getAllScenarioConfigurations(); + assertThat(response.getResources()).isNotEmpty(); + } + + @Test + void testCreateDeleteScenario() { + cleanupScenarioConfigurations(); + + val scenarioConfigName = "scenario-e2e-test-java-" + System.currentTimeMillis(); + val createResponse = + scenarioConfigurationService.createScenarioConfiguration(scenarioConfigName); + assertThat(createResponse.getName()).isEqualTo(scenarioConfigName); + + val getAllResponse = scenarioConfigurationService.getAllScenarioConfigurations(); + assertThat(getAllResponse.getResources()).isNotEmpty(); + val scenarioConfiguration = getAllResponse.getResources().get(0); + assertThat(scenarioConfiguration.getName()).isEqualTo(scenarioConfigName); + } + + private void cleanupScenarioConfigurations() { + for (val scenarioConfiguration : + scenarioConfigurationService.getAllScenarioConfigurations().getResources()) { + if (scenarioConfiguration.getName().startsWith("scenario-e2e-test-java")) { + val name = scenarioConfiguration.getName(); + + log.info("Deleting old scenario configuration with name: {}", name); + val deleteResponse = scenarioConfigurationService.deleteScenarioConfiguration(name); + assertThat(deleteResponse.getStatusCode()).isEqualTo(NO_CONTENT); + } + } + } + + @Test + void testPredict() { + val response = predictionService.predict(); + assertThat(response.getPredictions()).isNotEmpty(); + } +}