From 7aed42dcc96dc543cdf56870a1a95f3ad6d883f8 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 16 Dec 2025 15:36:16 +0100 Subject: [PATCH 01/25] regenerate with prompt-registry.yaml --- .../openapi/openapi-api-apache-sample/pom.xml | 2 +- .../openapi/apache/sample/api/OrdersApi.java | 162 -- .../openapi/apache/sample/api/SodasApi.java | 395 ---- .../openapi/apache/sample/model/AllOf.java | 413 ---- .../openapi/apache/sample/model/AnyOf.java | 413 ---- .../openapi/apache/sample/model/Bar.java | 309 --- .../openapi/apache/sample/model/Cola.java | 327 --- .../apache/sample/model/ColaBarCode.java | 69 - .../openapi/apache/sample/model/ColaLogo.java | 68 - .../openapi/apache/sample/model/Fanta.java | 284 --- .../apache/sample/model/FantaFlavor.java | 108 - .../apache/sample/model/FlavorType.java | 241 -- .../openapi/apache/sample/model/Foo.java | 309 --- .../openapi/apache/sample/model/OneOf.java | 31 - .../sample/model/OneOfWithDiscriminator.java | 34 - .../OneOfWithDiscriminatorAndMapping.java | 34 - .../model/OneOfWithEnumDiscriminator.java | 34 - .../openapi/apache/sample/model/Order.java | 370 --- .../sample/model/OrderWithTimestamp.java | 415 ---- .../openapi/apache/sample/model/Soda.java | 448 ---- .../apache/sample/model/SodaWithId.java | 491 ---- .../src/main/resources/prompt-registry.yaml | 2026 +++++++++++++++++ 22 files changed, 2027 insertions(+), 4956 deletions(-) delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml diff --git a/datamodel/openapi/openapi-api-apache-sample/pom.xml b/datamodel/openapi/openapi-api-apache-sample/pom.xml index 0872d59c6..588f6cbc5 100644 --- a/datamodel/openapi/openapi-api-apache-sample/pom.xml +++ b/datamodel/openapi/openapi-api-apache-sample/pom.xml @@ -53,7 +53,7 @@ generate-sources - ${project.basedir}/src/main/resources/sodastore.yaml + ${project.basedir}/src/main/resources/prompt-registry.yaml com.sap.cloud.sdk.datamodel.openapi.apache.sample.api com.sap.cloud.sdk.datamodel.openapi.apache.sample.model diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java deleted file mode 100644 index a68fbf053..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.api; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Order; -import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.ApiException; -import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Configuration; -import com.sap.cloud.sdk.services.openapi.apache.Pair; - -public class OrdersApi extends BaseApi -{ - - public OrdersApi() - { - super(Configuration.getDefaultApiClient()); - } - - public OrdersApi( ApiClient apiClient ) - { - super(apiClient); - } - - /** - * Create a new order - * - * @param order - * The order details (required) - * @return Order - * @throws ApiException - * if fails to make API call - */ - public Order ordersPost( @javax.annotation.Nonnull Order order ) - throws ApiException - { - return this.ordersPost(order, Collections.emptyMap()); - } - - /** - * Create a new order - * - * @param order - * The order details (required) - * @param additionalHeaders - * additionalHeaders for this call - * @return Order - * @throws ApiException - * if fails to make API call - */ - public Order ordersPost( @javax.annotation.Nonnull Order order, Map additionalHeaders ) - throws ApiException - { - Object localVarPostBody = order; - - // verify the required parameter 'order' is set - if( order == null ) { - throw new ApiException(400, "Missing the required parameter 'order' when calling ordersPost"); - } - - // create path and map variables - String localVarPath = "/orders"; - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth" }; - - TypeReference localVarReturnType = new TypeReference() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - @Override - public T invokeAPI( - String url, - String method, - Object request, - TypeReference returnType, - Map additionalHeaders ) - throws ApiException - { - String localVarPath = url.replace(apiClient.getBaseURL(), ""); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth" }; - - return apiClient - .invokeAPI( - localVarPath, - method, - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - request, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - returnType); - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java deleted file mode 100644 index 9a5265ac2..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.api; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Soda; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.SodaWithId; -import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.ApiException; -import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Configuration; -import com.sap.cloud.sdk.services.openapi.apache.Pair; - -public class SodasApi extends BaseApi -{ - - public SodasApi() - { - super(Configuration.getDefaultApiClient()); - } - - public SodasApi( ApiClient apiClient ) - { - super(apiClient); - } - - /** - * Download soda product data as binary - * - * @param id - * ID of the soda product to download (required) - * @return File - * @throws ApiException - * if fails to make API call - */ - public File sodasDownloadIdGet( @javax.annotation.Nonnull Long id ) - throws ApiException - { - return this.sodasDownloadIdGet(id, Collections.emptyMap()); - } - - /** - * Download soda product data as binary - * - * @param id - * ID of the soda product to download (required) - * @param additionalHeaders - * additionalHeaders for this call - * @return File - * @throws ApiException - * if fails to make API call - */ - public File sodasDownloadIdGet( @javax.annotation.Nonnull Long id, Map additionalHeaders ) - throws ApiException - { - Object localVarPostBody = null; - - // verify the required parameter 'id' is set - if( id == null ) { - throw new ApiException(400, "Missing the required parameter 'id' when calling sodasDownloadIdGet"); - } - - // create path and map variables - String localVarPath = - "/sodas/download/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(apiClient.parameterToString(id))); - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/octet-stream" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth", "bearerAuth" }; - - TypeReference localVarReturnType = new TypeReference() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get all soda products - * - * @return List<SodaWithId> - * @throws ApiException - * if fails to make API call - */ - public List sodasGet() - throws ApiException - { - return this.sodasGet(Collections.emptyMap()); - } - - /** - * Get all soda products - * - * @param additionalHeaders - * additionalHeaders for this call - * @return List<SodaWithId> - * @throws ApiException - * if fails to make API call - */ - public List sodasGet( Map additionalHeaders ) - throws ApiException - { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sodas"; - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth" }; - - TypeReference> localVarReturnType = new TypeReference>() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Get a specific soda product by ID - * - * @param id - * ID of the soda product to retrieve (required) - * @return SodaWithId - * @throws ApiException - * if fails to make API call - */ - public SodaWithId sodasIdGet( @javax.annotation.Nonnull Long id ) - throws ApiException - { - return this.sodasIdGet(id, Collections.emptyMap()); - } - - /** - * Get a specific soda product by ID - * - * @param id - * ID of the soda product to retrieve (required) - * @param additionalHeaders - * additionalHeaders for this call - * @return SodaWithId - * @throws ApiException - * if fails to make API call - */ - public SodaWithId sodasIdGet( @javax.annotation.Nonnull Long id, Map additionalHeaders ) - throws ApiException - { - Object localVarPostBody = null; - - // verify the required parameter 'id' is set - if( id == null ) { - throw new ApiException(400, "Missing the required parameter 'id' when calling sodasIdGet"); - } - - // create path and map variables - String localVarPath = - "/sodas/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(apiClient.parameterToString(id))); - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth" }; - - TypeReference localVarReturnType = new TypeReference() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - /** - * Update a specific soda product by ID - * - * @param sodaWithId - * The updated soda product (required) - * @return Soda - * @throws ApiException - * if fails to make API call - */ - public Soda sodasPut( @javax.annotation.Nonnull SodaWithId sodaWithId ) - throws ApiException - { - return this.sodasPut(sodaWithId, Collections.emptyMap()); - } - - /** - * Update a specific soda product by ID - * - * @param sodaWithId - * The updated soda product (required) - * @param additionalHeaders - * additionalHeaders for this call - * @return Soda - * @throws ApiException - * if fails to make API call - */ - public Soda sodasPut( @javax.annotation.Nonnull SodaWithId sodaWithId, Map additionalHeaders ) - throws ApiException - { - Object localVarPostBody = sodaWithId; - - // verify the required parameter 'sodaWithId' is set - if( sodaWithId == null ) { - throw new ApiException(400, "Missing the required parameter 'sodaWithId' when calling sodasPut"); - } - - // create path and map variables - String localVarPath = "/sodas"; - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth" }; - - TypeReference localVarReturnType = new TypeReference() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "PUT", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - - @Override - public T invokeAPI( - String url, - String method, - Object request, - TypeReference returnType, - Map additionalHeaders ) - throws ApiException - { - String localVarPath = url.replace(apiClient.getBaseURL(), ""); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "apiKeyAuth" }; - - return apiClient - .invokeAPI( - localVarPath, - method, - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - request, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - returnType); - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java deleted file mode 100644 index d6462cc87..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * AllOf - */ - -@Beta // CHECKSTYLE:OFF -public class AllOf -// CHECKSTYLE:ON -{ - @JsonProperty( "sodaType" ) - private String sodaType; - - @JsonProperty( "caffeine" ) - private Boolean caffeine; - - @JsonProperty( "logo" ) - private ColaLogo logo; - - @JsonProperty( "barCode" ) - private ColaBarCode barCode; - - @JsonProperty( "color" ) - private String color; - - @JsonProperty( "flavor" ) - private FantaFlavor flavor; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AllOf. - */ - protected AllOf() - { - } - - /** - * Set the sodaType of this {@link AllOf} instance and return the same instance. - * - * @param sodaType - * The sodaType of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf sodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link AllOf} instance. - */ - @Nonnull - public String getSodaType() - { - return sodaType; - } - - /** - * Set the sodaType of this {@link AllOf} instance. - * - * @param sodaType - * The sodaType of this {@link AllOf} - */ - public void setSodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - } - - /** - * Set the caffeine of this {@link AllOf} instance and return the same instance. - * - * @param caffeine - * The caffeine of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf caffeine( @Nullable final Boolean caffeine ) - { - this.caffeine = caffeine; - return this; - } - - /** - * Get caffeine - * - * @return caffeine The caffeine of this {@link AllOf} instance. - */ - @Nonnull - public Boolean isCaffeine() - { - return caffeine; - } - - /** - * Set the caffeine of this {@link AllOf} instance. - * - * @param caffeine - * The caffeine of this {@link AllOf} - */ - public void setCaffeine( @Nullable final Boolean caffeine ) - { - this.caffeine = caffeine; - } - - /** - * Set the logo of this {@link AllOf} instance and return the same instance. - * - * @param logo - * The logo of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf logo( @Nullable final ColaLogo logo ) - { - this.logo = logo; - return this; - } - - /** - * Get logo - * - * @return logo The logo of this {@link AllOf} instance. - */ - @Nonnull - public ColaLogo getLogo() - { - return logo; - } - - /** - * Set the logo of this {@link AllOf} instance. - * - * @param logo - * The logo of this {@link AllOf} - */ - public void setLogo( @Nullable final ColaLogo logo ) - { - this.logo = logo; - } - - /** - * Set the barCode of this {@link AllOf} instance and return the same instance. - * - * @param barCode - * The barCode of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf barCode( @Nullable final ColaBarCode barCode ) - { - this.barCode = barCode; - return this; - } - - /** - * Get barCode - * - * @return barCode The barCode of this {@link AllOf} instance. - */ - @Nonnull - public ColaBarCode getBarCode() - { - return barCode; - } - - /** - * Set the barCode of this {@link AllOf} instance. - * - * @param barCode - * The barCode of this {@link AllOf} - */ - public void setBarCode( @Nullable final ColaBarCode barCode ) - { - this.barCode = barCode; - } - - /** - * Set the color of this {@link AllOf} instance and return the same instance. - * - * @param color - * The color of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf color( @Nullable final String color ) - { - this.color = color; - return this; - } - - /** - * Get color - * - * @return color The color of this {@link AllOf} instance. - */ - @Nonnull - public String getColor() - { - return color; - } - - /** - * Set the color of this {@link AllOf} instance. - * - * @param color - * The color of this {@link AllOf} - */ - public void setColor( @Nullable final String color ) - { - this.color = color; - } - - /** - * Set the flavor of this {@link AllOf} instance and return the same instance. - * - * @param flavor - * The flavor of this {@link AllOf} - * @return The same instance of this {@link AllOf} class - */ - @Nonnull - public AllOf flavor( @Nullable final FantaFlavor flavor ) - { - this.flavor = flavor; - return this; - } - - /** - * Get flavor - * - * @return flavor The flavor of this {@link AllOf} instance. - */ - @Nonnull - public FantaFlavor getFlavor() - { - return flavor; - } - - /** - * Set the flavor of this {@link AllOf} instance. - * - * @param flavor - * The flavor of this {@link AllOf} - */ - public void setFlavor( @Nullable final FantaFlavor flavor ) - { - this.flavor = flavor; - } - - /** - * Get the names of the unrecognizable properties of the {@link AllOf}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AllOf} instance. - * - * @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("AllOf has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AllOf} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( sodaType != null ) - declaredFields.put("sodaType", sodaType); - if( caffeine != null ) - declaredFields.put("caffeine", caffeine); - if( logo != null ) - declaredFields.put("logo", logo); - if( barCode != null ) - declaredFields.put("barCode", barCode); - if( color != null ) - declaredFields.put("color", color); - if( flavor != null ) - declaredFields.put("flavor", flavor); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained a mapping for the - * key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final AllOf allOf = (AllOf) o; - return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) - && Objects.equals(this.sodaType, allOf.sodaType) - && Objects.equals(this.caffeine, allOf.caffeine) - && Objects.equals(this.logo, allOf.logo) - && Objects.equals(this.barCode, allOf.barCode) - && Objects.equals(this.color, allOf.color) - && Objects.equals(this.flavor, allOf.flavor); - } - - @Override - public int hashCode() - { - return Objects.hash(sodaType, caffeine, logo, barCode, color, flavor, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AllOf {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); - sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); - sb.append(" barCode: ").append(toIndentedString(barCode)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" flavor: ").append(toIndentedString(flavor)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java deleted file mode 100644 index 97f8d677f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * AnyOf - */ - -@Beta // CHECKSTYLE:OFF -public class AnyOf -// CHECKSTYLE:ON -{ - @JsonProperty( "sodaType" ) - private String sodaType; - - @JsonProperty( "caffeine" ) - private Boolean caffeine; - - @JsonProperty( "logo" ) - private ColaLogo logo; - - @JsonProperty( "barCode" ) - private ColaBarCode barCode; - - @JsonProperty( "color" ) - private String color; - - @JsonProperty( "flavor" ) - private FantaFlavor flavor; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AnyOf. - */ - protected AnyOf() - { - } - - /** - * Set the sodaType of this {@link AnyOf} instance and return the same instance. - * - * @param sodaType - * The sodaType of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf sodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link AnyOf} instance. - */ - @Nonnull - public String getSodaType() - { - return sodaType; - } - - /** - * Set the sodaType of this {@link AnyOf} instance. - * - * @param sodaType - * The sodaType of this {@link AnyOf} - */ - public void setSodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - } - - /** - * Set the caffeine of this {@link AnyOf} instance and return the same instance. - * - * @param caffeine - * The caffeine of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf caffeine( @Nullable final Boolean caffeine ) - { - this.caffeine = caffeine; - return this; - } - - /** - * Get caffeine - * - * @return caffeine The caffeine of this {@link AnyOf} instance. - */ - @Nonnull - public Boolean isCaffeine() - { - return caffeine; - } - - /** - * Set the caffeine of this {@link AnyOf} instance. - * - * @param caffeine - * The caffeine of this {@link AnyOf} - */ - public void setCaffeine( @Nullable final Boolean caffeine ) - { - this.caffeine = caffeine; - } - - /** - * Set the logo of this {@link AnyOf} instance and return the same instance. - * - * @param logo - * The logo of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf logo( @Nullable final ColaLogo logo ) - { - this.logo = logo; - return this; - } - - /** - * Get logo - * - * @return logo The logo of this {@link AnyOf} instance. - */ - @Nonnull - public ColaLogo getLogo() - { - return logo; - } - - /** - * Set the logo of this {@link AnyOf} instance. - * - * @param logo - * The logo of this {@link AnyOf} - */ - public void setLogo( @Nullable final ColaLogo logo ) - { - this.logo = logo; - } - - /** - * Set the barCode of this {@link AnyOf} instance and return the same instance. - * - * @param barCode - * The barCode of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf barCode( @Nullable final ColaBarCode barCode ) - { - this.barCode = barCode; - return this; - } - - /** - * Get barCode - * - * @return barCode The barCode of this {@link AnyOf} instance. - */ - @Nonnull - public ColaBarCode getBarCode() - { - return barCode; - } - - /** - * Set the barCode of this {@link AnyOf} instance. - * - * @param barCode - * The barCode of this {@link AnyOf} - */ - public void setBarCode( @Nullable final ColaBarCode barCode ) - { - this.barCode = barCode; - } - - /** - * Set the color of this {@link AnyOf} instance and return the same instance. - * - * @param color - * The color of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf color( @Nullable final String color ) - { - this.color = color; - return this; - } - - /** - * Get color - * - * @return color The color of this {@link AnyOf} instance. - */ - @Nonnull - public String getColor() - { - return color; - } - - /** - * Set the color of this {@link AnyOf} instance. - * - * @param color - * The color of this {@link AnyOf} - */ - public void setColor( @Nullable final String color ) - { - this.color = color; - } - - /** - * Set the flavor of this {@link AnyOf} instance and return the same instance. - * - * @param flavor - * The flavor of this {@link AnyOf} - * @return The same instance of this {@link AnyOf} class - */ - @Nonnull - public AnyOf flavor( @Nullable final FantaFlavor flavor ) - { - this.flavor = flavor; - return this; - } - - /** - * Get flavor - * - * @return flavor The flavor of this {@link AnyOf} instance. - */ - @Nonnull - public FantaFlavor getFlavor() - { - return flavor; - } - - /** - * Set the flavor of this {@link AnyOf} instance. - * - * @param flavor - * The flavor of this {@link AnyOf} - */ - public void setFlavor( @Nullable final FantaFlavor flavor ) - { - this.flavor = flavor; - } - - /** - * Get the names of the unrecognizable properties of the {@link AnyOf}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AnyOf} instance. - * - * @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("AnyOf has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AnyOf} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( sodaType != null ) - declaredFields.put("sodaType", sodaType); - if( caffeine != null ) - declaredFields.put("caffeine", caffeine); - if( logo != null ) - declaredFields.put("logo", logo); - if( barCode != null ) - declaredFields.put("barCode", barCode); - if( color != null ) - declaredFields.put("color", color); - if( flavor != null ) - declaredFields.put("flavor", flavor); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained a mapping for the - * key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final AnyOf anyOf = (AnyOf) o; - return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) - && Objects.equals(this.sodaType, anyOf.sodaType) - && Objects.equals(this.caffeine, anyOf.caffeine) - && Objects.equals(this.logo, anyOf.logo) - && Objects.equals(this.barCode, anyOf.barCode) - && Objects.equals(this.color, anyOf.color) - && Objects.equals(this.flavor, anyOf.flavor); - } - - @Override - public int hashCode() - { - return Objects.hash(sodaType, caffeine, logo, barCode, color, flavor, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AnyOf {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); - sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); - sb.append(" barCode: ").append(toIndentedString(barCode)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" flavor: ").append(toIndentedString(flavor)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java deleted file mode 100644 index 55111820b..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Bar - */ - -@Beta // CHECKSTYLE:OFF -public class Bar implements OneOfWithEnumDiscriminator -// CHECKSTYLE:ON -{ - @JsonProperty( "bar" ) - private String bar; - - /** - * Gets or Sets disc - */ - public enum DiscEnum - { - /** - * The DISC_BAR option of this Bar - */ - DISC_BAR("disc_bar"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this Bar - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - DiscEnum( 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 Bar - */ - @JsonCreator - @Nonnull - public static DiscEnum fromValue( @Nonnull final String value ) - { - for( DiscEnum b : DiscEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "disc" ) - private DiscEnum disc; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Bar. - */ - protected Bar() - { - } - - /** - * Set the bar of this {@link Bar} instance and return the same instance. - * - * @param bar - * The bar of this {@link Bar} - * @return The same instance of this {@link Bar} class - */ - @Nonnull - public Bar bar( @Nullable final String bar ) - { - this.bar = bar; - return this; - } - - /** - * Get bar - * - * @return bar The bar of this {@link Bar} instance. - */ - @Nonnull - public String getBar() - { - return bar; - } - - /** - * Set the bar of this {@link Bar} instance. - * - * @param bar - * The bar of this {@link Bar} - */ - public void setBar( @Nullable final String bar ) - { - this.bar = bar; - } - - /** - * Set the disc of this {@link Bar} instance and return the same instance. - * - * @param disc - * The disc of this {@link Bar} - * @return The same instance of this {@link Bar} class - */ - @Nonnull - public Bar disc( @Nullable final DiscEnum disc ) - { - this.disc = disc; - return this; - } - - /** - * Get disc - * - * @return disc The disc of this {@link Bar} instance. - */ - @Nonnull - public DiscEnum getDisc() - { - return disc; - } - - /** - * Set the disc of this {@link Bar} instance. - * - * @param disc - * The disc of this {@link Bar} - */ - public void setDisc( @Nullable final DiscEnum disc ) - { - this.disc = disc; - } - - /** - * Get the names of the unrecognizable properties of the {@link Bar}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Bar} 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("Bar has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Bar} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( bar != null ) - declaredFields.put("bar", bar); - if( disc != null ) - declaredFields.put("disc", disc); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Bar} 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 Bar bar = (Bar) o; - return Objects.equals(this.cloudSdkCustomFields, bar.cloudSdkCustomFields) - && Objects.equals(this.bar, bar.bar) - && Objects.equals(this.disc, bar.disc); - } - - @Override - public int hashCode() - { - return Objects.hash(bar, disc, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Bar {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" disc: ").append(toIndentedString(disc)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java deleted file mode 100644 index 7d5bb90be..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Cola - */ - -@Beta // CHECKSTYLE:OFF -public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping -// CHECKSTYLE:ON -{ - @JsonProperty( "sodaType" ) - private String sodaType; - - @JsonProperty( "caffeine" ) - private Boolean caffeine; - - @JsonProperty( "logo" ) - private ColaLogo logo; - - @JsonProperty( "barCode" ) - private ColaBarCode barCode; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Cola. - */ - protected Cola() - { - } - - /** - * Set the sodaType of this {@link Cola} instance and return the same instance. - * - * @param sodaType - * The sodaType of this {@link Cola} - * @return The same instance of this {@link Cola} class - */ - @Nonnull - public Cola sodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link Cola} instance. - */ - @Nonnull - public String getSodaType() - { - return sodaType; - } - - /** - * Set the sodaType of this {@link Cola} instance. - * - * @param sodaType - * The sodaType of this {@link Cola} - */ - public void setSodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - } - - /** - * Set the caffeine of this {@link Cola} instance and return the same instance. - * - * @param caffeine - * The caffeine of this {@link Cola} - * @return The same instance of this {@link Cola} class - */ - @Nonnull - public Cola caffeine( @Nullable final Boolean caffeine ) - { - this.caffeine = caffeine; - return this; - } - - /** - * Get caffeine - * - * @return caffeine The caffeine of this {@link Cola} instance. - */ - @Nonnull - public Boolean isCaffeine() - { - return caffeine; - } - - /** - * Set the caffeine of this {@link Cola} instance. - * - * @param caffeine - * The caffeine of this {@link Cola} - */ - public void setCaffeine( @Nullable final Boolean caffeine ) - { - this.caffeine = caffeine; - } - - /** - * Set the logo of this {@link Cola} instance and return the same instance. - * - * @param logo - * The logo of this {@link Cola} - * @return The same instance of this {@link Cola} class - */ - @Nonnull - public Cola logo( @Nullable final ColaLogo logo ) - { - this.logo = logo; - return this; - } - - /** - * Get logo - * - * @return logo The logo of this {@link Cola} instance. - */ - @Nonnull - public ColaLogo getLogo() - { - return logo; - } - - /** - * Set the logo of this {@link Cola} instance. - * - * @param logo - * The logo of this {@link Cola} - */ - public void setLogo( @Nullable final ColaLogo logo ) - { - this.logo = logo; - } - - /** - * Set the barCode of this {@link Cola} instance and return the same instance. - * - * @param barCode - * The barCode of this {@link Cola} - * @return The same instance of this {@link Cola} class - */ - @Nonnull - public Cola barCode( @Nullable final ColaBarCode barCode ) - { - this.barCode = barCode; - return this; - } - - /** - * Get barCode - * - * @return barCode The barCode of this {@link Cola} instance. - */ - @Nonnull - public ColaBarCode getBarCode() - { - return barCode; - } - - /** - * Set the barCode of this {@link Cola} instance. - * - * @param barCode - * The barCode of this {@link Cola} - */ - public void setBarCode( @Nullable final ColaBarCode barCode ) - { - this.barCode = barCode; - } - - /** - * Get the names of the unrecognizable properties of the {@link Cola}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Cola} instance. - * - * @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("Cola has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Cola} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( sodaType != null ) - declaredFields.put("sodaType", sodaType); - if( caffeine != null ) - declaredFields.put("caffeine", caffeine); - if( logo != null ) - declaredFields.put("logo", logo); - if( barCode != null ) - declaredFields.put("barCode", barCode); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a mapping for the - * key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final Cola cola = (Cola) o; - return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) - && Objects.equals(this.sodaType, cola.sodaType) - && Objects.equals(this.caffeine, cola.caffeine) - && Objects.equals(this.logo, cola.logo) - && Objects.equals(this.barCode, cola.barCode); - } - - @Override - public int hashCode() - { - return Objects.hash(sodaType, caffeine, logo, barCode, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Cola {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); - sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); - sb.append(" barCode: ").append(toIndentedString(barCode)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java deleted file mode 100644 index 6ca5fa9dc..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Nonnull; - -import com.google.common.annotations.Beta; - -/** - * ColaBarCode - */ -@Beta -public interface ColaBarCode -{ - /** - * Helper class to create {@code List } that implements {@link ColaBarCode}. - */ - record ListOfBigDecimals(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ColaBarCode {} - - /** - * Creator to enable deserialization of {@code List }. - * - * @param val - * the value to use - * @return a new instance of {@link ListOfBigDecimals}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static ListOfBigDecimals createListOfBigDecimals( @Nonnull final List val ) - { - return new ListOfBigDecimals(val); - } - - /** - * Helper class to create {@code String } that implements {@link ColaBarCode}. - */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ColaBarCode {} - - /** - * 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); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java deleted file mode 100644 index 84624d0e3..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.List; - -import javax.annotation.Nonnull; - -import com.google.common.annotations.Beta; - -/** - * ColaLogo - */ -@Beta -public interface ColaLogo -{ - /** - * Helper class to create {@code List> } that implements {@link ColaLogo}. - */ - record ListOfListOfIntegers(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List> values) implements ColaLogo {} - - /** - * Creator to enable deserialization of {@code List> }. - * - * @param val - * the value to use - * @return a new instance of {@link ListOfListOfIntegers}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static ListOfListOfIntegers createListOfListOfIntegers( @Nonnull final List> val ) - { - return new ListOfListOfIntegers(val); - } - - /** - * Helper class to create {@code String } that implements {@link ColaLogo}. - */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ColaLogo {} - - /** - * 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); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java deleted file mode 100644 index 0215af3cb..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Fanta - */ - -@Beta // CHECKSTYLE:OFF -public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping -// CHECKSTYLE:ON -{ - @JsonProperty( "sodaType" ) - private String sodaType; - - @JsonProperty( "color" ) - private String color; - - @JsonProperty( "flavor" ) - private FantaFlavor flavor; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Fanta. - */ - protected Fanta() - { - } - - /** - * Set the sodaType of this {@link Fanta} instance and return the same instance. - * - * @param sodaType - * The sodaType of this {@link Fanta} - * @return The same instance of this {@link Fanta} class - */ - @Nonnull - public Fanta sodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - return this; - } - - /** - * Get sodaType - * - * @return sodaType The sodaType of this {@link Fanta} instance. - */ - @Nonnull - public String getSodaType() - { - return sodaType; - } - - /** - * Set the sodaType of this {@link Fanta} instance. - * - * @param sodaType - * The sodaType of this {@link Fanta} - */ - public void setSodaType( @Nullable final String sodaType ) - { - this.sodaType = sodaType; - } - - /** - * Set the color of this {@link Fanta} instance and return the same instance. - * - * @param color - * The color of this {@link Fanta} - * @return The same instance of this {@link Fanta} class - */ - @Nonnull - public Fanta color( @Nullable final String color ) - { - this.color = color; - return this; - } - - /** - * Get color - * - * @return color The color of this {@link Fanta} instance. - */ - @Nonnull - public String getColor() - { - return color; - } - - /** - * Set the color of this {@link Fanta} instance. - * - * @param color - * The color of this {@link Fanta} - */ - public void setColor( @Nullable final String color ) - { - this.color = color; - } - - /** - * Set the flavor of this {@link Fanta} instance and return the same instance. - * - * @param flavor - * The flavor of this {@link Fanta} - * @return The same instance of this {@link Fanta} class - */ - @Nonnull - public Fanta flavor( @Nullable final FantaFlavor flavor ) - { - this.flavor = flavor; - return this; - } - - /** - * Get flavor - * - * @return flavor The flavor of this {@link Fanta} instance. - */ - @Nonnull - public FantaFlavor getFlavor() - { - return flavor; - } - - /** - * Set the flavor of this {@link Fanta} instance. - * - * @param flavor - * The flavor of this {@link Fanta} - */ - public void setFlavor( @Nullable final FantaFlavor flavor ) - { - this.flavor = flavor; - } - - /** - * Get the names of the unrecognizable properties of the {@link Fanta}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Fanta} instance. - * - * @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("Fanta has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Fanta} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( sodaType != null ) - declaredFields.put("sodaType", sodaType); - if( color != null ) - declaredFields.put("color", color); - if( flavor != null ) - declaredFields.put("flavor", flavor); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained a mapping for the - * key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final Fanta fanta = (Fanta) o; - return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) - && Objects.equals(this.sodaType, fanta.sodaType) - && Objects.equals(this.color, fanta.color) - && Objects.equals(this.flavor, fanta.flavor); - } - - @Override - public int hashCode() - { - return Objects.hash(sodaType, color, flavor, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Fanta {\n"); - sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" flavor: ").append(toIndentedString(flavor)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java deleted file mode 100644 index 143119694..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.List; - -import javax.annotation.Nonnull; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * FantaFlavor - */ -@Beta -public interface FantaFlavor -{ - /** - * Helper class to create {@code String } that implements {@link FantaFlavor}. - */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements FantaFlavor {} - - /** - * 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 FantaFlavor}. - */ - record InnerInteger(@com.fasterxml.jackson.annotation.JsonValue @Nonnull Integer value) implements FantaFlavor {} - - /** - * 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); - } - - /** - * Helper class to create {@code FlavorType } that implements {@link FantaFlavor}. - */ - record InnerFlavorType(@com.fasterxml.jackson.annotation.JsonValue @Nonnull FlavorType value) implements FantaFlavor {} - - /** - * Creator to enable deserialization of {@code FlavorType }. - * - * @param val - * the value to use - * @return a new instance of {@link InnerFlavorType}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerFlavorType createInnerFlavorType( @Nonnull final FlavorType val ) - { - return new InnerFlavorType(val); - } - - /** - * Helper class to create {@code List } that implements {@link FantaFlavor}. - */ - record ListOfFlavorTypes(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements FantaFlavor {} - - /** - * Creator to enable deserialization of {@code List }. - * - * @param val - * the value to use - * @return a new instance of {@link ListOfFlavorTypes}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static ListOfFlavorTypes createListOfFlavorTypes( @Nonnull final List val ) - { - return new ListOfFlavorTypes(val); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java deleted file mode 100644 index e95740c27..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * FlavorType - */ - -@Beta // CHECKSTYLE:OFF -public class FlavorType -// CHECKSTYLE:ON -{ - @JsonProperty( "intensity" ) - private Integer intensity; - - @JsonProperty( "nuance" ) - private String nuance; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for FlavorType. - */ - protected FlavorType() - { - } - - /** - * Set the intensity of this {@link FlavorType} instance and return the same instance. - * - * @param intensity - * The intensity of the flavor - * @return The same instance of this {@link FlavorType} class - */ - @Nonnull - public FlavorType intensity( @Nullable final Integer intensity ) - { - this.intensity = intensity; - return this; - } - - /** - * The intensity of the flavor - * - * @return intensity The intensity of this {@link FlavorType} instance. - */ - @Nonnull - public Integer getIntensity() - { - return intensity; - } - - /** - * Set the intensity of this {@link FlavorType} instance. - * - * @param intensity - * The intensity of the flavor - */ - public void setIntensity( @Nullable final Integer intensity ) - { - this.intensity = intensity; - } - - /** - * Set the nuance of this {@link FlavorType} instance and return the same instance. - * - * @param nuance - * The nuance of the flavor - * @return The same instance of this {@link FlavorType} class - */ - @Nonnull - public FlavorType nuance( @Nullable final String nuance ) - { - this.nuance = nuance; - return this; - } - - /** - * The nuance of the flavor - * - * @return nuance The nuance of this {@link FlavorType} instance. - */ - @Nonnull - public String getNuance() - { - return nuance; - } - - /** - * Set the nuance of this {@link FlavorType} instance. - * - * @param nuance - * The nuance of the flavor - */ - public void setNuance( @Nullable final String nuance ) - { - this.nuance = nuance; - } - - /** - * Get the names of the unrecognizable properties of the {@link FlavorType}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link FlavorType} 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("FlavorType has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link FlavorType} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( intensity != null ) - declaredFields.put("intensity", intensity); - if( nuance != null ) - declaredFields.put("nuance", nuance); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link FlavorType} 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 FlavorType flavorType = (FlavorType) o; - return Objects.equals(this.cloudSdkCustomFields, flavorType.cloudSdkCustomFields) - && Objects.equals(this.intensity, flavorType.intensity) - && Objects.equals(this.nuance, flavorType.nuance); - } - - @Override - public int hashCode() - { - return Objects.hash(intensity, nuance, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class FlavorType {\n"); - sb.append(" intensity: ").append(toIndentedString(intensity)).append("\n"); - sb.append(" nuance: ").append(toIndentedString(nuance)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java deleted file mode 100644 index 963d22d89..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Foo - */ - -@Beta // CHECKSTYLE:OFF -public class Foo implements OneOfWithEnumDiscriminator -// CHECKSTYLE:ON -{ - @JsonProperty( "foo" ) - private String foo; - - /** - * Gets or Sets disc - */ - public enum DiscEnum - { - /** - * The DISC_FOO option of this Foo - */ - DISC_FOO("disc_foo"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this Foo - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - DiscEnum( 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 Foo - */ - @JsonCreator - @Nonnull - public static DiscEnum fromValue( @Nonnull final String value ) - { - for( DiscEnum b : DiscEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "disc" ) - private DiscEnum disc; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Foo. - */ - protected Foo() - { - } - - /** - * Set the foo of this {@link Foo} instance and return the same instance. - * - * @param foo - * The foo of this {@link Foo} - * @return The same instance of this {@link Foo} class - */ - @Nonnull - public Foo foo( @Nullable final String foo ) - { - this.foo = foo; - return this; - } - - /** - * Get foo - * - * @return foo The foo of this {@link Foo} instance. - */ - @Nonnull - public String getFoo() - { - return foo; - } - - /** - * Set the foo of this {@link Foo} instance. - * - * @param foo - * The foo of this {@link Foo} - */ - public void setFoo( @Nullable final String foo ) - { - this.foo = foo; - } - - /** - * Set the disc of this {@link Foo} instance and return the same instance. - * - * @param disc - * The disc of this {@link Foo} - * @return The same instance of this {@link Foo} class - */ - @Nonnull - public Foo disc( @Nullable final DiscEnum disc ) - { - this.disc = disc; - return this; - } - - /** - * Get disc - * - * @return disc The disc of this {@link Foo} instance. - */ - @Nonnull - public DiscEnum getDisc() - { - return disc; - } - - /** - * Set the disc of this {@link Foo} instance. - * - * @param disc - * The disc of this {@link Foo} - */ - public void setDisc( @Nullable final DiscEnum disc ) - { - this.disc = disc; - } - - /** - * Get the names of the unrecognizable properties of the {@link Foo}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Foo} 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("Foo has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Foo} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( foo != null ) - declaredFields.put("foo", foo); - if( disc != null ) - declaredFields.put("disc", disc); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Foo} 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 Foo foo = (Foo) o; - return Objects.equals(this.cloudSdkCustomFields, foo.cloudSdkCustomFields) - && Objects.equals(this.foo, foo.foo) - && Objects.equals(this.disc, foo.disc); - } - - @Override - public int hashCode() - { - return Objects.hash(foo, disc, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Foo {\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append(" disc: ").append(toIndentedString(disc)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java deleted file mode 100644 index 491aeb64a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * OneOf - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { @JsonSubTypes.Type( value = Cola.class ), @JsonSubTypes.Type( value = Fanta.class ), } ) - -public interface OneOf -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java deleted file mode 100644 index f71818d41..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * OneOfWithDiscriminator - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = Cola.class, name = "Cola" ), - @JsonSubTypes.Type( value = Fanta.class, name = "Fanta" ), } ) - -public interface OneOfWithDiscriminator -{ - Object getSodaType(); -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java deleted file mode 100644 index f9742cbd8..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * OneOfWithDiscriminatorAndMapping - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = Cola.class, name = "cool_cola" ), - @JsonSubTypes.Type( value = Fanta.class, name = "fancy_fanta" ), } ) - -public interface OneOfWithDiscriminatorAndMapping -{ - Object getSodaType(); -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java deleted file mode 100644 index c8657f4cb..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * OneOfWithEnumDiscriminator - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "disc", visible = true ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = Bar.class, name = "disc_bar" ), - @JsonSubTypes.Type( value = Foo.class, name = "disc_foo" ), } ) - -public interface OneOfWithEnumDiscriminator -{ - Object getDisc(); -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java deleted file mode 100644 index dfae11431..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Order - */ - -@Beta // CHECKSTYLE:OFF -public class Order -// CHECKSTYLE:ON -{ - @JsonProperty( "productId" ) - private Long productId; - - @JsonProperty( "quantity" ) - private Integer quantity; - - @JsonProperty( "totalPrice" ) - private Float totalPrice; - - @JsonProperty( "typelessProperty" ) - private Object typelessProperty = null; - - @JsonProperty( "nullableProperty" ) - private String nullableProperty; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Order. - */ - protected Order() - { - } - - /** - * Set the productId of this {@link Order} instance and return the same instance. - * - * @param productId - * The productId of this {@link Order} - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order productId( @Nonnull final Long productId ) - { - this.productId = productId; - return this; - } - - /** - * Get productId - * - * @return productId The productId of this {@link Order} instance. - */ - @Nonnull - public Long getProductId() - { - return productId; - } - - /** - * Set the productId of this {@link Order} instance. - * - * @param productId - * The productId of this {@link Order} - */ - public void setProductId( @Nonnull final Long productId ) - { - this.productId = productId; - } - - /** - * Set the quantity of this {@link Order} instance and return the same instance. - * - * @param quantity - * The quantity of this {@link Order} - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order quantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link Order} instance. - */ - @Nonnull - public Integer getQuantity() - { - return quantity; - } - - /** - * Set the quantity of this {@link Order} instance. - * - * @param quantity - * The quantity of this {@link Order} - */ - public void setQuantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - } - - /** - * Set the totalPrice of this {@link Order} instance and return the same instance. - * - * @param totalPrice - * The totalPrice of this {@link Order} - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order totalPrice( @Nullable final Float totalPrice ) - { - this.totalPrice = totalPrice; - return this; - } - - /** - * Get totalPrice - * - * @return totalPrice The totalPrice of this {@link Order} instance. - */ - @Nonnull - public Float getTotalPrice() - { - return totalPrice; - } - - /** - * Set the totalPrice of this {@link Order} instance. - * - * @param totalPrice - * The totalPrice of this {@link Order} - */ - public void setTotalPrice( @Nullable final Float totalPrice ) - { - this.totalPrice = totalPrice; - } - - /** - * Set the typelessProperty of this {@link Order} instance and return the same instance. - * - * @param typelessProperty - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order typelessProperty( @Nullable final Object typelessProperty ) - { - this.typelessProperty = typelessProperty; - return this; - } - - /** - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - * - * @return typelessProperty The typelessProperty of this {@link Order} instance. - */ - @Nullable - public Object getTypelessProperty() - { - return typelessProperty; - } - - /** - * Set the typelessProperty of this {@link Order} instance. - * - * @param typelessProperty - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - */ - public void setTypelessProperty( @Nullable final Object typelessProperty ) - { - this.typelessProperty = typelessProperty; - } - - /** - * Set the nullableProperty of this {@link Order} instance and return the same instance. - * - * @param nullableProperty - * Some typed property that is deliberately made nullable - * @return The same instance of this {@link Order} class - */ - @Nonnull - public Order nullableProperty( @Nullable final String nullableProperty ) - { - this.nullableProperty = nullableProperty; - return this; - } - - /** - * Some typed property that is deliberately made nullable - * - * @return nullableProperty The nullableProperty of this {@link Order} instance. - */ - @Nullable - public String getNullableProperty() - { - return nullableProperty; - } - - /** - * Set the nullableProperty of this {@link Order} instance. - * - * @param nullableProperty - * Some typed property that is deliberately made nullable - */ - public void setNullableProperty( @Nullable final String nullableProperty ) - { - this.nullableProperty = nullableProperty; - } - - /** - * Get the names of the unrecognizable properties of the {@link Order}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Order} instance. - * - * @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("Order has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Order} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( productId != null ) - declaredFields.put("productId", productId); - if( quantity != null ) - declaredFields.put("quantity", quantity); - if( totalPrice != null ) - declaredFields.put("totalPrice", totalPrice); - if( typelessProperty != null ) - declaredFields.put("typelessProperty", typelessProperty); - if( nullableProperty != null ) - declaredFields.put("nullableProperty", nullableProperty); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Order} instance. If the map previously contained a mapping for the - * key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final Order order = (Order) o; - return Objects.equals(this.cloudSdkCustomFields, order.cloudSdkCustomFields) - && Objects.equals(this.productId, order.productId) - && Objects.equals(this.quantity, order.quantity) - && Objects.equals(this.totalPrice, order.totalPrice) - && Objects.equals(this.typelessProperty, order.typelessProperty) - && Objects.equals(this.nullableProperty, order.nullableProperty); - } - - @Override - public int hashCode() - { - return Objects.hash(productId, quantity, totalPrice, typelessProperty, nullableProperty, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); - sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); - sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java deleted file mode 100644 index 709b90bb9..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.time.OffsetDateTime; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrderWithTimestamp - */ - -@Beta // CHECKSTYLE:OFF -public class OrderWithTimestamp -// CHECKSTYLE:ON -{ - @JsonProperty( "productId" ) - private Long productId; - - @JsonProperty( "quantity" ) - private Integer quantity; - - @JsonProperty( "totalPrice" ) - private Float totalPrice; - - @JsonProperty( "typelessProperty" ) - private Object typelessProperty; - - @JsonProperty( "nullableProperty" ) - private String nullableProperty; - - @JsonProperty( "timestamp" ) - private OffsetDateTime timestamp; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrderWithTimestamp. - */ - protected OrderWithTimestamp() - { - } - - /** - * Set the productId of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param productId - * The productId of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp productId( @Nonnull final Long productId ) - { - this.productId = productId; - return this; - } - - /** - * Get productId - * - * @return productId The productId of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public Long getProductId() - { - return productId; - } - - /** - * Set the productId of this {@link OrderWithTimestamp} instance. - * - * @param productId - * The productId of this {@link OrderWithTimestamp} - */ - public void setProductId( @Nonnull final Long productId ) - { - this.productId = productId; - } - - /** - * Set the quantity of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param quantity - * The quantity of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp quantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public Integer getQuantity() - { - return quantity; - } - - /** - * Set the quantity of this {@link OrderWithTimestamp} instance. - * - * @param quantity - * The quantity of this {@link OrderWithTimestamp} - */ - public void setQuantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - } - - /** - * Set the totalPrice of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param totalPrice - * The totalPrice of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp totalPrice( @Nullable final Float totalPrice ) - { - this.totalPrice = totalPrice; - return this; - } - - /** - * Get totalPrice - * - * @return totalPrice The totalPrice of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public Float getTotalPrice() - { - return totalPrice; - } - - /** - * Set the totalPrice of this {@link OrderWithTimestamp} instance. - * - * @param totalPrice - * The totalPrice of this {@link OrderWithTimestamp} - */ - public void setTotalPrice( @Nullable final Float totalPrice ) - { - this.totalPrice = totalPrice; - } - - /** - * Set the typelessProperty of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param typelessProperty - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp typelessProperty( @Nullable final Object typelessProperty ) - { - this.typelessProperty = typelessProperty; - return this; - } - - /** - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - * - * @return typelessProperty The typelessProperty of this {@link OrderWithTimestamp} instance. - */ - @Nullable - public Object getTypelessProperty() - { - return typelessProperty; - } - - /** - * Set the typelessProperty of this {@link OrderWithTimestamp} instance. - * - * @param typelessProperty - * Some typeless property, interpreted by the generator as nullable by default (because typeless) - */ - public void setTypelessProperty( @Nullable final Object typelessProperty ) - { - this.typelessProperty = typelessProperty; - } - - /** - * Set the nullableProperty of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param nullableProperty - * Some typed property that is deliberately made nullable - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp nullableProperty( @Nullable final String nullableProperty ) - { - this.nullableProperty = nullableProperty; - return this; - } - - /** - * Some typed property that is deliberately made nullable - * - * @return nullableProperty The nullableProperty of this {@link OrderWithTimestamp} instance. - */ - @Nullable - public String getNullableProperty() - { - return nullableProperty; - } - - /** - * Set the nullableProperty of this {@link OrderWithTimestamp} instance. - * - * @param nullableProperty - * Some typed property that is deliberately made nullable - */ - public void setNullableProperty( @Nullable final String nullableProperty ) - { - this.nullableProperty = nullableProperty; - } - - /** - * Set the timestamp of this {@link OrderWithTimestamp} instance and return the same instance. - * - * @param timestamp - * The timestamp of this {@link OrderWithTimestamp} - * @return The same instance of this {@link OrderWithTimestamp} class - */ - @Nonnull - public OrderWithTimestamp timestamp( @Nullable final OffsetDateTime timestamp ) - { - this.timestamp = timestamp; - return this; - } - - /** - * Get timestamp - * - * @return timestamp The timestamp of this {@link OrderWithTimestamp} instance. - */ - @Nonnull - public OffsetDateTime getTimestamp() - { - return timestamp; - } - - /** - * Set the timestamp of this {@link OrderWithTimestamp} instance. - * - * @param timestamp - * The timestamp of this {@link OrderWithTimestamp} - */ - public void setTimestamp( @Nullable final OffsetDateTime timestamp ) - { - this.timestamp = timestamp; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrderWithTimestamp}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrderWithTimestamp} instance. - * - * @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("OrderWithTimestamp has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrderWithTimestamp} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( productId != null ) - declaredFields.put("productId", productId); - if( quantity != null ) - declaredFields.put("quantity", quantity); - if( totalPrice != null ) - declaredFields.put("totalPrice", totalPrice); - if( typelessProperty != null ) - declaredFields.put("typelessProperty", typelessProperty); - if( nullableProperty != null ) - declaredFields.put("nullableProperty", nullableProperty); - if( timestamp != null ) - declaredFields.put("timestamp", timestamp); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrderWithTimestamp} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final OrderWithTimestamp orderWithTimestamp = (OrderWithTimestamp) o; - return Objects.equals(this.cloudSdkCustomFields, orderWithTimestamp.cloudSdkCustomFields) - && Objects.equals(this.productId, orderWithTimestamp.productId) - && Objects.equals(this.quantity, orderWithTimestamp.quantity) - && Objects.equals(this.totalPrice, orderWithTimestamp.totalPrice) - && Objects.equals(this.typelessProperty, orderWithTimestamp.typelessProperty) - && Objects.equals(this.nullableProperty, orderWithTimestamp.nullableProperty) - && Objects.equals(this.timestamp, orderWithTimestamp.timestamp); - } - - @Override - public int hashCode() - { - return Objects - .hash(productId, quantity, totalPrice, typelessProperty, nullableProperty, timestamp, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrderWithTimestamp {\n"); - sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); - sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); - sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); - sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java deleted file mode 100644 index 3f334cdf3..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Soda - */ - -@Beta // CHECKSTYLE:OFF -public class Soda -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "brand" ) - private String brand; - - @JsonProperty( "quantity" ) - private Integer quantity; - - /** - * Gets or Sets packaging - */ - public enum PackagingEnum - { - /** - * The GLASS option of this Soda - */ - GLASS("glass"), - - /** - * The CARTON option of this Soda - */ - CARTON("carton"), - - /** - * The CAN option of this Soda - */ - CAN("can"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this Soda - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PackagingEnum( String value ) - { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() - { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() - { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value - * The String value - * @return The enum value of type Soda - */ - @JsonCreator - @Nonnull - public static PackagingEnum fromValue( @Nonnull final String value ) - { - for( PackagingEnum b : PackagingEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "packaging" ) - private PackagingEnum packaging; - - @JsonProperty( "price" ) - private Float price; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Soda. - */ - protected Soda() - { - } - - /** - * Set the name of this {@link Soda} instance and return the same instance. - * - * @param name - * The name of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link Soda} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link Soda} instance. - * - * @param name - * The name of this {@link Soda} - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the brand of this {@link Soda} instance and return the same instance. - * - * @param brand - * The brand of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda brand( @Nonnull final String brand ) - { - this.brand = brand; - return this; - } - - /** - * Get brand - * - * @return brand The brand of this {@link Soda} instance. - */ - @Nonnull - public String getBrand() - { - return brand; - } - - /** - * Set the brand of this {@link Soda} instance. - * - * @param brand - * The brand of this {@link Soda} - */ - public void setBrand( @Nonnull final String brand ) - { - this.brand = brand; - } - - /** - * Set the quantity of this {@link Soda} instance and return the same instance. - * - * @param quantity - * The quantity of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda quantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link Soda} instance. - */ - @Nonnull - public Integer getQuantity() - { - return quantity; - } - - /** - * Set the quantity of this {@link Soda} instance. - * - * @param quantity - * The quantity of this {@link Soda} - */ - public void setQuantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - } - - /** - * Set the packaging of this {@link Soda} instance and return the same instance. - * - * @param packaging - * The packaging of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda packaging( @Nullable final PackagingEnum packaging ) - { - this.packaging = packaging; - return this; - } - - /** - * Get packaging - * - * @return packaging The packaging of this {@link Soda} instance. - */ - @Nonnull - public PackagingEnum getPackaging() - { - return packaging; - } - - /** - * Set the packaging of this {@link Soda} instance. - * - * @param packaging - * The packaging of this {@link Soda} - */ - public void setPackaging( @Nullable final PackagingEnum packaging ) - { - this.packaging = packaging; - } - - /** - * Set the price of this {@link Soda} instance and return the same instance. - * - * @param price - * The price of this {@link Soda} - * @return The same instance of this {@link Soda} class - */ - @Nonnull - public Soda price( @Nonnull final Float price ) - { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price The price of this {@link Soda} instance. - */ - @Nonnull - public Float getPrice() - { - return price; - } - - /** - * Set the price of this {@link Soda} instance. - * - * @param price - * The price of this {@link Soda} - */ - public void setPrice( @Nonnull final Float price ) - { - this.price = price; - } - - /** - * Get the names of the unrecognizable properties of the {@link Soda}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Soda} instance. - * - * @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("Soda has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Soda} 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( brand != null ) - declaredFields.put("brand", brand); - if( quantity != null ) - declaredFields.put("quantity", quantity); - if( packaging != null ) - declaredFields.put("packaging", packaging); - if( price != null ) - declaredFields.put("price", price); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Soda} instance. If the map previously contained a mapping for the - * key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final Soda soda = (Soda) o; - return Objects.equals(this.cloudSdkCustomFields, soda.cloudSdkCustomFields) - && Objects.equals(this.name, soda.name) - && Objects.equals(this.brand, soda.brand) - && Objects.equals(this.quantity, soda.quantity) - && Objects.equals(this.packaging, soda.packaging) - && Objects.equals(this.price, soda.price); - } - - @Override - public int hashCode() - { - return Objects.hash(name, brand, quantity, packaging, price, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Soda {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java deleted file mode 100644 index efe0b425e..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * SodaStore API - * API for managing soda products and orders in SodaStore. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * SodaWithId - */ - -@Beta // CHECKSTYLE:OFF -public class SodaWithId -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "brand" ) - private String brand; - - @JsonProperty( "quantity" ) - private Integer quantity; - - /** - * Gets or Sets packaging - */ - public enum PackagingEnum - { - /** - * The GLASS option of this SodaWithId - */ - GLASS("glass"), - - /** - * The CARTON option of this SodaWithId - */ - CARTON("carton"), - - /** - * The CAN option of this SodaWithId - */ - CAN("can"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this SodaWithId - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PackagingEnum( String value ) - { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() - { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() - { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value - * The String value - * @return The enum value of type SodaWithId - */ - @JsonCreator - @Nonnull - public static PackagingEnum fromValue( @Nonnull final String value ) - { - for( PackagingEnum b : PackagingEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "packaging" ) - private PackagingEnum packaging; - - @JsonProperty( "price" ) - private Float price; - - @JsonProperty( "id" ) - private Long id; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SodaWithId. - */ - protected SodaWithId() - { - } - - /** - * Set the name of this {@link SodaWithId} instance and return the same instance. - * - * @param name - * The name of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link SodaWithId} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link SodaWithId} instance. - * - * @param name - * The name of this {@link SodaWithId} - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the brand of this {@link SodaWithId} instance and return the same instance. - * - * @param brand - * The brand of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId brand( @Nonnull final String brand ) - { - this.brand = brand; - return this; - } - - /** - * Get brand - * - * @return brand The brand of this {@link SodaWithId} instance. - */ - @Nonnull - public String getBrand() - { - return brand; - } - - /** - * Set the brand of this {@link SodaWithId} instance. - * - * @param brand - * The brand of this {@link SodaWithId} - */ - public void setBrand( @Nonnull final String brand ) - { - this.brand = brand; - } - - /** - * Set the quantity of this {@link SodaWithId} instance and return the same instance. - * - * @param quantity - * The quantity of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId quantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity The quantity of this {@link SodaWithId} instance. - */ - @Nonnull - public Integer getQuantity() - { - return quantity; - } - - /** - * Set the quantity of this {@link SodaWithId} instance. - * - * @param quantity - * The quantity of this {@link SodaWithId} - */ - public void setQuantity( @Nonnull final Integer quantity ) - { - this.quantity = quantity; - } - - /** - * Set the packaging of this {@link SodaWithId} instance and return the same instance. - * - * @param packaging - * The packaging of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId packaging( @Nullable final PackagingEnum packaging ) - { - this.packaging = packaging; - return this; - } - - /** - * Get packaging - * - * @return packaging The packaging of this {@link SodaWithId} instance. - */ - @Nonnull - public PackagingEnum getPackaging() - { - return packaging; - } - - /** - * Set the packaging of this {@link SodaWithId} instance. - * - * @param packaging - * The packaging of this {@link SodaWithId} - */ - public void setPackaging( @Nullable final PackagingEnum packaging ) - { - this.packaging = packaging; - } - - /** - * Set the price of this {@link SodaWithId} instance and return the same instance. - * - * @param price - * The price of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId price( @Nonnull final Float price ) - { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price The price of this {@link SodaWithId} instance. - */ - @Nonnull - public Float getPrice() - { - return price; - } - - /** - * Set the price of this {@link SodaWithId} instance. - * - * @param price - * The price of this {@link SodaWithId} - */ - public void setPrice( @Nonnull final Float price ) - { - this.price = price; - } - - /** - * Set the id of this {@link SodaWithId} instance and return the same instance. - * - * @param id - * The id of this {@link SodaWithId} - * @return The same instance of this {@link SodaWithId} class - */ - @Nonnull - public SodaWithId id( @Nullable final Long id ) - { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link SodaWithId} instance. - */ - @Nonnull - public Long getId() - { - return id; - } - - /** - * Set the id of this {@link SodaWithId} instance. - * - * @param id - * The id of this {@link SodaWithId} - */ - public void setId( @Nullable final Long id ) - { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link SodaWithId}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SodaWithId} instance. - * - * @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("SodaWithId has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SodaWithId} 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( brand != null ) - declaredFields.put("brand", brand); - if( quantity != null ) - declaredFields.put("quantity", quantity); - if( packaging != null ) - declaredFields.put("packaging", packaging); - if( price != null ) - declaredFields.put("price", price); - if( id != null ) - declaredFields.put("id", id); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SodaWithId} instance. If the map previously contained a mapping for - * the key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final SodaWithId sodaWithId = (SodaWithId) o; - return Objects.equals(this.cloudSdkCustomFields, sodaWithId.cloudSdkCustomFields) - && Objects.equals(this.name, sodaWithId.name) - && Objects.equals(this.brand, sodaWithId.brand) - && Objects.equals(this.quantity, sodaWithId.quantity) - && Objects.equals(this.packaging, sodaWithId.packaging) - && Objects.equals(this.price, sodaWithId.price) - && Objects.equals(this.id, sodaWithId.id); - } - - @Override - public int hashCode() - { - return Objects.hash(name, brand, quantity, packaging, price, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SodaWithId {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml b/datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml new file mode 100644 index 000000000..dc137966e --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml @@ -0,0 +1,2026 @@ +openapi: 3.0.0 +info: + version: 0.0.1 + title: Prompt Registry API + description: Prompt Storage service for Design time & Runtime prompt templates. +tags: + - name: prompt templates + description: Tag for prompt templates operations + - name: orchestration configs + description: Tag for orchestration configs operations +paths: + /lm/promptTemplates: + post: + operationId: registry.controller.prompt_controller.create_update_prompt_template + x-sap-cloud-sdk-operation-name: createUpdatePromptTemplate + description: Create or update a prompt template + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplatePostRequest' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplatePostResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + get: + operationId: registry.controller.prompt_controller.list_prompt_templates + x-sap-cloud-sdk-operation-name: listPromptTemplates + description: List prompt templates + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: scenario + in: query + schema: + type: string + - name: name + in: query + schema: + type: string + - name: version + in: query + schema: + type: string + - name: retrieve + in: query + schema: + type: string + default: both + - name: includeSpec + in: query + schema: + type: boolean + default: false + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + /lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history: + get: + operationId: registry.controller.prompt_controller.list_prompt_template_history + x-sap-cloud-sdk-operation-name: listPromptTemplateHistory + description: List prompt template history + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: scenario + in: path + required: true + schema: + type: string + - name: version + in: path + required: true + schema: + type: string + - name: name + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + /lm/promptTemplates/{promptTemplateId}: + get: + operationId: registry.controller.prompt_controller.get_prompt_template_by_uuid + x-sap-cloud-sdk-operation-name: getPromptTemplateByUuid + description: Get prompt template by UUID + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: promptTemplateId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateGetResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + delete: + operationId: registry.controller.prompt_controller.delete_prompt_template + x-sap-cloud-sdk-operation-name: deletePromptTemplate + description: Delete prompt template + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: promptTemplateId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateDeleteResponse' + '403': + $ref: '#/components/responses/ForbiddenError' + '404': + $ref: '#/components/responses/NotFound' + default: + $ref: '#/components/responses/CommonError' + /lm/promptTemplates/import: + post: + operationId: registry.controller.prompt_controller.import_prompt_template + x-sap-cloud-sdk-operation-name: importPromptTemplate + description: Import prompt template + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplatePostResponse' + '400': + $ref: '#/components/responses/BadRequest' + default: + $ref: '#/components/responses/CommonError' + /lm/promptTemplates/{promptTemplateId}/export: + get: + operationId: registry.controller.prompt_controller.export_prompt_template + x-sap-cloud-sdk-operation-name: exportPromptTemplate + description: Export prompt template + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: promptTemplateId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Successful response + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + $ref: '#/components/responses/BadRequest' + default: + $ref: '#/components/responses/CommonError' + /lm/promptTemplates/{promptTemplateId}/substitution: + post: + operationId: registry.controller.prompt_controller.parse_prompt_template_by_id + x-sap-cloud-sdk-operation-name: parsePromptTemplateById + description: Parse prompt template by ID + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: promptTemplateId + in: path + required: true + schema: + type: string + format: uuid + - name: metadata + in: query + schema: + type: boolean + default: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateSubstitutionRequest' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateSubstitutionResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + /lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution: + post: + operationId: registry.controller.prompt_controller.parse_prompt_template_by_name_version + x-sap-cloud-sdk-operation-name: parsePromptTemplateByNameVersion + description: Parse prompt template by name and version + tags: + - prompt templates + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - $ref: '#/components/parameters/ai-resource-group-scope' + - name: scenario + in: path + required: true + schema: + type: string + - name: version + in: path + required: true + schema: + type: string + - name: name + in: path + required: true + schema: + type: string + - name: metadata + in: query + schema: + type: boolean + default: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateSubstitutionRequest' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptTemplateSubstitutionResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + /registry/v2/orchestrationConfigs: + post: + operationId: registry.controller.orchestration_config_controller.create_update_orchestration_config + x-sap-cloud-sdk-operation-name: createUpdateOrchestrationConfig + description: Create or update an orchestration config + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigPostRequest' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigPostResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + get: + operationId: registry.controller.orchestration_config_controller.list_orchestration_configs + x-sap-cloud-sdk-operation-name: listOrchestrationConfigs + description: List orchestration configs + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - name: scenario + in: query + schema: + type: string + - name: name + in: query + schema: + type: string + - name: version + in: query + schema: + type: string + - name: retrieve + in: query + schema: + type: string + default: both + enum: + - both + - imperative + - declarative + - name: include_spec + in: query + schema: + type: boolean + default: false + - name: resolve_template_ref + in: query + schema: + type: boolean + default: false + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + /registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history: + get: + operationId: registry.controller.orchestration_config_controller.list_orchestration_config_history + x-sap-cloud-sdk-operation-name: listOrchestrationConfigHistory + description: List orchestration config history + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - name: scenario + in: path + required: true + schema: + type: string + - name: version + in: path + required: true + schema: + type: string + - name: name + in: path + required: true + schema: + type: string + - name: include_spec + in: query + schema: + type: boolean + default: false + - name: resolve_template_ref + in: query + schema: + type: boolean + default: false + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + /registry/v2/orchestrationConfigs/{orchestrationConfigId}: + get: + operationId: registry.controller.orchestration_config_controller.get_orchestration_config_by_uuid + x-sap-cloud-sdk-operation-name: getOrchestrationConfigByUuid + description: Get orchestration config by UUID + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - name: orchestrationConfigId + in: path + required: true + schema: + type: string + format: uuid + - name: resolve_template_ref + in: query + schema: + type: boolean + default: false + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigGetResponse' + '400': + $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/ForbiddenError' + default: + $ref: '#/components/responses/CommonError' + delete: + operationId: registry.controller.orchestration_config_controller.delete_orchestration_config + x-sap-cloud-sdk-operation-name: deleteOrchestrationConfig + description: Delete orchestration config + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - name: orchestrationConfigId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigDeleteResponse' + '403': + $ref: '#/components/responses/ForbiddenError' + '404': + $ref: '#/components/responses/NotFound' + default: + $ref: '#/components/responses/CommonError' + /registry/v2/orchestrationConfigs/import: + post: + operationId: registry.controller.orchestration_config_controller.import_orchestration_config + x-sap-cloud-sdk-operation-name: importOrchestrationConfig + description: Import orchestration config + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OrchestrationConfigPostResponse' + '400': + $ref: '#/components/responses/BadRequest' + default: + $ref: '#/components/responses/CommonError' + /registry/v2/orchestrationConfigs/{orchestrationConfigId}/export: + get: + operationId: registry.controller.orchestration_config_controller.export_orchestration_config + x-sap-cloud-sdk-operation-name: exportOrchestrationConfig + description: Export orchestration config + tags: + - orchestration configs + parameters: + - $ref: '#/components/parameters/ai-resource-group' + - name: orchestrationConfigId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Successful response + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + $ref: '#/components/responses/BadRequest' + default: + $ref: '#/components/responses/CommonError' +components: + schemas: + PromptTemplate: + oneOf: + - $ref: '#/components/schemas/SingleChatTemplate' + - $ref: '#/components/schemas/MultiChatTemplate' + SingleChatTemplate: + type: object + required: + - role + - content + additionalProperties: false + properties: + role: + type: string + content: + type: string + MultiChatTemplate: + type: object + required: + - role + - content + additionalProperties: false + properties: + role: + type: string + content: + type: array + items: + $ref: '#/components/schemas/MultiChatContent' + MultiChatContent: + oneOf: + - $ref: '#/components/schemas/ImageContent' + - $ref: '#/components/schemas/TextContent' + TextContent: + type: object + required: + - type + - text + additionalProperties: false + properties: + type: + type: string + enum: + - text + text: + type: string + ImageContent: + type: object + required: + - type + - image_url + properties: + type: + type: string + enum: + - image_url + image_url: + type: object + required: + - url + additionalProperties: false + properties: + url: + type: string + detail: + type: string + default: auto + PromptTemplateSpec: + type: object + required: + - template + additionalProperties: + type: object + properties: + template: + type: array + items: + $ref: '#/components/schemas/PromptTemplate' + defaults: + type: object + additionalFields: + type: object + description: | + DEPRECATED. Please use additional_fields instead. + deprecated: true + response_format: + description: | + Response format that the model output should adhere to. This is the same as the OpenAI definition. + Compatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. + oneOf: + - $ref: '#/components/schemas/ResponseFormatText' + - $ref: '#/components/schemas/ResponseFormatJsonObject' + - $ref: '#/components/schemas/ResponseFormatJsonSchema' + tools: + type: array + description: | + A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition. + items: + $ref: '#/components/schemas/ChatCompletionTool' + ResponseFormatText: + type: object + additionalProperties: false + properties: + type: + type: string + description: 'The type of response format being defined: `text`' + enum: + - text + required: + - type + ResponseFormatJsonObject: + type: object + additionalProperties: false + properties: + type: + type: string + description: 'The type of response format being defined: `json_object`' + enum: + - json_object + required: + - type + ResponseFormatJsonSchema: + type: object + additionalProperties: false + properties: + type: + type: string + description: 'The type of response format being defined: `json_schema`' + enum: + - json_schema + json_schema: + type: object + additionalProperties: false + properties: + description: + type: string + description: A description of what the response format is for, used by the model to determine how to respond in the format. + name: + type: string + description: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + pattern: ^[a-zA-Z0-9-_]+$ + maxLength: 64 + schema: + $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema' + strict: + type: boolean + nullable: true + default: false + description: Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + required: + - name + required: + - type + - json_schema + ResponseFormatJsonSchemaSchema: + type: object + description: The schema for the response format, described as a JSON Schema object. + additionalProperties: true + ChatCompletionTool: + type: object + additionalProperties: false + properties: + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + function: + $ref: '#/components/schemas/FunctionObject' + required: + - type + - function + FunctionObject: + type: object + additionalProperties: false + properties: + description: + type: string + description: A description of what the function does, used by the model to choose when and how to call the function. + name: + type: string + description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + pattern: ^[a-zA-Z0-9-_]+$ + maxLength: 64 + parameters: + $ref: '#/components/schemas/FunctionParameters' + strict: + type: boolean + nullable: true + default: false + description: Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling). + required: + - name + FunctionParameters: + type: object + description: The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list. + additionalProperties: true + PromptTemplatePostRequest: + type: object + required: + - name + - version + - scenario + - spec + properties: + name: + type: string + maxLength: 120 + pattern: ^[a-zA-Z0-9_-]+$ + version: + type: string + maxLength: 10 + pattern: ^[a-zA-Z0-9._-]+$ + scenario: + type: string + maxLength: 120 + pattern: ^[a-zA-Z0-9_-]+$ + spec: + $ref: '#/components/schemas/PromptTemplateSpec' + PromptTemplatePostResponse: + type: object + required: + - message + - id + - scenario + - name + - version + properties: + message: + type: string + id: + type: string + format: uuid + scenario: + type: string + name: + type: string + version: + type: string + PromptTemplateGetResponse: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + version: + type: string + scenario: + type: string + creationTimestamp: + type: string + format: timestamp + managedBy: + type: string + isVersionHead: + type: boolean + resourceGroupId: + type: string + spec: + $ref: '#/components/schemas/PromptTemplateSpec' + PromptTemplateListResponse: + type: object + required: + - count + - resources + properties: + count: + type: integer + resources: + type: array + items: + $ref: '#/components/schemas/PromptTemplateGetResponse' + PromptTemplateDeleteResponse: + type: object + required: + - message + properties: + message: + type: string + RuntimePromptTemplateFile: + type: object + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + properties: + name: + type: string + version: + type: string + scenario: + type: string + spec: + $ref: '#/components/schemas/PromptTemplateSpec' + PromptTemplateSubstitutionRequest: + type: object + properties: + inputParams: + type: object + PromptTemplateSubstitutionResponse: + type: object + properties: + parsedPrompt: + type: array + items: + $ref: '#/components/schemas/PromptTemplate' + resource: + $ref: '#/components/schemas/PromptTemplateGetResponse' + ErrorResponse: + type: object + required: + - request_id + - message + properties: + request_id: + type: string + message: + type: string + OrchestrationConfigResource: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + version: + type: string + scenario: + type: string + creation_timestamp: + type: string + format: timestamp + managed_by: + type: string + is_version_head: + type: boolean + resource_group_id: + type: string + spec: + $ref: '#/components/schemas/OrchestrationConfig' + OrchestrationConfigListResponse: + type: object + required: + - count + - resources + properties: + count: + type: integer + resources: + type: array + items: + $ref: '#/components/schemas/OrchestrationConfigGetResponse' + OrchestrationConfigPostRequest: + type: object + required: + - name + - version + - scenario + - spec + properties: + name: + type: string + maxLength: 120 + pattern: ^[a-zA-Z0-9_-]+$ + version: + type: string + maxLength: 10 + pattern: ^[a-zA-Z0-9._-]+$ + scenario: + type: string + maxLength: 120 + pattern: ^[a-zA-Z0-9_-]+$ + spec: + $ref: '#/components/schemas/OrchestrationConfig' + OrchestrationConfigPostResponse: + type: object + required: + - message + - id + - scenario + - name + - version + properties: + message: + type: string + id: + type: string + format: uuid + scenario: + type: string + name: + type: string + version: + type: string + OrchestrationConfigGetResponse: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + version: + type: string + scenario: + type: string + creation_timestamp: + type: string + format: timestamp + managed_by: + type: string + is_version_head: + type: boolean + resource_group_id: + type: string + spec: + $ref: '#/components/schemas/OrchestrationConfig' + OrchestrationConfigDeleteResponse: + type: object + required: + - message + properties: + message: + type: string + RuntimeOrchestrationConfigFile: + type: object + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + properties: + name: + type: string + version: + type: string + scenario: + type: string + spec: + $ref: '#/components/schemas/OrchestrationConfig' + ChatMessageContent: + oneOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/TextContent' + minItems: 1 + SystemChatMessage: + type: object + additionalProperties: false + properties: + role: + type: string + enum: + - system + content: + $ref: '#/components/schemas/ChatMessageContent' + required: + - role + - content + ImageContentUrl: + type: object + required: + - url + additionalProperties: false + properties: + url: + type: string + detail: + type: string + default: auto + UserChatMessageContentItem: + type: object + additionalProperties: false + properties: + type: + type: string + enum: + - text + - image_url + text: + type: string + image_url: + $ref: '#/components/schemas/ImageContentUrl' + required: + - type + UserChatMessageContent: + oneOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/UserChatMessageContentItem' + minItems: 1 + UserChatMessage: + type: object + additionalProperties: false + properties: + content: + $ref: '#/components/schemas/UserChatMessageContent' + role: + type: string + enum: + - user + required: + - content + - role + MessageToolCall: + type: object + properties: + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + function: + type: object + description: The function that the model called. + properties: + name: + type: string + description: The name of the function to call. + arguments: + type: string + description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + required: + - name + - arguments + required: + - id + - type + - function + MessageToolCalls: + type: array + description: The tool calls generated by the model, such as function calls. + items: + $ref: '#/components/schemas/MessageToolCall' + AssistantChatMessage: + type: object + additionalProperties: false + properties: + role: + type: string + enum: + - assistant + content: + $ref: '#/components/schemas/ChatMessageContent' + refusal: + type: string + tool_calls: + $ref: '#/components/schemas/MessageToolCalls' + required: + - role + ToolChatMessage: + type: object + additionalProperties: false + properties: + role: + type: string + enum: + - tool + example: tool + tool_call_id: + type: string + content: + $ref: '#/components/schemas/ChatMessageContent' + required: + - role + - content + - tool_call_id + DeveloperChatMessage: + type: object + additionalProperties: false + properties: + role: + type: string + enum: + - developer + content: + $ref: '#/components/schemas/ChatMessageContent' + required: + - role + - content + ChatMessage: + oneOf: + - $ref: '#/components/schemas/SystemChatMessage' + - $ref: '#/components/schemas/UserChatMessage' + - $ref: '#/components/schemas/AssistantChatMessage' + - $ref: '#/components/schemas/ToolChatMessage' + - $ref: '#/components/schemas/DeveloperChatMessage' + TemplatingChatMessage: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/ChatMessage' + Template: + type: object + required: + - template + additionalProperties: false + properties: + template: + allOf: + - $ref: '#/components/schemas/TemplatingChatMessage' + description: A chat message array to be formatted with values from placeholder_values. Both role and content can be templated. If messages_history is provided, the templated messages will be appended. + defaults: + description: Optional default values for the template. If a parameter has no default it is required. + type: object + additionalProperties: + type: string + response_format: + description: | + Response format that the model output should adhere to. This is the same as the OpenAI definition. + oneOf: + - $ref: '#/components/schemas/ResponseFormatText' + - $ref: '#/components/schemas/ResponseFormatJsonObject' + - $ref: '#/components/schemas/ResponseFormatJsonSchema' + tools: + type: array + description: | + A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition. + items: + $ref: '#/components/schemas/ChatCompletionTool' + example: + template: + - role: user + content: How can the features of AI in SAP BTP specifically {{'{{?groundingOutput}}'}}, be applied to {{'{{?inputContext}}'}} + defaults: + inputContext: The default text that will be used in the template if inputContext is not set + TemplateRefByID: + type: object + required: + - id + additionalProperties: false + properties: + id: + type: string + description: ID of the template in prompt registry + example: template_id + scope: + type: string + description: | + Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared across all resource groups within the tenant, while 'resource_group' indicates the template is only accessible within the specific resource group. + enum: + - resource_group + - tenant + default: tenant + TemplateRefByScenarioNameVersion: + type: object + required: + - scenario + - name + - version + additionalProperties: false + properties: + scenario: + type: string + description: Scenario name + example: some-scenario + name: + type: string + description: Name of the template + example: some-template-name + version: + type: string + description: Version of the template + example: some version, can be `latest` + scope: + type: string + description: | + Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared across all resource groups within the tenant, while 'resource_group' indicates the template is only accessible within the specific resource group. + enum: + - resource_group + - tenant + default: tenant + TemplateRef: + type: object + required: + - template_ref + additionalProperties: false + properties: + template_ref: + description: Reference to a template in the prompt registry by ID or by scenario, name and version + oneOf: + - $ref: '#/components/schemas/TemplateRefByID' + - $ref: '#/components/schemas/TemplateRefByScenarioNameVersion' + LLMModelDetails: + type: object + description: | + The model and parameters to be used for the prompt templating. This is the model that will be used to generate the response. + required: + - name + additionalProperties: false + properties: + name: + type: string + description: Name of the model as in LLM Access configuration + example: gpt-4o-mini + version: + type: string + description: Version of the model to be used + default: latest + params: + type: object + description: Additional parameters for the model. Default values are used for mandatory parameters. + additionalProperties: true + example: + max_tokens: 300 + temperature: 0.1 + frequency_penalty: 0 + presence_penalty: 0 + 'n': 2 + stream_options: + include_usage: true + timeout: + description: Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. + type: integer + default: 600 + minimum: 1 + maximum: 600 + max_retries: + description: Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI models. + type: integer + default: 2 + minimum: 0 + maximum: 5 + PromptTemplatingModuleConfig: + type: object + required: + - prompt + - model + additionalProperties: false + properties: + prompt: + description: | + The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. + oneOf: + - $ref: '#/components/schemas/Template' + - $ref: '#/components/schemas/TemplateRef' + model: + $ref: '#/components/schemas/LLMModelDetails' + AzureThreshold: + type: integer + enum: + - 0 + - 2 + - 4 + - 6 + example: 0 + AzureContentSafetyInput: + description: Filter configuration for Azure Content Safety + type: object + additionalProperties: false + properties: + hate: + $ref: '#/components/schemas/AzureThreshold' + self_harm: + $ref: '#/components/schemas/AzureThreshold' + sexual: + $ref: '#/components/schemas/AzureThreshold' + violence: + $ref: '#/components/schemas/AzureThreshold' + prompt_shield: + type: boolean + description: Filter prompts for harmful content such as jailbreaks and prompt injections. + default: false + AzureContentSafetyInputFilterConfig: + type: object + required: + - type + additionalProperties: false + properties: + type: + description: Name of the filter provider type + type: string + enum: + - azure_content_safety + example: azure_content_safety + config: + $ref: '#/components/schemas/AzureContentSafetyInput' + LlamaGuard38b: + description: Filter configuration for Llama Guard 3 8B + type: object + additionalProperties: false + minProperties: 1 + properties: + violent_crimes: + type: boolean + non_violent_crimes: + type: boolean + sex_crimes: + type: boolean + child_exploitation: + type: boolean + defamation: + type: boolean + specialized_advice: + type: boolean + privacy: + type: boolean + intellectual_property: + type: boolean + indiscriminate_weapons: + type: boolean + hate: + type: boolean + self_harm: + type: boolean + sexual_content: + type: boolean + elections: + type: boolean + code_interpreter_abuse: + type: boolean + LlamaGuard38bFilterConfig: + type: object + required: + - type + - config + additionalProperties: false + properties: + type: + description: Name of the filter provider type + type: string + enum: + - llama_guard_3_8b + example: llama_guard_3_8b + config: + $ref: '#/components/schemas/LlamaGuard38b' + InputFilterConfig: + oneOf: + - $ref: '#/components/schemas/AzureContentSafetyInputFilterConfig' + - $ref: '#/components/schemas/LlamaGuard38bFilterConfig' + InputFilteringConfig: + type: object + required: + - filters + additionalProperties: false + properties: + filters: + description: Configuration for content filtering services that should be used for the given filtering step (input filtering). + type: array + minItems: 1 + items: + $ref: '#/components/schemas/InputFilterConfig' + AzureContentSafetyOutput: + description: Filter configuration for Azure Content Safety + type: object + additionalProperties: false + properties: + hate: + $ref: '#/components/schemas/AzureThreshold' + self_harm: + $ref: '#/components/schemas/AzureThreshold' + sexual: + $ref: '#/components/schemas/AzureThreshold' + violence: + $ref: '#/components/schemas/AzureThreshold' + protected_material_code: + type: boolean + description: Detect protected code content from known GitHub repositories. The scan includes software libraries, source code, algorithms, and other proprietary programming content. + default: false + AzureContentSafetyOutputFilterConfig: + type: object + required: + - type + additionalProperties: false + properties: + type: + description: Name of the filter provider type + type: string + enum: + - azure_content_safety + example: azure_content_safety + config: + $ref: '#/components/schemas/AzureContentSafetyOutput' + OutputFilterConfig: + oneOf: + - $ref: '#/components/schemas/AzureContentSafetyOutputFilterConfig' + - $ref: '#/components/schemas/LlamaGuard38bFilterConfig' + FilteringStreamOptions: + description: Stream options for output filtering. Will be ignored if stream is false. + type: object + additionalProperties: false + properties: + overlap: + type: integer + description: Number of characters that should be additionally sent to content filtering services from previous chunks as additional context. + default: 0 + minimum: 0 + maximum: 10000 + OutputFilteringConfig: + type: object + required: + - filters + additionalProperties: false + properties: + filters: + description: Configuration for content filtering services that should be used for the given filtering step (output filtering). + type: array + minItems: 1 + items: + $ref: '#/components/schemas/OutputFilterConfig' + stream_options: + $ref: '#/components/schemas/FilteringStreamOptions' + FilteringModuleConfig: + type: object + additionalProperties: false + properties: + input: + allOf: + - $ref: '#/components/schemas/InputFilteringConfig' + description: List of provider type and filters + output: + allOf: + - $ref: '#/components/schemas/OutputFilteringConfig' + description: List of provider type and filters + minProperties: 1 + DPIEntities: + description: Default entities supported by data privacy and integration service + type: string + enum: + - profile-person + - profile-org + - profile-university + - profile-location + - profile-email + - profile-phone + - profile-address + - profile-sapids-internal + - profile-sapids-public + - profile-url + - profile-username-password + - profile-nationalid + - profile-iban + - profile-ssn + - profile-credit-card-number + - profile-passport + - profile-driverlicense + - profile-nationality + - profile-religious-group + - profile-political-group + - profile-pronouns-gender + - profile-ethnicity + - profile-gender + - profile-sexual-orientation + - profile-trade-union + - profile-sensitive-data + DPIMethodConstant: + description: Replaces the entity with the specified value followed by an incrementing number + type: object + required: + - method + - value + additionalProperties: false + properties: + method: + type: string + enum: + - constant + value: + description: Value to be used for replacement + example: NAME_REDACTED + type: string + DPIMethodFabricatedData: + description: Replaces the entity with a randomly generated value appropriate to its type. + type: object + required: + - method + additionalProperties: false + properties: + method: + type: string + enum: + - fabricated_data + DPIStandardEntity: + type: object + required: + - type + additionalProperties: false + properties: + type: + $ref: '#/components/schemas/DPIEntities' + replacement_strategy: + description: Replacement strategy to be used for the entity + oneOf: + - $ref: '#/components/schemas/DPIMethodConstant' + - $ref: '#/components/schemas/DPIMethodFabricatedData' + DPICustomEntity: + type: object + required: + - regex + - replacement_strategy + additionalProperties: false + properties: + regex: + description: Regular expression to match the entity + type: string + replacement_strategy: + description: Replacement strategy to be used for the entity + oneOf: + - $ref: '#/components/schemas/DPIMethodConstant' + DPIEntityConfig: + oneOf: + - $ref: '#/components/schemas/DPIStandardEntity' + - $ref: '#/components/schemas/DPICustomEntity' + DPIConfig: + type: object + required: + - type + - method + - entities + additionalProperties: false + properties: + type: + description: Type of masking service provider + type: string + enum: + - sap_data_privacy_integration + method: + description: Type of masking method to be used + type: string + enum: + - anonymization + - pseudonymization + entities: + description: List of entities to be masked + type: array + minItems: 1 + items: + $ref: '#/components/schemas/DPIEntityConfig' + allowlist: + description: List of strings that should not be masked + type: array + example: + - SAP + - Joule + items: + type: string + mask_grounding_input: + type: object + additionalProperties: false + properties: + enabled: + type: boolean + default: false + description: controls whether the input to the grounding module will be masked with the configuration supplied in the masking module + MaskingProviderConfig: + oneOf: + - $ref: '#/components/schemas/DPIConfig' + MaskingModuleConfig: + oneOf: + - type: object + title: MaskingModuleConfigProviders + properties: + providers: + description: List of masking service providers + type: array + minItems: 1 + items: + $ref: '#/components/schemas/MaskingProviderConfig' + required: + - providers + additionalProperties: false + - type: object + title: MaskingModuleConfigMaskingProviders + properties: + masking_providers: + deprecated: true + description: 'List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` property instead.' + type: array + minItems: 1 + items: + $ref: '#/components/schemas/MaskingProviderConfig' + required: + - masking_providers + additionalProperties: false + GroundingFilterId: + title: Id + description: Identifier of this SearchFilter - unique per request. + type: string + GroundingFilterSearchConfiguration: + additionalProperties: false + properties: + max_chunk_count: + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxchunkcount + description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + max_document_count: + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxdocumentcount + description: '[Only supports ''vector'' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used with ''maxChunkCount''. If maxDocumentCount is given, then only one chunk per document is returned.' + title: SearchConfiguration + minProperties: 0 + maxProperties: 1 + DataRepositoryType: + type: string + description: Only include DataRepositories with the given type. + enum: + - vector + - help.sap.com + title: DataRepositoryType + KeyValueListPair: + additionalProperties: false + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + type: object + required: + - key + - value + title: KeyValueListPair + SearchSelectOptionEnum: + type: string + enum: + - ignoreIfKeyAbsent + title: SearchSelectOptionEnum + SearchDocumentKeyValueListPair: + additionalProperties: false + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + select_mode: + type: array + items: + $ref: '#/components/schemas/SearchSelectOptionEnum' + title: Selectmode + description: Select mode for search filters + type: object + required: + - key + - value + title: SearchDocumentKeyValueListPair + DocumentGroundingFilter: + type: object + required: + - data_repository_type + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/GroundingFilterId' + search_config: + $ref: '#/components/schemas/GroundingFilterSearchConfiguration' + data_repositories: + type: array + items: + type: string + title: DataRepositories + description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. + default: + - '*' + data_repository_type: + $ref: '#/components/schemas/DataRepositoryType' + data_repository_metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Datarepositorymetadata + description: Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when combined with dataRepositories=['*'] + document_metadata: + type: array + items: + $ref: '#/components/schemas/SearchDocumentKeyValueListPair' + title: Documentmetadata + description: Restrict documents considered during search to those annotated with the given metadata. + chunk_metadata: + type: array + items: + $ref: '#/components/schemas/KeyValueListPair' + title: Chunkmetadata + description: Restrict chunks considered during search to those with the given metadata. + minProperties: 1 + GroundingModuleConfig: + type: object + required: + - type + - config + additionalProperties: false + properties: + type: + type: string + anyOf: + - enum: + - document_grounding_service + - {} + example: document_grounding_service + config: + type: object + required: + - placeholders + additionalProperties: false + properties: + filters: + type: array + items: + oneOf: + - $ref: '#/components/schemas/DocumentGroundingFilter' + description: Document grounding service filters to be used + placeholders: + type: object + additionalProperties: false + required: + - input + - output + properties: + input: + type: array + minItems: 1 + items: + type: string + example: groundingInput + description: Contains the input parameters used for grounding input questions + output: + type: string + description: Placeholder name for grounding output + example: groundingOutput + description: Placeholders to be used for grounding input questions and output + metadata_params: + type: array + items: + type: string + description: Parameter name used for specifying metadata parameters + SAPDocumentTranslationApplyToSelector: + type: object + description: | + This selector allows you to define the scope of translation, such as specific placeholders or messages with specific roles. For example, `{"category": "placeholders", "items": ["user_input"], "source_language": "de-DE"}` targets the value of "user_input" in `placeholder_values` specified in the request payload; and considers the value to be in German. + required: + - category + - items + additionalProperties: false + properties: + category: + type: string + description: Category to apply translation to. + enum: + - placeholders + - template_roles + items: + type: array + description: List of placeholders or roles to apply translation to + items: + type: string + example: + - groundingInput + - inputContext + source_language: + type: string + description: Language of the text to be translated. + example: de-DE + SAPDocumentTranslationInput: + type: object + required: + - type + - config + additionalProperties: false + properties: + type: + description: Type of document translation provider + type: string + enum: + - sap_document_translation + example: sap_document_translation + translate_messages_history: + type: boolean + description: If true, the messages history will be translated as well. + default: true + config: + description: Configuration for `sap_document_translation` translation provider. + type: object + additionalProperties: false + required: + - target_language + properties: + source_language: + type: string + description: Language of the text to be translated. + example: de-DE + apply_to: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/SAPDocumentTranslationApplyToSelector' + target_language: + type: string + description: Language to which the text should be translated. + example: en-US + SAPDocumentTranslationOutputTargetLanguage: + oneOf: + - type: string + description: Language to which the text should be translated. + example: en-US + - $ref: '#/components/schemas/SAPDocumentTranslationApplyToSelector' + SAPDocumentTranslationOutput: + type: object + required: + - type + - config + additionalProperties: false + properties: + type: + description: Configuration for `sap_document_translation` translation provider. + type: string + enum: + - sap_document_translation + example: sap_document_translation + config: + type: object + additionalProperties: false + required: + - target_language + properties: + source_language: + type: string + description: Language of the text to be translated. + example: de-DE + target_language: + $ref: '#/components/schemas/SAPDocumentTranslationOutputTargetLanguage' + TranslationModuleConfig: + type: object + description: Configuration for translation module + additionalProperties: false + properties: + input: + description: Configuration for input translation + oneOf: + - $ref: '#/components/schemas/SAPDocumentTranslationInput' + output: + description: Configuration for output translation + oneOf: + - $ref: '#/components/schemas/SAPDocumentTranslationOutput' + ModuleConfigs: + type: object + required: + - prompt_templating + additionalProperties: false + properties: + prompt_templating: + $ref: '#/components/schemas/PromptTemplatingModuleConfig' + filtering: + $ref: '#/components/schemas/FilteringModuleConfig' + masking: + $ref: '#/components/schemas/MaskingModuleConfig' + grounding: + $ref: '#/components/schemas/GroundingModuleConfig' + translation: + $ref: '#/components/schemas/TranslationModuleConfig' + GlobalStreamOptions: + description: Options for streaming. Will be ignored if enabled is false. + type: object + additionalProperties: false + properties: + enabled: + type: boolean + description: If true, the response will be streamed back to the client + default: false + chunk_size: + type: integer + description: Minimum number of characters per chunk that post-LLM modules operate on. + default: 100 + minimum: 1 + maximum: 10000 + delimiters: + type: array + minItems: 1 + description: List of delimiters to split the input text into chunks.Please note, this is a required parameter when `input_translation_module_config` or `output_translation_module_config` are configured. + items: + type: string + example: + - |+ + + - . + - '?' + - '!' + OrchestrationConfig: + type: object + required: + - modules + additionalProperties: false + properties: + modules: + $ref: '#/components/schemas/ModuleConfigs' + stream: + $ref: '#/components/schemas/GlobalStreamOptions' + responses: + BadRequest: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + CommonError: + description: Common Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + ForbiddenError: + description: Forbidden Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + NotFound: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + parameters: + ai-resource-group: + name: AI-Resource-Group + in: header + description: Specify a resource group id to use + required: false + schema: + type: string + ai-resource-group-scope: + name: AI-Resource-Group-Scope + in: header + description: Specify whether the resource group scope is to be used + required: false + schema: + type: string + enum: + - 'true' + - 'True' + - 'false' + - 'False' From d4747ada51a2d33a633a07f1395582494a576c84 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 16 Dec 2025 15:36:29 +0100 Subject: [PATCH 02/25] regenerate with prompt-registry.yaml --- .../sample/api/OrchestrationConfigsApi.java | 871 ++++++++++++ .../apache/sample/api/PromptTemplatesApi.java | 1173 +++++++++++++++++ .../sample/model/AssistantChatMessage.java | 414 ++++++ .../sample/model/AzureContentSafetyInput.java | 371 ++++++ .../AzureContentSafetyInputFilterConfig.java | 312 +++++ .../model/AzureContentSafetyOutput.java | 374 ++++++ .../AzureContentSafetyOutputFilterConfig.java | 312 +++++ .../apache/sample/model/AzureThreshold.java | 86 ++ .../sample/model/ChatCompletionTool.java | 309 +++++ .../apache/sample/model/ChatMessage.java | 36 + .../sample/model/ChatMessageContent.java | 68 + .../apache/sample/model/DPIConfig.java | 545 ++++++++ .../model/DPIConfigMaskGroundingInput.java | 202 +++ .../apache/sample/model/DPICustomEntity.java | 241 ++++ .../apache/sample/model/DPIEntities.java | 130 ++ .../apache/sample/model/DPIEntityConfig.java | 33 + .../sample/model/DPIMethodConstant.java | 309 +++++ .../sample/model/DPIMethodFabricatedData.java | 267 ++++ .../sample/model/DPIStandardEntity.java | 242 ++++ .../DPIStandardEntityReplacementStrategy.java | 33 + .../sample/model/DataRepositoryType.java | 82 ++ .../sample/model/DeveloperChatMessage.java | 309 +++++ .../sample/model/DocumentGroundingFilter.java | 546 ++++++++ .../apache/sample/model/ErrorResponse.java | 241 ++++ .../sample/model/FilteringModuleConfig.java | 241 ++++ .../sample/model/FilteringStreamOptions.java | 202 +++ .../apache/sample/model/FunctionObject.java | 370 ++++++ .../sample/model/GlobalStreamOptions.java | 308 +++++ .../GroundingFilterSearchConfiguration.java | 251 ++++ .../sample/model/GroundingModuleConfig.java | 309 +++++ .../model/GroundingModuleConfigConfig.java | 323 +++++ ...oundingModuleConfigConfigFiltersInner.java | 31 + ...oundingModuleConfigConfigPlaceholders.java | 263 ++++ .../apache/sample/model/ImageContent.java | 309 +++++ .../sample/model/ImageContentImageUrl.java | 241 ++++ .../apache/sample/model/ImageContentUrl.java | 241 ++++ .../sample/model/InputFilterConfig.java | 33 + .../sample/model/InputFilteringConfig.java | 219 +++ .../apache/sample/model/KeyValueListPair.java | 260 ++++ .../apache/sample/model/LLMModelDetails.java | 397 ++++++ .../apache/sample/model/LlamaGuard38b.java | 773 +++++++++++ .../model/LlamaGuard38bFilterConfig.java | 310 +++++ .../sample/model/MaskingModuleConfig.java | 33 + .../MaskingModuleConfigMaskingProviders.java | 226 ++++ .../model/MaskingModuleConfigProviders.java | 218 +++ .../apache/sample/model/MessageToolCall.java | 352 +++++ .../sample/model/MessageToolCallFunction.java | 248 ++++ .../apache/sample/model/ModuleConfigs.java | 370 ++++++ .../apache/sample/model/MultiChatContent.java | 31 + .../sample/model/MultiChatTemplate.java | 260 ++++ .../sample/model/OrchestrationConfig.java | 241 ++++ .../OrchestrationConfigDeleteResponse.java | 201 +++ .../model/OrchestrationConfigGetResponse.java | 555 ++++++++ .../OrchestrationConfigListResponse.java | 262 ++++ .../model/OrchestrationConfigPostRequest.java | 328 +++++ .../OrchestrationConfigPostResponse.java | 372 ++++++ .../model/OrchestrationConfigResource.java | 555 ++++++++ .../sample/model/OutputFilterConfig.java | 33 + .../sample/model/OutputFilteringConfig.java | 262 ++++ .../apache/sample/model/PromptTemplate.java | 33 + .../model/PromptTemplateDeleteResponse.java | 199 +++ .../model/PromptTemplateGetResponse.java | 555 ++++++++ .../model/PromptTemplateListResponse.java | 261 ++++ .../model/PromptTemplatePostRequest.java | 328 +++++ .../model/PromptTemplatePostResponse.java | 372 ++++++ .../sample/model/PromptTemplateSpec.java | 411 ++++++ .../PromptTemplateSpecResponseFormat.java | 35 + .../PromptTemplateSubstitutionRequest.java | 201 +++ .../PromptTemplateSubstitutionResponse.java | 263 ++++ .../model/PromptTemplatingModuleConfig.java | 242 ++++ .../PromptTemplatingModuleConfigPrompt.java | 32 + .../model/ResponseFormatJsonObject.java | 267 ++++ .../model/ResponseFormatJsonSchema.java | 310 +++++ .../ResponseFormatJsonSchemaJsonSchema.java | 366 +++++ .../sample/model/ResponseFormatText.java | 266 ++++ .../model/RuntimeOrchestrationConfigFile.java | 328 +++++ .../model/RuntimePromptTemplateFile.java | 328 +++++ .../RuntimePromptTemplateFileMetadata.java | 287 ++++ ...SAPDocumentTranslationApplyToSelector.java | 384 ++++++ .../model/SAPDocumentTranslationInput.java | 355 +++++ .../SAPDocumentTranslationInputConfig.java | 308 +++++ .../model/SAPDocumentTranslationOutput.java | 310 +++++ .../SAPDocumentTranslationOutputConfig.java | 245 ++++ ...cumentTranslationOutputTargetLanguage.java | 69 + .../model/SearchDocumentKeyValueListPair.java | 321 +++++ .../sample/model/SearchSelectOptionEnum.java | 80 ++ .../sample/model/SingleChatTemplate.java | 241 ++++ .../sample/model/SystemChatMessage.java | 309 +++++ .../openapi/apache/sample/model/Template.java | 389 ++++++ .../apache/sample/model/TemplateRef.java | 198 +++ .../apache/sample/model/TemplateRefByID.java | 322 +++++ .../TemplateRefByScenarioNameVersion.java | 409 ++++++ .../sample/model/TemplateRefTemplateRef.java | 33 + .../sample/model/TemplateResponseFormat.java | 34 + .../apache/sample/model/TextContent.java | 309 +++++ .../apache/sample/model/ToolChatMessage.java | 352 +++++ .../sample/model/TranslationModuleConfig.java | 242 ++++ .../apache/sample/model/UserChatMessage.java | 309 +++++ .../sample/model/UserChatMessageContent.java | 69 + .../model/UserChatMessageContentItem.java | 358 +++++ 100 files changed, 27864 insertions(+) create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java new file mode 100644 index 000000000..a18aada96 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -0,0 +1,871 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.api; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigDeleteResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigGetResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigListResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigPostRequest; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigPostResponse; +import com.sap.cloud.sdk.services.openapi.apache.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.ApiException; +import com.sap.cloud.sdk.services.openapi.apache.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.Configuration; +import com.sap.cloud.sdk.services.openapi.apache.Pair; + +public class OrchestrationConfigsApi extends BaseApi +{ + + public OrchestrationConfigsApi() + { + super(Configuration.getDefaultApiClient()); + } + + public OrchestrationConfigsApi( ApiClient apiClient ) + { + super(apiClient); + } + + /** + * + * Create or update an orchestration config + * + * @param orchestrationConfigPostRequest + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @return OrchestrationConfigPostResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( + @javax.annotation.Nonnull OrchestrationConfigPostRequest orchestrationConfigPostRequest, + @javax.annotation.Nullable String aiResourceGroup ) + throws ApiException + { + return this + .createUpdateOrchestrationConfig(orchestrationConfigPostRequest, aiResourceGroup, Collections.emptyMap()); + } + + /** + * + * Create or update an orchestration config + * + * @param orchestrationConfigPostRequest + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return OrchestrationConfigPostResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( + @javax.annotation.Nonnull OrchestrationConfigPostRequest orchestrationConfigPostRequest, + @javax.annotation.Nullable String aiResourceGroup, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = orchestrationConfigPostRequest; + + // verify the required parameter 'orchestrationConfigPostRequest' is set + if( orchestrationConfigPostRequest == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'orchestrationConfigPostRequest' when calling createUpdateOrchestrationConfig"); + } + + // create path and map variables + String localVarPath = "/registry/v2/orchestrationConfigs"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Delete orchestration config + * + * @param orchestrationConfigId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @return OrchestrationConfigDeleteResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( + @javax.annotation.Nonnull UUID orchestrationConfigId, + @javax.annotation.Nullable String aiResourceGroup ) + throws ApiException + { + return this.deleteOrchestrationConfig(orchestrationConfigId, aiResourceGroup, Collections.emptyMap()); + } + + /** + * + * Delete orchestration config + * + * @param orchestrationConfigId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return OrchestrationConfigDeleteResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( + @javax.annotation.Nonnull UUID orchestrationConfigId, + @javax.annotation.Nullable String aiResourceGroup, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'orchestrationConfigId' is set + if( orchestrationConfigId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'orchestrationConfigId' when calling deleteOrchestrationConfig"); + } + + // create path and map variables + String localVarPath = + "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" + .replaceAll( + "\\{" + "orchestrationConfigId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Export orchestration config + * + * @param orchestrationConfigId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @return File + * @throws ApiException + * if fails to make API call + */ + public File exportOrchestrationConfig( + @javax.annotation.Nonnull UUID orchestrationConfigId, + @javax.annotation.Nullable String aiResourceGroup ) + throws ApiException + { + return this.exportOrchestrationConfig(orchestrationConfigId, aiResourceGroup, Collections.emptyMap()); + } + + /** + * + * Export orchestration config + * + * @param orchestrationConfigId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return File + * @throws ApiException + * if fails to make API call + */ + public File exportOrchestrationConfig( + @javax.annotation.Nonnull UUID orchestrationConfigId, + @javax.annotation.Nullable String aiResourceGroup, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'orchestrationConfigId' is set + if( orchestrationConfigId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'orchestrationConfigId' when calling exportOrchestrationConfig"); + } + + // create path and map variables + String localVarPath = + "/registry/v2/orchestrationConfigs/{orchestrationConfigId}/export" + .replaceAll( + "\\{" + "orchestrationConfigId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/octet-stream", "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Get orchestration config by UUID + * + * @param orchestrationConfigId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param resolveTemplateRef + * (optional, default to false) + * @return OrchestrationConfigGetResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( + @javax.annotation.Nonnull UUID orchestrationConfigId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable Boolean resolveTemplateRef ) + throws ApiException + { + return this + .getOrchestrationConfigByUuid( + orchestrationConfigId, + aiResourceGroup, + resolveTemplateRef, + Collections.emptyMap()); + } + + /** + * + * Get orchestration config by UUID + * + * @param orchestrationConfigId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param resolveTemplateRef + * (optional, default to false) + * @param additionalHeaders + * additionalHeaders for this call + * @return OrchestrationConfigGetResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( + @javax.annotation.Nonnull UUID orchestrationConfigId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable Boolean resolveTemplateRef, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'orchestrationConfigId' is set + if( orchestrationConfigId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'orchestrationConfigId' when calling getOrchestrationConfigByUuid"); + } + + // create path and map variables + String localVarPath = + "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" + .replaceAll( + "\\{" + "orchestrationConfigId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Import orchestration config + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param _file + * (optional) + * @return OrchestrationConfigPostResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigPostResponse importOrchestrationConfig( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable File _file ) + throws ApiException + { + return this.importOrchestrationConfig(aiResourceGroup, _file, Collections.emptyMap()); + } + + /** + * + * Import orchestration config + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param _file + * (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return OrchestrationConfigPostResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigPostResponse importOrchestrationConfig( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable File _file, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/registry/v2/orchestrationConfigs/import"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + if( _file != null ) + localVarFormParams.put("file", _file); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "multipart/form-data" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * List orchestration config history + * + * @param scenario + * (required) + * @param version + * (required) + * @param name + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param includeSpec + * (optional, default to false) + * @param resolveTemplateRef + * (optional, default to false) + * @return OrchestrationConfigListResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigListResponse listOrchestrationConfigHistory( + @javax.annotation.Nonnull String scenario, + @javax.annotation.Nonnull String version, + @javax.annotation.Nonnull String name, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable Boolean includeSpec, + @javax.annotation.Nullable Boolean resolveTemplateRef ) + throws ApiException + { + return this + .listOrchestrationConfigHistory( + scenario, + version, + name, + aiResourceGroup, + includeSpec, + resolveTemplateRef, + Collections.emptyMap()); + } + + /** + * + * List orchestration config history + * + * @param scenario + * (required) + * @param version + * (required) + * @param name + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param includeSpec + * (optional, default to false) + * @param resolveTemplateRef + * (optional, default to false) + * @param additionalHeaders + * additionalHeaders for this call + * @return OrchestrationConfigListResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigListResponse listOrchestrationConfigHistory( + @javax.annotation.Nonnull String scenario, + @javax.annotation.Nonnull String version, + @javax.annotation.Nonnull String name, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable Boolean includeSpec, + @javax.annotation.Nullable Boolean resolveTemplateRef, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'scenario' is set + if( scenario == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'scenario' when calling listOrchestrationConfigHistory"); + } + + // verify the required parameter 'version' is set + if( version == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'version' when calling listOrchestrationConfigHistory"); + } + + // verify the required parameter 'name' is set + if( name == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'name' when calling listOrchestrationConfigHistory"); + } + + // create path and map variables + String localVarPath = + "/registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history" + .replaceAll("\\{" + "scenario" + "\\}", apiClient.escapeString(apiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(apiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(apiClient.parameterToString(name))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("include_spec", includeSpec)); + localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * List orchestration configs + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param scenario + * (optional) + * @param name + * (optional) + * @param version + * (optional) + * @param retrieve + * (optional, default to both) + * @param includeSpec + * (optional, default to false) + * @param resolveTemplateRef + * (optional, default to false) + * @return OrchestrationConfigListResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigListResponse listOrchestrationConfigs( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String scenario, + @javax.annotation.Nullable String name, + @javax.annotation.Nullable String version, + @javax.annotation.Nullable String retrieve, + @javax.annotation.Nullable Boolean includeSpec, + @javax.annotation.Nullable Boolean resolveTemplateRef ) + throws ApiException + { + return this + .listOrchestrationConfigs( + aiResourceGroup, + scenario, + name, + version, + retrieve, + includeSpec, + resolveTemplateRef, + Collections.emptyMap()); + } + + /** + * + * List orchestration configs + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param scenario + * (optional) + * @param name + * (optional) + * @param version + * (optional) + * @param retrieve + * (optional, default to both) + * @param includeSpec + * (optional, default to false) + * @param resolveTemplateRef + * (optional, default to false) + * @param additionalHeaders + * additionalHeaders for this call + * @return OrchestrationConfigListResponse + * @throws ApiException + * if fails to make API call + */ + public OrchestrationConfigListResponse listOrchestrationConfigs( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String scenario, + @javax.annotation.Nullable String name, + @javax.annotation.Nullable String version, + @javax.annotation.Nullable String retrieve, + @javax.annotation.Nullable Boolean includeSpec, + @javax.annotation.Nullable Boolean resolveTemplateRef, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/registry/v2/orchestrationConfigs"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("scenario", scenario)); + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + localVarQueryParams.addAll(apiClient.parameterToPair("version", version)); + localVarQueryParams.addAll(apiClient.parameterToPair("retrieve", retrieve)); + localVarQueryParams.addAll(apiClient.parameterToPair("include_spec", includeSpec)); + localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + @Override + public T invokeAPI( + String url, + String method, + Object request, + TypeReference returnType, + Map additionalHeaders ) + throws ApiException + { + String localVarPath = url.replace(apiClient.getBaseURL(), ""); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + return apiClient + .invokeAPI( + localVarPath, + method, + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + request, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + returnType); + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java new file mode 100644 index 000000000..4fb3e9f73 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -0,0 +1,1173 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.api; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateDeleteResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateGetResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateListResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplatePostRequest; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplatePostResponse; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateSubstitutionRequest; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateSubstitutionResponse; +import com.sap.cloud.sdk.services.openapi.apache.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.ApiException; +import com.sap.cloud.sdk.services.openapi.apache.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.Configuration; +import com.sap.cloud.sdk.services.openapi.apache.Pair; + +public class PromptTemplatesApi extends BaseApi +{ + + public PromptTemplatesApi() + { + super(Configuration.getDefaultApiClient()); + } + + public PromptTemplatesApi( ApiClient apiClient ) + { + super(apiClient); + } + + /** + * + * Create or update a prompt template + * + * @param promptTemplatePostRequest + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @return PromptTemplatePostResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplatePostResponse createUpdatePromptTemplate( + @javax.annotation.Nonnull PromptTemplatePostRequest promptTemplatePostRequest, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope ) + throws ApiException + { + return this + .createUpdatePromptTemplate( + promptTemplatePostRequest, + aiResourceGroup, + aiResourceGroupScope, + Collections.emptyMap()); + } + + /** + * + * Create or update a prompt template + * + * @param promptTemplatePostRequest + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplatePostResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplatePostResponse createUpdatePromptTemplate( + @javax.annotation.Nonnull PromptTemplatePostRequest promptTemplatePostRequest, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = promptTemplatePostRequest; + + // verify the required parameter 'promptTemplatePostRequest' is set + if( promptTemplatePostRequest == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'promptTemplatePostRequest' when calling createUpdatePromptTemplate"); + } + + // create path and map variables + String localVarPath = "/lm/promptTemplates"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Delete prompt template + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @return PromptTemplateDeleteResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateDeleteResponse deletePromptTemplate( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope ) + throws ApiException + { + return this + .deletePromptTemplate(promptTemplateId, aiResourceGroup, aiResourceGroupScope, Collections.emptyMap()); + } + + /** + * + * Delete prompt template + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplateDeleteResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateDeleteResponse deletePromptTemplate( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'promptTemplateId' is set + if( promptTemplateId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'promptTemplateId' when calling deletePromptTemplate"); + } + + // create path and map variables + String localVarPath = + "/lm/promptTemplates/{promptTemplateId}" + .replaceAll( + "\\{" + "promptTemplateId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Export prompt template + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @return File + * @throws ApiException + * if fails to make API call + */ + public File exportPromptTemplate( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope ) + throws ApiException + { + return this + .exportPromptTemplate(promptTemplateId, aiResourceGroup, aiResourceGroupScope, Collections.emptyMap()); + } + + /** + * + * Export prompt template + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return File + * @throws ApiException + * if fails to make API call + */ + public File exportPromptTemplate( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'promptTemplateId' is set + if( promptTemplateId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'promptTemplateId' when calling exportPromptTemplate"); + } + + // create path and map variables + String localVarPath = + "/lm/promptTemplates/{promptTemplateId}/export" + .replaceAll( + "\\{" + "promptTemplateId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/octet-stream", "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Get prompt template by UUID + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @return PromptTemplateGetResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateGetResponse getPromptTemplateByUuid( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope ) + throws ApiException + { + return this + .getPromptTemplateByUuid(promptTemplateId, aiResourceGroup, aiResourceGroupScope, Collections.emptyMap()); + } + + /** + * + * Get prompt template by UUID + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplateGetResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateGetResponse getPromptTemplateByUuid( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'promptTemplateId' is set + if( promptTemplateId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'promptTemplateId' when calling getPromptTemplateByUuid"); + } + + // create path and map variables + String localVarPath = + "/lm/promptTemplates/{promptTemplateId}" + .replaceAll( + "\\{" + "promptTemplateId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Import prompt template + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param _file + * (optional) + * @return PromptTemplatePostResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplatePostResponse importPromptTemplate( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable File _file ) + throws ApiException + { + return this.importPromptTemplate(aiResourceGroup, aiResourceGroupScope, _file, Collections.emptyMap()); + } + + /** + * + * Import prompt template + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param _file + * (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplatePostResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplatePostResponse importPromptTemplate( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable File _file, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/lm/promptTemplates/import"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + if( _file != null ) + localVarFormParams.put("file", _file); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "multipart/form-data" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * List prompt template history + * + * @param scenario + * (required) + * @param version + * (required) + * @param name + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @return PromptTemplateListResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateListResponse listPromptTemplateHistory( + @javax.annotation.Nonnull String scenario, + @javax.annotation.Nonnull String version, + @javax.annotation.Nonnull String name, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope ) + throws ApiException + { + return this + .listPromptTemplateHistory( + scenario, + version, + name, + aiResourceGroup, + aiResourceGroupScope, + Collections.emptyMap()); + } + + /** + * + * List prompt template history + * + * @param scenario + * (required) + * @param version + * (required) + * @param name + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplateListResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateListResponse listPromptTemplateHistory( + @javax.annotation.Nonnull String scenario, + @javax.annotation.Nonnull String version, + @javax.annotation.Nonnull String name, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // verify the required parameter 'scenario' is set + if( scenario == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'scenario' when calling listPromptTemplateHistory"); + } + + // verify the required parameter 'version' is set + if( version == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'version' when calling listPromptTemplateHistory"); + } + + // verify the required parameter 'name' is set + if( name == null ) { + throw new ApiException(400, "Missing the required parameter 'name' when calling listPromptTemplateHistory"); + } + + // create path and map variables + String localVarPath = + "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history" + .replaceAll("\\{" + "scenario" + "\\}", apiClient.escapeString(apiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(apiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(apiClient.parameterToString(name))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * List prompt templates + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param scenario + * (optional) + * @param name + * (optional) + * @param version + * (optional) + * @param retrieve + * (optional, default to both) + * @param includeSpec + * (optional, default to false) + * @return PromptTemplateListResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateListResponse listPromptTemplates( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable String scenario, + @javax.annotation.Nullable String name, + @javax.annotation.Nullable String version, + @javax.annotation.Nullable String retrieve, + @javax.annotation.Nullable Boolean includeSpec ) + throws ApiException + { + return this + .listPromptTemplates( + aiResourceGroup, + aiResourceGroupScope, + scenario, + name, + version, + retrieve, + includeSpec, + Collections.emptyMap()); + } + + /** + * + * List prompt templates + * + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param scenario + * (optional) + * @param name + * (optional) + * @param version + * (optional) + * @param retrieve + * (optional, default to both) + * @param includeSpec + * (optional, default to false) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplateListResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateListResponse listPromptTemplates( + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable String scenario, + @javax.annotation.Nullable String name, + @javax.annotation.Nullable String version, + @javax.annotation.Nullable String retrieve, + @javax.annotation.Nullable Boolean includeSpec, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/lm/promptTemplates"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("scenario", scenario)); + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + localVarQueryParams.addAll(apiClient.parameterToPair("version", version)); + localVarQueryParams.addAll(apiClient.parameterToPair("retrieve", retrieve)); + localVarQueryParams.addAll(apiClient.parameterToPair("includeSpec", includeSpec)); + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Parse prompt template by ID + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param metadata + * (optional, default to false) + * @param promptTemplateSubstitutionRequest + * (optional) + * @return PromptTemplateSubstitutionResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateSubstitutionResponse parsePromptTemplateById( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable Boolean metadata, + @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) + throws ApiException + { + return this + .parsePromptTemplateById( + promptTemplateId, + aiResourceGroup, + aiResourceGroupScope, + metadata, + promptTemplateSubstitutionRequest, + Collections.emptyMap()); + } + + /** + * + * Parse prompt template by ID + * + * @param promptTemplateId + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param metadata + * (optional, default to false) + * @param promptTemplateSubstitutionRequest + * (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplateSubstitutionResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateSubstitutionResponse parsePromptTemplateById( + @javax.annotation.Nonnull UUID promptTemplateId, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable Boolean metadata, + @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = promptTemplateSubstitutionRequest; + + // verify the required parameter 'promptTemplateId' is set + if( promptTemplateId == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'promptTemplateId' when calling parsePromptTemplateById"); + } + + // create path and map variables + String localVarPath = + "/lm/promptTemplates/{promptTemplateId}/substitution" + .replaceAll( + "\\{" + "promptTemplateId" + "\\}", + apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("metadata", metadata)); + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * + * Parse prompt template by name and version + * + * @param scenario + * (required) + * @param version + * (required) + * @param name + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param metadata + * (optional, default to false) + * @param promptTemplateSubstitutionRequest + * (optional) + * @return PromptTemplateSubstitutionResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( + @javax.annotation.Nonnull String scenario, + @javax.annotation.Nonnull String version, + @javax.annotation.Nonnull String name, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable Boolean metadata, + @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) + throws ApiException + { + return this + .parsePromptTemplateByNameVersion( + scenario, + version, + name, + aiResourceGroup, + aiResourceGroupScope, + metadata, + promptTemplateSubstitutionRequest, + Collections.emptyMap()); + } + + /** + * + * Parse prompt template by name and version + * + * @param scenario + * (required) + * @param version + * (required) + * @param name + * (required) + * @param aiResourceGroup + * Specify a resource group id to use (optional) + * @param aiResourceGroupScope + * Specify whether the resource group scope is to be used (optional) + * @param metadata + * (optional, default to false) + * @param promptTemplateSubstitutionRequest + * (optional) + * @param additionalHeaders + * additionalHeaders for this call + * @return PromptTemplateSubstitutionResponse + * @throws ApiException + * if fails to make API call + */ + public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( + @javax.annotation.Nonnull String scenario, + @javax.annotation.Nonnull String version, + @javax.annotation.Nonnull String name, + @javax.annotation.Nullable String aiResourceGroup, + @javax.annotation.Nullable String aiResourceGroupScope, + @javax.annotation.Nullable Boolean metadata, + @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest, + Map additionalHeaders ) + throws ApiException + { + Object localVarPostBody = promptTemplateSubstitutionRequest; + + // verify the required parameter 'scenario' is set + if( scenario == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'scenario' when calling parsePromptTemplateByNameVersion"); + } + + // verify the required parameter 'version' is set + if( version == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'version' when calling parsePromptTemplateByNameVersion"); + } + + // verify the required parameter 'name' is set + if( name == null ) { + throw new ApiException( + 400, + "Missing the required parameter 'name' when calling parsePromptTemplateByNameVersion"); + } + + // create path and map variables + String localVarPath = + "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution" + .replaceAll("\\{" + "scenario" + "\\}", apiClient.escapeString(apiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(apiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(apiClient.parameterToString(name))); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("metadata", metadata)); + if( aiResourceGroup != null ) + localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + if( aiResourceGroupScope != null ) + localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + TypeReference localVarReturnType = + new TypeReference() + { + }; + return apiClient + .invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + @Override + public T invokeAPI( + String url, + String method, + Object request, + TypeReference returnType, + Map additionalHeaders ) + throws ApiException + { + String localVarPath = url.replace(apiClient.getBaseURL(), ""); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { "application/json" }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { "application/json" }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + return apiClient + .invokeAPI( + localVarPath, + method, + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + request, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + returnType); + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java new file mode 100644 index 000000000..bad1e31cf --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java @@ -0,0 +1,414 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * AssistantChatMessage + */ + +@Beta // CHECKSTYLE:OFF +public class AssistantChatMessage implements ChatMessage +// CHECKSTYLE:ON +{ + /** + * Gets or Sets role + */ + public enum RoleEnum + { + /** + * The ASSISTANT option of this AssistantChatMessage + */ + ASSISTANT("assistant"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this AssistantChatMessage + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum( 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 AssistantChatMessage + */ + @JsonCreator + @Nonnull + public static RoleEnum fromValue( @Nonnull final String value ) + { + for( RoleEnum b : RoleEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "role" ) + private RoleEnum role; + + @JsonProperty( "content" ) + private ChatMessageContent content; + + @JsonProperty( "refusal" ) + private String refusal; + + @JsonProperty( "tool_calls" ) + private List toolCalls = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AssistantChatMessage. + */ + protected AssistantChatMessage() + { + } + + /** + * Set the role of this {@link AssistantChatMessage} instance and return the same instance. + * + * @param role + * The role of this {@link AssistantChatMessage} + * @return The same instance of this {@link AssistantChatMessage} class + */ + @Nonnull + public AssistantChatMessage role( @Nonnull final RoleEnum role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link AssistantChatMessage} instance. + */ + @Nonnull + public RoleEnum getRole() + { + return role; + } + + /** + * Set the role of this {@link AssistantChatMessage} instance. + * + * @param role + * The role of this {@link AssistantChatMessage} + */ + public void setRole( @Nonnull final RoleEnum role ) + { + this.role = role; + } + + /** + * Set the content of this {@link AssistantChatMessage} instance and return the same instance. + * + * @param content + * The content of this {@link AssistantChatMessage} + * @return The same instance of this {@link AssistantChatMessage} class + */ + @Nonnull + public AssistantChatMessage content( @Nullable final ChatMessageContent content ) + { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link AssistantChatMessage} instance. + */ + @Nonnull + public ChatMessageContent getContent() + { + return content; + } + + /** + * Set the content of this {@link AssistantChatMessage} instance. + * + * @param content + * The content of this {@link AssistantChatMessage} + */ + public void setContent( @Nullable final ChatMessageContent content ) + { + this.content = content; + } + + /** + * Set the refusal of this {@link AssistantChatMessage} instance and return the same instance. + * + * @param refusal + * The refusal of this {@link AssistantChatMessage} + * @return The same instance of this {@link AssistantChatMessage} class + */ + @Nonnull + public AssistantChatMessage refusal( @Nullable final String refusal ) + { + this.refusal = refusal; + return this; + } + + /** + * Get refusal + * + * @return refusal The refusal of this {@link AssistantChatMessage} instance. + */ + @Nonnull + public String getRefusal() + { + return refusal; + } + + /** + * Set the refusal of this {@link AssistantChatMessage} instance. + * + * @param refusal + * The refusal of this {@link AssistantChatMessage} + */ + public void setRefusal( @Nullable final String refusal ) + { + this.refusal = refusal; + } + + /** + * Set the toolCalls of this {@link AssistantChatMessage} instance and return the same instance. + * + * @param toolCalls + * The tool calls generated by the model, such as function calls. + * @return The same instance of this {@link AssistantChatMessage} class + */ + @Nonnull + public AssistantChatMessage toolCalls( @Nullable final List toolCalls ) + { + this.toolCalls = toolCalls; + return this; + } + + /** + * Add one toolCalls instance to this {@link AssistantChatMessage}. + * + * @param toolCallsItem + * The toolCalls that should be added + * @return The same instance of type {@link AssistantChatMessage} + */ + @Nonnull + public AssistantChatMessage addToolCallsItem( @Nonnull final MessageToolCall toolCallsItem ) + { + if( this.toolCalls == null ) { + this.toolCalls = new ArrayList<>(); + } + this.toolCalls.add(toolCallsItem); + return this; + } + + /** + * The tool calls generated by the model, such as function calls. + * + * @return toolCalls The toolCalls of this {@link AssistantChatMessage} instance. + */ + @Nonnull + public List getToolCalls() + { + return toolCalls; + } + + /** + * Set the toolCalls of this {@link AssistantChatMessage} instance. + * + * @param toolCalls + * The tool calls generated by the model, such as function calls. + */ + public void setToolCalls( @Nullable final List toolCalls ) + { + this.toolCalls = toolCalls; + } + + /** + * Get the names of the unrecognizable properties of the {@link AssistantChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AssistantChatMessage} 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("AssistantChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AssistantChatMessage} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( role != null ) + declaredFields.put("role", role); + if( content != null ) + declaredFields.put("content", content); + if( refusal != null ) + declaredFields.put("refusal", refusal); + if( toolCalls != null ) + declaredFields.put("toolCalls", toolCalls); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AssistantChatMessage} 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 AssistantChatMessage assistantChatMessage = (AssistantChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, assistantChatMessage.cloudSdkCustomFields) + && Objects.equals(this.role, assistantChatMessage.role) + && Objects.equals(this.content, assistantChatMessage.content) + && Objects.equals(this.refusal, assistantChatMessage.refusal) + && Objects.equals(this.toolCalls, assistantChatMessage.toolCalls); + } + + @Override + public int hashCode() + { + return Objects.hash(role, content, refusal, toolCalls, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AssistantChatMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" refusal: ").append(toIndentedString(refusal)).append("\n"); + sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java new file mode 100644 index 000000000..499774e0a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Filter configuration for Azure Content Safety + */ + +@Beta // CHECKSTYLE:OFF +public class AzureContentSafetyInput +// CHECKSTYLE:ON +{ + @JsonProperty( "hate" ) + private AzureThreshold hate; + + @JsonProperty( "self_harm" ) + private AzureThreshold selfHarm; + + @JsonProperty( "sexual" ) + private AzureThreshold sexual; + + @JsonProperty( "violence" ) + private AzureThreshold violence; + + @JsonProperty( "prompt_shield" ) + private Boolean promptShield = false; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AzureContentSafetyInput. + */ + protected AzureContentSafetyInput() + { + } + + /** + * Set the hate of this {@link AzureContentSafetyInput} instance and return the same instance. + * + * @param hate + * The hate of this {@link AzureContentSafetyInput} + * @return The same instance of this {@link AzureContentSafetyInput} class + */ + @Nonnull + public AzureContentSafetyInput hate( @Nullable final AzureThreshold hate ) + { + this.hate = hate; + return this; + } + + /** + * Get hate + * + * @return hate The hate of this {@link AzureContentSafetyInput} instance. + */ + @Nonnull + public AzureThreshold getHate() + { + return hate; + } + + /** + * Set the hate of this {@link AzureContentSafetyInput} instance. + * + * @param hate + * The hate of this {@link AzureContentSafetyInput} + */ + public void setHate( @Nullable final AzureThreshold hate ) + { + this.hate = hate; + } + + /** + * Set the selfHarm of this {@link AzureContentSafetyInput} instance and return the same instance. + * + * @param selfHarm + * The selfHarm of this {@link AzureContentSafetyInput} + * @return The same instance of this {@link AzureContentSafetyInput} class + */ + @Nonnull + public AzureContentSafetyInput selfHarm( @Nullable final AzureThreshold selfHarm ) + { + this.selfHarm = selfHarm; + return this; + } + + /** + * Get selfHarm + * + * @return selfHarm The selfHarm of this {@link AzureContentSafetyInput} instance. + */ + @Nonnull + public AzureThreshold getSelfHarm() + { + return selfHarm; + } + + /** + * Set the selfHarm of this {@link AzureContentSafetyInput} instance. + * + * @param selfHarm + * The selfHarm of this {@link AzureContentSafetyInput} + */ + public void setSelfHarm( @Nullable final AzureThreshold selfHarm ) + { + this.selfHarm = selfHarm; + } + + /** + * Set the sexual of this {@link AzureContentSafetyInput} instance and return the same instance. + * + * @param sexual + * The sexual of this {@link AzureContentSafetyInput} + * @return The same instance of this {@link AzureContentSafetyInput} class + */ + @Nonnull + public AzureContentSafetyInput sexual( @Nullable final AzureThreshold sexual ) + { + this.sexual = sexual; + return this; + } + + /** + * Get sexual + * + * @return sexual The sexual of this {@link AzureContentSafetyInput} instance. + */ + @Nonnull + public AzureThreshold getSexual() + { + return sexual; + } + + /** + * Set the sexual of this {@link AzureContentSafetyInput} instance. + * + * @param sexual + * The sexual of this {@link AzureContentSafetyInput} + */ + public void setSexual( @Nullable final AzureThreshold sexual ) + { + this.sexual = sexual; + } + + /** + * Set the violence of this {@link AzureContentSafetyInput} instance and return the same instance. + * + * @param violence + * The violence of this {@link AzureContentSafetyInput} + * @return The same instance of this {@link AzureContentSafetyInput} class + */ + @Nonnull + public AzureContentSafetyInput violence( @Nullable final AzureThreshold violence ) + { + this.violence = violence; + return this; + } + + /** + * Get violence + * + * @return violence The violence of this {@link AzureContentSafetyInput} instance. + */ + @Nonnull + public AzureThreshold getViolence() + { + return violence; + } + + /** + * Set the violence of this {@link AzureContentSafetyInput} instance. + * + * @param violence + * The violence of this {@link AzureContentSafetyInput} + */ + public void setViolence( @Nullable final AzureThreshold violence ) + { + this.violence = violence; + } + + /** + * Set the promptShield of this {@link AzureContentSafetyInput} instance and return the same instance. + * + * @param promptShield + * Filter prompts for harmful content such as jailbreaks and prompt injections. + * @return The same instance of this {@link AzureContentSafetyInput} class + */ + @Nonnull + public AzureContentSafetyInput promptShield( @Nullable final Boolean promptShield ) + { + this.promptShield = promptShield; + return this; + } + + /** + * Filter prompts for harmful content such as jailbreaks and prompt injections. + * + * @return promptShield The promptShield of this {@link AzureContentSafetyInput} instance. + */ + @Nonnull + public Boolean isPromptShield() + { + return promptShield; + } + + /** + * Set the promptShield of this {@link AzureContentSafetyInput} instance. + * + * @param promptShield + * Filter prompts for harmful content such as jailbreaks and prompt injections. + */ + public void setPromptShield( @Nullable final Boolean promptShield ) + { + this.promptShield = promptShield; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureContentSafetyInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentSafetyInput} 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("AzureContentSafetyInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentSafetyInput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( hate != null ) + declaredFields.put("hate", hate); + if( selfHarm != null ) + declaredFields.put("selfHarm", selfHarm); + if( sexual != null ) + declaredFields.put("sexual", sexual); + if( violence != null ) + declaredFields.put("violence", violence); + if( promptShield != null ) + declaredFields.put("promptShield", promptShield); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentSafetyInput} 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 AzureContentSafetyInput azureContentSafetyInput = (AzureContentSafetyInput) o; + return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyInput.cloudSdkCustomFields) + && Objects.equals(this.hate, azureContentSafetyInput.hate) + && Objects.equals(this.selfHarm, azureContentSafetyInput.selfHarm) + && Objects.equals(this.sexual, azureContentSafetyInput.sexual) + && Objects.equals(this.violence, azureContentSafetyInput.violence) + && Objects.equals(this.promptShield, azureContentSafetyInput.promptShield); + } + + @Override + public int hashCode() + { + return Objects.hash(hate, selfHarm, sexual, violence, promptShield, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentSafetyInput {\n"); + sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); + sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); + sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n"); + sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); + sb.append(" promptShield: ").append(toIndentedString(promptShield)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java new file mode 100644 index 000000000..d244a4f45 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * AzureContentSafetyInputFilterConfig + */ + +@Beta // CHECKSTYLE:OFF +public class AzureContentSafetyInputFilterConfig implements InputFilterConfig +// CHECKSTYLE:ON +{ + /** + * Name of the filter provider type + */ + public enum TypeEnum + { + /** + * The AZURE_CONTENT_SAFETY option of this AzureContentSafetyInputFilterConfig + */ + AZURE_CONTENT_SAFETY("azure_content_safety"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this AzureContentSafetyInputFilterConfig + */ + 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 AzureContentSafetyInputFilterConfig + */ + @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 AzureContentSafetyInput config; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AzureContentSafetyInputFilterConfig. + */ + protected AzureContentSafetyInputFilterConfig() + { + } + + /** + * Set the type of this {@link AzureContentSafetyInputFilterConfig} instance and return the same instance. + * + * @param type + * Name of the filter provider type + * @return The same instance of this {@link AzureContentSafetyInputFilterConfig} class + */ + @Nonnull + public AzureContentSafetyInputFilterConfig type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Name of the filter provider type + * + * @return type The type of this {@link AzureContentSafetyInputFilterConfig} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link AzureContentSafetyInputFilterConfig} instance. + * + * @param type + * Name of the filter provider type + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the config of this {@link AzureContentSafetyInputFilterConfig} instance and return the same instance. + * + * @param config + * The config of this {@link AzureContentSafetyInputFilterConfig} + * @return The same instance of this {@link AzureContentSafetyInputFilterConfig} class + */ + @Nonnull + public AzureContentSafetyInputFilterConfig config( @Nullable final AzureContentSafetyInput config ) + { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link AzureContentSafetyInputFilterConfig} instance. + */ + @Nonnull + public AzureContentSafetyInput getConfig() + { + return config; + } + + /** + * Set the config of this {@link AzureContentSafetyInputFilterConfig} instance. + * + * @param config + * The config of this {@link AzureContentSafetyInputFilterConfig} + */ + public void setConfig( @Nullable final AzureContentSafetyInput config ) + { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureContentSafetyInputFilterConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentSafetyInputFilterConfig} 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( + "AzureContentSafetyInputFilterConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentSafetyInputFilterConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( config != null ) + declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentSafetyInputFilterConfig} 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 AzureContentSafetyInputFilterConfig azureContentSafetyInputFilterConfig = + (AzureContentSafetyInputFilterConfig) o; + return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyInputFilterConfig.cloudSdkCustomFields) + && Objects.equals(this.type, azureContentSafetyInputFilterConfig.type) + && Objects.equals(this.config, azureContentSafetyInputFilterConfig.config); + } + + @Override + public int hashCode() + { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentSafetyInputFilterConfig {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java new file mode 100644 index 000000000..16620fcb6 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Filter configuration for Azure Content Safety + */ + +@Beta // CHECKSTYLE:OFF +public class AzureContentSafetyOutput +// CHECKSTYLE:ON +{ + @JsonProperty( "hate" ) + private AzureThreshold hate; + + @JsonProperty( "self_harm" ) + private AzureThreshold selfHarm; + + @JsonProperty( "sexual" ) + private AzureThreshold sexual; + + @JsonProperty( "violence" ) + private AzureThreshold violence; + + @JsonProperty( "protected_material_code" ) + private Boolean protectedMaterialCode = false; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AzureContentSafetyOutput. + */ + protected AzureContentSafetyOutput() + { + } + + /** + * Set the hate of this {@link AzureContentSafetyOutput} instance and return the same instance. + * + * @param hate + * The hate of this {@link AzureContentSafetyOutput} + * @return The same instance of this {@link AzureContentSafetyOutput} class + */ + @Nonnull + public AzureContentSafetyOutput hate( @Nullable final AzureThreshold hate ) + { + this.hate = hate; + return this; + } + + /** + * Get hate + * + * @return hate The hate of this {@link AzureContentSafetyOutput} instance. + */ + @Nonnull + public AzureThreshold getHate() + { + return hate; + } + + /** + * Set the hate of this {@link AzureContentSafetyOutput} instance. + * + * @param hate + * The hate of this {@link AzureContentSafetyOutput} + */ + public void setHate( @Nullable final AzureThreshold hate ) + { + this.hate = hate; + } + + /** + * Set the selfHarm of this {@link AzureContentSafetyOutput} instance and return the same instance. + * + * @param selfHarm + * The selfHarm of this {@link AzureContentSafetyOutput} + * @return The same instance of this {@link AzureContentSafetyOutput} class + */ + @Nonnull + public AzureContentSafetyOutput selfHarm( @Nullable final AzureThreshold selfHarm ) + { + this.selfHarm = selfHarm; + return this; + } + + /** + * Get selfHarm + * + * @return selfHarm The selfHarm of this {@link AzureContentSafetyOutput} instance. + */ + @Nonnull + public AzureThreshold getSelfHarm() + { + return selfHarm; + } + + /** + * Set the selfHarm of this {@link AzureContentSafetyOutput} instance. + * + * @param selfHarm + * The selfHarm of this {@link AzureContentSafetyOutput} + */ + public void setSelfHarm( @Nullable final AzureThreshold selfHarm ) + { + this.selfHarm = selfHarm; + } + + /** + * Set the sexual of this {@link AzureContentSafetyOutput} instance and return the same instance. + * + * @param sexual + * The sexual of this {@link AzureContentSafetyOutput} + * @return The same instance of this {@link AzureContentSafetyOutput} class + */ + @Nonnull + public AzureContentSafetyOutput sexual( @Nullable final AzureThreshold sexual ) + { + this.sexual = sexual; + return this; + } + + /** + * Get sexual + * + * @return sexual The sexual of this {@link AzureContentSafetyOutput} instance. + */ + @Nonnull + public AzureThreshold getSexual() + { + return sexual; + } + + /** + * Set the sexual of this {@link AzureContentSafetyOutput} instance. + * + * @param sexual + * The sexual of this {@link AzureContentSafetyOutput} + */ + public void setSexual( @Nullable final AzureThreshold sexual ) + { + this.sexual = sexual; + } + + /** + * Set the violence of this {@link AzureContentSafetyOutput} instance and return the same instance. + * + * @param violence + * The violence of this {@link AzureContentSafetyOutput} + * @return The same instance of this {@link AzureContentSafetyOutput} class + */ + @Nonnull + public AzureContentSafetyOutput violence( @Nullable final AzureThreshold violence ) + { + this.violence = violence; + return this; + } + + /** + * Get violence + * + * @return violence The violence of this {@link AzureContentSafetyOutput} instance. + */ + @Nonnull + public AzureThreshold getViolence() + { + return violence; + } + + /** + * Set the violence of this {@link AzureContentSafetyOutput} instance. + * + * @param violence + * The violence of this {@link AzureContentSafetyOutput} + */ + public void setViolence( @Nullable final AzureThreshold violence ) + { + this.violence = violence; + } + + /** + * Set the protectedMaterialCode of this {@link AzureContentSafetyOutput} instance and return the same instance. + * + * @param protectedMaterialCode + * Detect protected code content from known GitHub repositories. The scan includes software libraries, + * source code, algorithms, and other proprietary programming content. + * @return The same instance of this {@link AzureContentSafetyOutput} class + */ + @Nonnull + public AzureContentSafetyOutput protectedMaterialCode( @Nullable final Boolean protectedMaterialCode ) + { + this.protectedMaterialCode = protectedMaterialCode; + return this; + } + + /** + * Detect protected code content from known GitHub repositories. The scan includes software libraries, source code, + * algorithms, and other proprietary programming content. + * + * @return protectedMaterialCode The protectedMaterialCode of this {@link AzureContentSafetyOutput} instance. + */ + @Nonnull + public Boolean isProtectedMaterialCode() + { + return protectedMaterialCode; + } + + /** + * Set the protectedMaterialCode of this {@link AzureContentSafetyOutput} instance. + * + * @param protectedMaterialCode + * Detect protected code content from known GitHub repositories. The scan includes software libraries, + * source code, algorithms, and other proprietary programming content. + */ + public void setProtectedMaterialCode( @Nullable final Boolean protectedMaterialCode ) + { + this.protectedMaterialCode = protectedMaterialCode; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureContentSafetyOutput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentSafetyOutput} 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("AzureContentSafetyOutput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentSafetyOutput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( hate != null ) + declaredFields.put("hate", hate); + if( selfHarm != null ) + declaredFields.put("selfHarm", selfHarm); + if( sexual != null ) + declaredFields.put("sexual", sexual); + if( violence != null ) + declaredFields.put("violence", violence); + if( protectedMaterialCode != null ) + declaredFields.put("protectedMaterialCode", protectedMaterialCode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentSafetyOutput} 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 AzureContentSafetyOutput azureContentSafetyOutput = (AzureContentSafetyOutput) o; + return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyOutput.cloudSdkCustomFields) + && Objects.equals(this.hate, azureContentSafetyOutput.hate) + && Objects.equals(this.selfHarm, azureContentSafetyOutput.selfHarm) + && Objects.equals(this.sexual, azureContentSafetyOutput.sexual) + && Objects.equals(this.violence, azureContentSafetyOutput.violence) + && Objects.equals(this.protectedMaterialCode, azureContentSafetyOutput.protectedMaterialCode); + } + + @Override + public int hashCode() + { + return Objects.hash(hate, selfHarm, sexual, violence, protectedMaterialCode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentSafetyOutput {\n"); + sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); + sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); + sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n"); + sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); + sb.append(" protectedMaterialCode: ").append(toIndentedString(protectedMaterialCode)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java new file mode 100644 index 000000000..1353dd435 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * AzureContentSafetyOutputFilterConfig + */ + +@Beta // CHECKSTYLE:OFF +public class AzureContentSafetyOutputFilterConfig implements OutputFilterConfig +// CHECKSTYLE:ON +{ + /** + * Name of the filter provider type + */ + public enum TypeEnum + { + /** + * The AZURE_CONTENT_SAFETY option of this AzureContentSafetyOutputFilterConfig + */ + AZURE_CONTENT_SAFETY("azure_content_safety"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this AzureContentSafetyOutputFilterConfig + */ + 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 AzureContentSafetyOutputFilterConfig + */ + @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 AzureContentSafetyOutput config; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AzureContentSafetyOutputFilterConfig. + */ + protected AzureContentSafetyOutputFilterConfig() + { + } + + /** + * Set the type of this {@link AzureContentSafetyOutputFilterConfig} instance and return the same instance. + * + * @param type + * Name of the filter provider type + * @return The same instance of this {@link AzureContentSafetyOutputFilterConfig} class + */ + @Nonnull + public AzureContentSafetyOutputFilterConfig type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Name of the filter provider type + * + * @return type The type of this {@link AzureContentSafetyOutputFilterConfig} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link AzureContentSafetyOutputFilterConfig} instance. + * + * @param type + * Name of the filter provider type + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the config of this {@link AzureContentSafetyOutputFilterConfig} instance and return the same instance. + * + * @param config + * The config of this {@link AzureContentSafetyOutputFilterConfig} + * @return The same instance of this {@link AzureContentSafetyOutputFilterConfig} class + */ + @Nonnull + public AzureContentSafetyOutputFilterConfig config( @Nullable final AzureContentSafetyOutput config ) + { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link AzureContentSafetyOutputFilterConfig} instance. + */ + @Nonnull + public AzureContentSafetyOutput getConfig() + { + return config; + } + + /** + * Set the config of this {@link AzureContentSafetyOutputFilterConfig} instance. + * + * @param config + * The config of this {@link AzureContentSafetyOutputFilterConfig} + */ + public void setConfig( @Nullable final AzureContentSafetyOutput config ) + { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureContentSafetyOutputFilterConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentSafetyOutputFilterConfig} 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( + "AzureContentSafetyOutputFilterConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentSafetyOutputFilterConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( config != null ) + declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentSafetyOutputFilterConfig} 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 AzureContentSafetyOutputFilterConfig azureContentSafetyOutputFilterConfig = + (AzureContentSafetyOutputFilterConfig) o; + return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyOutputFilterConfig.cloudSdkCustomFields) + && Objects.equals(this.type, azureContentSafetyOutputFilterConfig.type) + && Objects.equals(this.config, azureContentSafetyOutputFilterConfig.config); + } + + @Override + public int hashCode() + { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentSafetyOutputFilterConfig {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java new file mode 100644 index 000000000..fb7df9c8d --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import javax.annotation.Nonnull; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Gets or Sets AzureThreshold + */ + +@Beta +public enum AzureThreshold +{ + + NUMBER_0(0), + + NUMBER_2(2), + + NUMBER_4(4), + + NUMBER_6(6), + + NUMBER_unknown_default_open_api(11184809); + + private final Integer value; + + AzureThreshold( Integer value ) + { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public Integer 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 AzureThreshold fromValue( @Nonnull final Integer value ) + { + for( final AzureThreshold b : AzureThreshold.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return NUMBER_unknown_default_open_api; + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java new file mode 100644 index 000000000..803eb5a21 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * ChatCompletionTool + */ + +@Beta // CHECKSTYLE:OFF +public class ChatCompletionTool +// CHECKSTYLE:ON +{ + /** + * The type of the tool. Currently, only `function` is supported. + */ + public enum TypeEnum + { + /** + * The FUNCTION option of this ChatCompletionTool + */ + FUNCTION("function"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this ChatCompletionTool + */ + 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 ChatCompletionTool + */ + @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( "function" ) + private FunctionObject function; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ChatCompletionTool. + */ + protected ChatCompletionTool() + { + } + + /** + * Set the type of this {@link ChatCompletionTool} instance and return the same instance. + * + * @param type + * The type of the tool. Currently, only `function` is supported. + * @return The same instance of this {@link ChatCompletionTool} class + */ + @Nonnull + public ChatCompletionTool type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * The type of the tool. Currently, only `function` is supported. + * + * @return type The type of this {@link ChatCompletionTool} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link ChatCompletionTool} instance. + * + * @param type + * The type of the tool. Currently, only `function` is supported. + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the function of this {@link ChatCompletionTool} instance and return the same instance. + * + * @param function + * The function of this {@link ChatCompletionTool} + * @return The same instance of this {@link ChatCompletionTool} class + */ + @Nonnull + public ChatCompletionTool function( @Nonnull final FunctionObject function ) + { + this.function = function; + return this; + } + + /** + * Get function + * + * @return function The function of this {@link ChatCompletionTool} instance. + */ + @Nonnull + public FunctionObject getFunction() + { + return function; + } + + /** + * Set the function of this {@link ChatCompletionTool} instance. + * + * @param function + * The function of this {@link ChatCompletionTool} + */ + public void setFunction( @Nonnull final FunctionObject function ) + { + this.function = function; + } + + /** + * Get the names of the unrecognizable properties of the {@link ChatCompletionTool}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ChatCompletionTool} 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("ChatCompletionTool has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ChatCompletionTool} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( function != null ) + declaredFields.put("function", function); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ChatCompletionTool} 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 ChatCompletionTool chatCompletionTool = (ChatCompletionTool) o; + return Objects.equals(this.cloudSdkCustomFields, chatCompletionTool.cloudSdkCustomFields) + && Objects.equals(this.type, chatCompletionTool.type) + && Objects.equals(this.function, chatCompletionTool.function); + } + + @Override + public int hashCode() + { + return Objects.hash(type, function, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ChatCompletionTool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java new file mode 100644 index 000000000..ac6e70339 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * ChatMessage + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = AssistantChatMessage.class ), + @JsonSubTypes.Type( value = DeveloperChatMessage.class ), + @JsonSubTypes.Type( value = SystemChatMessage.class ), + @JsonSubTypes.Type( value = ToolChatMessage.class ), + @JsonSubTypes.Type( value = UserChatMessage.class ), } ) + +public interface ChatMessage +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java new file mode 100644 index 000000000..b89cdc2a3 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.List; + +import javax.annotation.Nonnull; + +import com.google.common.annotations.Beta; + +/** + * ChatMessageContent + */ +@Beta +public interface ChatMessageContent +{ + /** + * Helper class to create {@code List } that implements {@link ChatMessageContent}. + */ + record ListOfTextContents(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatMessageContent {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val + * the value to use + * @return a new instance of {@link ListOfTextContents}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfTextContents createListOfTextContents( @Nonnull final List val ) + { + return new ListOfTextContents(val); + } + + /** + * Helper class to create {@code String } that implements {@link ChatMessageContent}. + */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatMessageContent {} + + /** + * 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); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java new file mode 100644 index 000000000..b6a28ae28 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java @@ -0,0 +1,545 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * DPIConfig + */ + +@Beta // CHECKSTYLE:OFF +public class DPIConfig +// CHECKSTYLE:ON +{ + /** + * Type of masking service provider + */ + public enum TypeEnum + { + /** + * The SAP_DATA_PRIVACY_INTEGRATION option of this DPIConfig + */ + SAP_DATA_PRIVACY_INTEGRATION("sap_data_privacy_integration"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this DPIConfig + */ + 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 DPIConfig + */ + @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; + + /** + * Type of masking method to be used + */ + public enum MethodEnum + { + /** + * The ANONYMIZATION option of this DPIConfig + */ + ANONYMIZATION("anonymization"), + + /** + * The PSEUDONYMIZATION option of this DPIConfig + */ + PSEUDONYMIZATION("pseudonymization"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this DPIConfig + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MethodEnum( 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 DPIConfig + */ + @JsonCreator + @Nonnull + public static MethodEnum fromValue( @Nonnull final String value ) + { + for( MethodEnum b : MethodEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "method" ) + private MethodEnum method; + + @JsonProperty( "entities" ) + private List entities = new ArrayList<>(); + + @JsonProperty( "allowlist" ) + private List allowlist = new ArrayList<>(); + + @JsonProperty( "mask_grounding_input" ) + private DPIConfigMaskGroundingInput maskGroundingInput; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DPIConfig. + */ + protected DPIConfig() + { + } + + /** + * Set the type of this {@link DPIConfig} instance and return the same instance. + * + * @param type + * Type of masking service provider + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Type of masking service provider + * + * @return type The type of this {@link DPIConfig} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link DPIConfig} instance. + * + * @param type + * Type of masking service provider + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the method of this {@link DPIConfig} instance and return the same instance. + * + * @param method + * Type of masking method to be used + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig method( @Nonnull final MethodEnum method ) + { + this.method = method; + return this; + } + + /** + * Type of masking method to be used + * + * @return method The method of this {@link DPIConfig} instance. + */ + @Nonnull + public MethodEnum getMethod() + { + return method; + } + + /** + * Set the method of this {@link DPIConfig} instance. + * + * @param method + * Type of masking method to be used + */ + public void setMethod( @Nonnull final MethodEnum method ) + { + this.method = method; + } + + /** + * Set the entities of this {@link DPIConfig} instance and return the same instance. + * + * @param entities + * List of entities to be masked + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig entities( @Nonnull final List entities ) + { + this.entities = entities; + return this; + } + + /** + * Add one entities instance to this {@link DPIConfig}. + * + * @param entitiesItem + * The entities that should be added + * @return The same instance of type {@link DPIConfig} + */ + @Nonnull + public DPIConfig addEntitiesItem( @Nonnull final DPIEntityConfig entitiesItem ) + { + if( this.entities == null ) { + this.entities = new ArrayList<>(); + } + this.entities.add(entitiesItem); + return this; + } + + /** + * List of entities to be masked + * + * @return entities The entities of this {@link DPIConfig} instance. + */ + @Nonnull + public List getEntities() + { + return entities; + } + + /** + * Set the entities of this {@link DPIConfig} instance. + * + * @param entities + * List of entities to be masked + */ + public void setEntities( @Nonnull final List entities ) + { + this.entities = entities; + } + + /** + * Set the allowlist of this {@link DPIConfig} instance and return the same instance. + * + * @param allowlist + * List of strings that should not be masked + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig allowlist( @Nullable final List allowlist ) + { + this.allowlist = allowlist; + return this; + } + + /** + * Add one allowlist instance to this {@link DPIConfig}. + * + * @param allowlistItem + * The allowlist that should be added + * @return The same instance of type {@link DPIConfig} + */ + @Nonnull + public DPIConfig addAllowlistItem( @Nonnull final String allowlistItem ) + { + if( this.allowlist == null ) { + this.allowlist = new ArrayList<>(); + } + this.allowlist.add(allowlistItem); + return this; + } + + /** + * List of strings that should not be masked + * + * @return allowlist The allowlist of this {@link DPIConfig} instance. + */ + @Nonnull + public List getAllowlist() + { + return allowlist; + } + + /** + * Set the allowlist of this {@link DPIConfig} instance. + * + * @param allowlist + * List of strings that should not be masked + */ + public void setAllowlist( @Nullable final List allowlist ) + { + this.allowlist = allowlist; + } + + /** + * Set the maskGroundingInput of this {@link DPIConfig} instance and return the same instance. + * + * @param maskGroundingInput + * The maskGroundingInput of this {@link DPIConfig} + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig maskGroundingInput( @Nullable final DPIConfigMaskGroundingInput maskGroundingInput ) + { + this.maskGroundingInput = maskGroundingInput; + return this; + } + + /** + * Get maskGroundingInput + * + * @return maskGroundingInput The maskGroundingInput of this {@link DPIConfig} instance. + */ + @Nonnull + public DPIConfigMaskGroundingInput getMaskGroundingInput() + { + return maskGroundingInput; + } + + /** + * Set the maskGroundingInput of this {@link DPIConfig} instance. + * + * @param maskGroundingInput + * The maskGroundingInput of this {@link DPIConfig} + */ + public void setMaskGroundingInput( @Nullable final DPIConfigMaskGroundingInput maskGroundingInput ) + { + this.maskGroundingInput = maskGroundingInput; + } + + /** + * Get the names of the unrecognizable properties of the {@link DPIConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DPIConfig} 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("DPIConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DPIConfig} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( method != null ) + declaredFields.put("method", method); + if( entities != null ) + declaredFields.put("entities", entities); + if( allowlist != null ) + declaredFields.put("allowlist", allowlist); + if( maskGroundingInput != null ) + declaredFields.put("maskGroundingInput", maskGroundingInput); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DPIConfig} 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 DPIConfig dpIConfig = (DPIConfig) o; + return Objects.equals(this.cloudSdkCustomFields, dpIConfig.cloudSdkCustomFields) + && Objects.equals(this.type, dpIConfig.type) + && Objects.equals(this.method, dpIConfig.method) + && Objects.equals(this.entities, dpIConfig.entities) + && Objects.equals(this.allowlist, dpIConfig.allowlist) + && Objects.equals(this.maskGroundingInput, dpIConfig.maskGroundingInput); + } + + @Override + public int hashCode() + { + return Objects.hash(type, method, entities, allowlist, maskGroundingInput, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DPIConfig {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); + sb.append(" allowlist: ").append(toIndentedString(allowlist)).append("\n"); + sb.append(" maskGroundingInput: ").append(toIndentedString(maskGroundingInput)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java new file mode 100644 index 000000000..6b386e048 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * DPIConfigMaskGroundingInput + */ + +@Beta // CHECKSTYLE:OFF +public class DPIConfigMaskGroundingInput +// CHECKSTYLE:ON +{ + @JsonProperty( "enabled" ) + private Boolean enabled = false; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DPIConfigMaskGroundingInput. + */ + protected DPIConfigMaskGroundingInput() + { + } + + /** + * Set the enabled of this {@link DPIConfigMaskGroundingInput} instance and return the same instance. + * + * @param enabled + * controls whether the input to the grounding module will be masked with the configuration supplied in + * the masking module + * @return The same instance of this {@link DPIConfigMaskGroundingInput} class + */ + @Nonnull + public DPIConfigMaskGroundingInput enabled( @Nullable final Boolean enabled ) + { + this.enabled = enabled; + return this; + } + + /** + * controls whether the input to the grounding module will be masked with the configuration supplied in the masking + * module + * + * @return enabled The enabled of this {@link DPIConfigMaskGroundingInput} instance. + */ + @Nonnull + public Boolean isEnabled() + { + return enabled; + } + + /** + * Set the enabled of this {@link DPIConfigMaskGroundingInput} instance. + * + * @param enabled + * controls whether the input to the grounding module will be masked with the configuration supplied in + * the masking module + */ + public void setEnabled( @Nullable final Boolean enabled ) + { + this.enabled = enabled; + } + + /** + * Get the names of the unrecognizable properties of the {@link DPIConfigMaskGroundingInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DPIConfigMaskGroundingInput} 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("DPIConfigMaskGroundingInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DPIConfigMaskGroundingInput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( enabled != null ) + declaredFields.put("enabled", enabled); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DPIConfigMaskGroundingInput} 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 DPIConfigMaskGroundingInput dpIConfigMaskGroundingInput = (DPIConfigMaskGroundingInput) o; + return Objects.equals(this.cloudSdkCustomFields, dpIConfigMaskGroundingInput.cloudSdkCustomFields) + && Objects.equals(this.enabled, dpIConfigMaskGroundingInput.enabled); + } + + @Override + public int hashCode() + { + return Objects.hash(enabled, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DPIConfigMaskGroundingInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java new file mode 100644 index 000000000..3dad3a337 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * DPICustomEntity + */ + +@Beta // CHECKSTYLE:OFF +public class DPICustomEntity implements DPIEntityConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "regex" ) + private String regex; + + @JsonProperty( "replacement_strategy" ) + private DPIMethodConstant replacementStrategy; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DPICustomEntity. + */ + protected DPICustomEntity() + { + } + + /** + * Set the regex of this {@link DPICustomEntity} instance and return the same instance. + * + * @param regex + * Regular expression to match the entity + * @return The same instance of this {@link DPICustomEntity} class + */ + @Nonnull + public DPICustomEntity regex( @Nonnull final String regex ) + { + this.regex = regex; + return this; + } + + /** + * Regular expression to match the entity + * + * @return regex The regex of this {@link DPICustomEntity} instance. + */ + @Nonnull + public String getRegex() + { + return regex; + } + + /** + * Set the regex of this {@link DPICustomEntity} instance. + * + * @param regex + * Regular expression to match the entity + */ + public void setRegex( @Nonnull final String regex ) + { + this.regex = regex; + } + + /** + * Set the replacementStrategy of this {@link DPICustomEntity} instance and return the same instance. + * + * @param replacementStrategy + * The replacementStrategy of this {@link DPICustomEntity} + * @return The same instance of this {@link DPICustomEntity} class + */ + @Nonnull + public DPICustomEntity replacementStrategy( @Nonnull final DPIMethodConstant replacementStrategy ) + { + this.replacementStrategy = replacementStrategy; + return this; + } + + /** + * Get replacementStrategy + * + * @return replacementStrategy The replacementStrategy of this {@link DPICustomEntity} instance. + */ + @Nonnull + public DPIMethodConstant getReplacementStrategy() + { + return replacementStrategy; + } + + /** + * Set the replacementStrategy of this {@link DPICustomEntity} instance. + * + * @param replacementStrategy + * The replacementStrategy of this {@link DPICustomEntity} + */ + public void setReplacementStrategy( @Nonnull final DPIMethodConstant replacementStrategy ) + { + this.replacementStrategy = replacementStrategy; + } + + /** + * Get the names of the unrecognizable properties of the {@link DPICustomEntity}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DPICustomEntity} 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("DPICustomEntity has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DPICustomEntity} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( regex != null ) + declaredFields.put("regex", regex); + if( replacementStrategy != null ) + declaredFields.put("replacementStrategy", replacementStrategy); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DPICustomEntity} 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 DPICustomEntity dpICustomEntity = (DPICustomEntity) o; + return Objects.equals(this.cloudSdkCustomFields, dpICustomEntity.cloudSdkCustomFields) + && Objects.equals(this.regex, dpICustomEntity.regex) + && Objects.equals(this.replacementStrategy, dpICustomEntity.replacementStrategy); + } + + @Override + public int hashCode() + { + return Objects.hash(regex, replacementStrategy, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DPICustomEntity {\n"); + sb.append(" regex: ").append(toIndentedString(regex)).append("\n"); + sb.append(" replacementStrategy: ").append(toIndentedString(replacementStrategy)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java new file mode 100644 index 000000000..8c8acdcec --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import javax.annotation.Nonnull; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Default entities supported by data privacy and integration service + */ + +@Beta +public enum DPIEntities +{ + + PROFILE_PERSON("profile-person"), + + PROFILE_ORG("profile-org"), + + PROFILE_UNIVERSITY("profile-university"), + + PROFILE_LOCATION("profile-location"), + + PROFILE_EMAIL("profile-email"), + + PROFILE_PHONE("profile-phone"), + + PROFILE_ADDRESS("profile-address"), + + PROFILE_SAPIDS_INTERNAL("profile-sapids-internal"), + + PROFILE_SAPIDS_PUBLIC("profile-sapids-public"), + + PROFILE_URL("profile-url"), + + PROFILE_USERNAME_PASSWORD("profile-username-password"), + + PROFILE_NATIONALID("profile-nationalid"), + + PROFILE_IBAN("profile-iban"), + + PROFILE_SSN("profile-ssn"), + + PROFILE_CREDIT_CARD_NUMBER("profile-credit-card-number"), + + PROFILE_PASSPORT("profile-passport"), + + PROFILE_DRIVERLICENSE("profile-driverlicense"), + + PROFILE_NATIONALITY("profile-nationality"), + + PROFILE_RELIGIOUS_GROUP("profile-religious-group"), + + PROFILE_POLITICAL_GROUP("profile-political-group"), + + PROFILE_PRONOUNS_GENDER("profile-pronouns-gender"), + + PROFILE_ETHNICITY("profile-ethnicity"), + + PROFILE_GENDER("profile-gender"), + + PROFILE_SEXUAL_ORIENTATION("profile-sexual-orientation"), + + PROFILE_TRADE_UNION("profile-trade-union"), + + PROFILE_SENSITIVE_DATA("profile-sensitive-data"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + DPIEntities( 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 DPIEntities fromValue( @Nonnull final String value ) + { + for( final DPIEntities b : DPIEntities.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java new file mode 100644 index 000000000..cf8526425 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * DPIEntityConfig + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = DPICustomEntity.class ), + @JsonSubTypes.Type( value = DPIStandardEntity.class ), } ) + +public interface DPIEntityConfig +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java new file mode 100644 index 000000000..13d5bc1dc --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Replaces the entity with the specified value followed by an incrementing number + */ + +@Beta // CHECKSTYLE:OFF +public class DPIMethodConstant implements DPIStandardEntityReplacementStrategy +// CHECKSTYLE:ON +{ + /** + * Gets or Sets method + */ + public enum MethodEnum + { + /** + * The CONSTANT option of this DPIMethodConstant + */ + CONSTANT("constant"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this DPIMethodConstant + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MethodEnum( 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 DPIMethodConstant + */ + @JsonCreator + @Nonnull + public static MethodEnum fromValue( @Nonnull final String value ) + { + for( MethodEnum b : MethodEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "method" ) + private MethodEnum method; + + @JsonProperty( "value" ) + private String value; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DPIMethodConstant. + */ + protected DPIMethodConstant() + { + } + + /** + * Set the method of this {@link DPIMethodConstant} instance and return the same instance. + * + * @param method + * The method of this {@link DPIMethodConstant} + * @return The same instance of this {@link DPIMethodConstant} class + */ + @Nonnull + public DPIMethodConstant method( @Nonnull final MethodEnum method ) + { + this.method = method; + return this; + } + + /** + * Get method + * + * @return method The method of this {@link DPIMethodConstant} instance. + */ + @Nonnull + public MethodEnum getMethod() + { + return method; + } + + /** + * Set the method of this {@link DPIMethodConstant} instance. + * + * @param method + * The method of this {@link DPIMethodConstant} + */ + public void setMethod( @Nonnull final MethodEnum method ) + { + this.method = method; + } + + /** + * Set the value of this {@link DPIMethodConstant} instance and return the same instance. + * + * @param value + * Value to be used for replacement + * @return The same instance of this {@link DPIMethodConstant} class + */ + @Nonnull + public DPIMethodConstant value( @Nonnull final String value ) + { + this.value = value; + return this; + } + + /** + * Value to be used for replacement + * + * @return value The value of this {@link DPIMethodConstant} instance. + */ + @Nonnull + public String getValue() + { + return value; + } + + /** + * Set the value of this {@link DPIMethodConstant} instance. + * + * @param value + * Value to be used for replacement + */ + public void setValue( @Nonnull final String value ) + { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link DPIMethodConstant}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DPIMethodConstant} 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("DPIMethodConstant has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DPIMethodConstant} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( method != null ) + declaredFields.put("method", method); + if( value != null ) + declaredFields.put("value", value); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DPIMethodConstant} 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 DPIMethodConstant dpIMethodConstant = (DPIMethodConstant) o; + return Objects.equals(this.cloudSdkCustomFields, dpIMethodConstant.cloudSdkCustomFields) + && Objects.equals(this.method, dpIMethodConstant.method) + && Objects.equals(this.value, dpIMethodConstant.value); + } + + @Override + public int hashCode() + { + return Objects.hash(method, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DPIMethodConstant {\n"); + sb.append(" method: ").append(toIndentedString(method)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java new file mode 100644 index 000000000..564581c2b --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Replaces the entity with a randomly generated value appropriate to its type. + */ + +@Beta // CHECKSTYLE:OFF +public class DPIMethodFabricatedData implements DPIStandardEntityReplacementStrategy +// CHECKSTYLE:ON +{ + /** + * Gets or Sets method + */ + public enum MethodEnum + { + /** + * The FABRICATED_DATA option of this DPIMethodFabricatedData + */ + FABRICATED_DATA("fabricated_data"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this DPIMethodFabricatedData + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MethodEnum( 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 DPIMethodFabricatedData + */ + @JsonCreator + @Nonnull + public static MethodEnum fromValue( @Nonnull final String value ) + { + for( MethodEnum b : MethodEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "method" ) + private MethodEnum method; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DPIMethodFabricatedData. + */ + protected DPIMethodFabricatedData() + { + } + + /** + * Set the method of this {@link DPIMethodFabricatedData} instance and return the same instance. + * + * @param method + * The method of this {@link DPIMethodFabricatedData} + * @return The same instance of this {@link DPIMethodFabricatedData} class + */ + @Nonnull + public DPIMethodFabricatedData method( @Nonnull final MethodEnum method ) + { + this.method = method; + return this; + } + + /** + * Get method + * + * @return method The method of this {@link DPIMethodFabricatedData} instance. + */ + @Nonnull + public MethodEnum getMethod() + { + return method; + } + + /** + * Set the method of this {@link DPIMethodFabricatedData} instance. + * + * @param method + * The method of this {@link DPIMethodFabricatedData} + */ + public void setMethod( @Nonnull final MethodEnum method ) + { + this.method = method; + } + + /** + * Get the names of the unrecognizable properties of the {@link DPIMethodFabricatedData}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DPIMethodFabricatedData} 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("DPIMethodFabricatedData has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DPIMethodFabricatedData} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( method != null ) + declaredFields.put("method", method); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DPIMethodFabricatedData} 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 DPIMethodFabricatedData dpIMethodFabricatedData = (DPIMethodFabricatedData) o; + return Objects.equals(this.cloudSdkCustomFields, dpIMethodFabricatedData.cloudSdkCustomFields) + && Objects.equals(this.method, dpIMethodFabricatedData.method); + } + + @Override + public int hashCode() + { + return Objects.hash(method, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DPIMethodFabricatedData {\n"); + sb.append(" method: ").append(toIndentedString(method)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java new file mode 100644 index 000000000..64cce67e4 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * DPIStandardEntity + */ + +@Beta // CHECKSTYLE:OFF +public class DPIStandardEntity implements DPIEntityConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "type" ) + private DPIEntities type; + + @JsonProperty( "replacement_strategy" ) + private DPIStandardEntityReplacementStrategy replacementStrategy; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DPIStandardEntity. + */ + protected DPIStandardEntity() + { + } + + /** + * Set the type of this {@link DPIStandardEntity} instance and return the same instance. + * + * @param type + * The type of this {@link DPIStandardEntity} + * @return The same instance of this {@link DPIStandardEntity} class + */ + @Nonnull + public DPIStandardEntity type( @Nonnull final DPIEntities type ) + { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link DPIStandardEntity} instance. + */ + @Nonnull + public DPIEntities getType() + { + return type; + } + + /** + * Set the type of this {@link DPIStandardEntity} instance. + * + * @param type + * The type of this {@link DPIStandardEntity} + */ + public void setType( @Nonnull final DPIEntities type ) + { + this.type = type; + } + + /** + * Set the replacementStrategy of this {@link DPIStandardEntity} instance and return the same instance. + * + * @param replacementStrategy + * The replacementStrategy of this {@link DPIStandardEntity} + * @return The same instance of this {@link DPIStandardEntity} class + */ + @Nonnull + public DPIStandardEntity replacementStrategy( + @Nullable final DPIStandardEntityReplacementStrategy replacementStrategy ) + { + this.replacementStrategy = replacementStrategy; + return this; + } + + /** + * Get replacementStrategy + * + * @return replacementStrategy The replacementStrategy of this {@link DPIStandardEntity} instance. + */ + @Nonnull + public DPIStandardEntityReplacementStrategy getReplacementStrategy() + { + return replacementStrategy; + } + + /** + * Set the replacementStrategy of this {@link DPIStandardEntity} instance. + * + * @param replacementStrategy + * The replacementStrategy of this {@link DPIStandardEntity} + */ + public void setReplacementStrategy( @Nullable final DPIStandardEntityReplacementStrategy replacementStrategy ) + { + this.replacementStrategy = replacementStrategy; + } + + /** + * Get the names of the unrecognizable properties of the {@link DPIStandardEntity}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DPIStandardEntity} 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("DPIStandardEntity has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DPIStandardEntity} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( replacementStrategy != null ) + declaredFields.put("replacementStrategy", replacementStrategy); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DPIStandardEntity} 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 DPIStandardEntity dpIStandardEntity = (DPIStandardEntity) o; + return Objects.equals(this.cloudSdkCustomFields, dpIStandardEntity.cloudSdkCustomFields) + && Objects.equals(this.type, dpIStandardEntity.type) + && Objects.equals(this.replacementStrategy, dpIStandardEntity.replacementStrategy); + } + + @Override + public int hashCode() + { + return Objects.hash(type, replacementStrategy, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DPIStandardEntity {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" replacementStrategy: ").append(toIndentedString(replacementStrategy)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java new file mode 100644 index 000000000..64f03bdcf --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * Replacement strategy to be used for the entity + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = DPIMethodConstant.class ), + @JsonSubTypes.Type( value = DPIMethodFabricatedData.class ), } ) + +public interface DPIStandardEntityReplacementStrategy +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java new file mode 100644 index 000000000..ea712242f --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import javax.annotation.Nonnull; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Only include DataRepositories with the given type. + */ + +@Beta +public enum DataRepositoryType +{ + + VECTOR("vector"), + + HELP_SAP_COM("help.sap.com"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + DataRepositoryType( String value ) + { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() + { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() + { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value + * The input value. + * + * @return The enum representation of the given value. + */ + @JsonCreator + public static DataRepositoryType fromValue( @Nonnull final String value ) + { + for( final DataRepositoryType b : DataRepositoryType.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java new file mode 100644 index 000000000..c3c17e4c8 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * DeveloperChatMessage + */ + +@Beta // CHECKSTYLE:OFF +public class DeveloperChatMessage implements ChatMessage +// CHECKSTYLE:ON +{ + /** + * Gets or Sets role + */ + public enum RoleEnum + { + /** + * The DEVELOPER option of this DeveloperChatMessage + */ + DEVELOPER("developer"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this DeveloperChatMessage + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum( 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 DeveloperChatMessage + */ + @JsonCreator + @Nonnull + public static RoleEnum fromValue( @Nonnull final String value ) + { + for( RoleEnum b : RoleEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "role" ) + private RoleEnum role; + + @JsonProperty( "content" ) + private ChatMessageContent content; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DeveloperChatMessage. + */ + protected DeveloperChatMessage() + { + } + + /** + * Set the role of this {@link DeveloperChatMessage} instance and return the same instance. + * + * @param role + * The role of this {@link DeveloperChatMessage} + * @return The same instance of this {@link DeveloperChatMessage} class + */ + @Nonnull + public DeveloperChatMessage role( @Nonnull final RoleEnum role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link DeveloperChatMessage} instance. + */ + @Nonnull + public RoleEnum getRole() + { + return role; + } + + /** + * Set the role of this {@link DeveloperChatMessage} instance. + * + * @param role + * The role of this {@link DeveloperChatMessage} + */ + public void setRole( @Nonnull final RoleEnum role ) + { + this.role = role; + } + + /** + * Set the content of this {@link DeveloperChatMessage} instance and return the same instance. + * + * @param content + * The content of this {@link DeveloperChatMessage} + * @return The same instance of this {@link DeveloperChatMessage} class + */ + @Nonnull + public DeveloperChatMessage content( @Nonnull final ChatMessageContent content ) + { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link DeveloperChatMessage} instance. + */ + @Nonnull + public ChatMessageContent getContent() + { + return content; + } + + /** + * Set the content of this {@link DeveloperChatMessage} instance. + * + * @param content + * The content of this {@link DeveloperChatMessage} + */ + public void setContent( @Nonnull final ChatMessageContent content ) + { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link DeveloperChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DeveloperChatMessage} 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("DeveloperChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DeveloperChatMessage} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( role != null ) + declaredFields.put("role", role); + if( content != null ) + declaredFields.put("content", content); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DeveloperChatMessage} 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 DeveloperChatMessage developerChatMessage = (DeveloperChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, developerChatMessage.cloudSdkCustomFields) + && Objects.equals(this.role, developerChatMessage.role) + && Objects.equals(this.content, developerChatMessage.content); + } + + @Override + public int hashCode() + { + return Objects.hash(role, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DeveloperChatMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java new file mode 100644 index 000000000..46854776a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java @@ -0,0 +1,546 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * DocumentGroundingFilter + */ + +@Beta // CHECKSTYLE:OFF +public class DocumentGroundingFilter implements GroundingModuleConfigConfigFiltersInner +// CHECKSTYLE:ON +{ + @JsonProperty( "id" ) + private String id; + + @JsonProperty( "search_config" ) + private GroundingFilterSearchConfiguration searchConfig; + + @JsonProperty( "data_repositories" ) + private List dataRepositories = new ArrayList<>(Arrays.asList("*")); + + @JsonProperty( "data_repository_type" ) + private DataRepositoryType dataRepositoryType; + + @JsonProperty( "data_repository_metadata" ) + private List dataRepositoryMetadata = new ArrayList<>(); + + @JsonProperty( "document_metadata" ) + private List documentMetadata = new ArrayList<>(); + + @JsonProperty( "chunk_metadata" ) + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for DocumentGroundingFilter. + */ + protected DocumentGroundingFilter() + { + } + + /** + * Set the id of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param id + * Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter id( @Nullable final String id ) + { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public String getId() + { + return id; + } + + /** + * Set the id of this {@link DocumentGroundingFilter} instance. + * + * @param id + * Identifier of this SearchFilter - unique per request. + */ + public void setId( @Nullable final String id ) + { + this.id = id; + } + + /** + * Set the searchConfig of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param searchConfig + * The searchConfig of this {@link DocumentGroundingFilter} + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter searchConfig( @Nullable final GroundingFilterSearchConfiguration searchConfig ) + { + this.searchConfig = searchConfig; + return this; + } + + /** + * Get searchConfig + * + * @return searchConfig The searchConfig of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public GroundingFilterSearchConfiguration getSearchConfig() + { + return searchConfig; + } + + /** + * Set the searchConfig of this {@link DocumentGroundingFilter} instance. + * + * @param searchConfig + * The searchConfig of this {@link DocumentGroundingFilter} + */ + public void setSearchConfig( @Nullable final GroundingFilterSearchConfiguration searchConfig ) + { + this.searchConfig = searchConfig; + } + + /** + * Set the dataRepositories of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param dataRepositories + * Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository + * ids. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter dataRepositories( @Nullable final List dataRepositories ) + { + this.dataRepositories = dataRepositories; + return this; + } + + /** + * Add one dataRepositories instance to this {@link DocumentGroundingFilter}. + * + * @param dataRepositoriesItem + * The dataRepositories that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addDataRepositoriesItem( @Nonnull final String dataRepositoriesItem ) + { + if( this.dataRepositories == null ) { + this.dataRepositories = new ArrayList<>(Arrays.asList("*")); + } + this.dataRepositories.add(dataRepositoriesItem); + return this; + } + + /** + * Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. + * + * @return dataRepositories The dataRepositories of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getDataRepositories() + { + return dataRepositories; + } + + /** + * Set the dataRepositories of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositories + * Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository + * ids. + */ + public void setDataRepositories( @Nullable final List dataRepositories ) + { + this.dataRepositories = dataRepositories; + } + + /** + * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param dataRepositoryType + * The dataRepositoryType of this {@link DocumentGroundingFilter} + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter dataRepositoryType( @Nonnull final DataRepositoryType dataRepositoryType ) + { + this.dataRepositoryType = dataRepositoryType; + return this; + } + + /** + * Get dataRepositoryType + * + * @return dataRepositoryType The dataRepositoryType of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public DataRepositoryType getDataRepositoryType() + { + return dataRepositoryType; + } + + /** + * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositoryType + * The dataRepositoryType of this {@link DocumentGroundingFilter} + */ + public void setDataRepositoryType( @Nonnull final DataRepositoryType dataRepositoryType ) + { + this.dataRepositoryType = dataRepositoryType; + } + + /** + * Set the dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param dataRepositoryMetadata + * Restrict DataRepositories considered during search to those annotated with the given metadata. Useful + * when combined with dataRepositories=['*'] + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter dataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata ) + { + this.dataRepositoryMetadata = dataRepositoryMetadata; + return this; + } + + /** + * Add one dataRepositoryMetadata instance to this {@link DocumentGroundingFilter}. + * + * @param dataRepositoryMetadataItem + * The dataRepositoryMetadata that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addDataRepositoryMetadataItem( + @Nonnull final KeyValueListPair dataRepositoryMetadataItem ) + { + if( this.dataRepositoryMetadata == null ) { + this.dataRepositoryMetadata = new ArrayList<>(); + } + this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); + return this; + } + + /** + * Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when + * combined with dataRepositories=['*'] + * + * @return dataRepositoryMetadata The dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getDataRepositoryMetadata() + { + return dataRepositoryMetadata; + } + + /** + * Set the dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositoryMetadata + * Restrict DataRepositories considered during search to those annotated with the given metadata. Useful + * when combined with dataRepositories=['*'] + */ + public void setDataRepositoryMetadata( @Nullable final List dataRepositoryMetadata ) + { + this.dataRepositoryMetadata = dataRepositoryMetadata; + } + + /** + * Set the documentMetadata of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param documentMetadata + * Restrict documents considered during search to those annotated with the given metadata. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter documentMetadata( + @Nullable final List documentMetadata ) + { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link DocumentGroundingFilter}. + * + * @param documentMetadataItem + * The documentMetadata that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addDocumentMetadataItem( + @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem ) + { + if( this.documentMetadata == null ) { + this.documentMetadata = new ArrayList<>(); + } + this.documentMetadata.add(documentMetadataItem); + return this; + } + + /** + * Restrict documents considered during search to those annotated with the given metadata. + * + * @return documentMetadata The documentMetadata of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() + { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link DocumentGroundingFilter} instance. + * + * @param documentMetadata + * Restrict documents considered during search to those annotated with the given metadata. + */ + public void setDocumentMetadata( @Nullable final List documentMetadata ) + { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param chunkMetadata + * Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter chunkMetadata( @Nullable final List chunkMetadata ) + { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link DocumentGroundingFilter}. + * + * @param chunkMetadataItem + * The chunkMetadata that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addChunkMetadataItem( @Nonnull final KeyValueListPair chunkMetadataItem ) + { + if( this.chunkMetadata == null ) { + this.chunkMetadata = new ArrayList<>(); + } + this.chunkMetadata.add(chunkMetadataItem); + return this; + } + + /** + * Restrict chunks considered during search to those with the given metadata. + * + * @return chunkMetadata The chunkMetadata of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getChunkMetadata() + { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link DocumentGroundingFilter} instance. + * + * @param chunkMetadata + * Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata( @Nullable final List chunkMetadata ) + { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentGroundingFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentGroundingFilter} 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("DocumentGroundingFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DocumentGroundingFilter} 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( searchConfig != null ) + declaredFields.put("searchConfig", searchConfig); + if( dataRepositories != null ) + declaredFields.put("dataRepositories", dataRepositories); + if( dataRepositoryType != null ) + declaredFields.put("dataRepositoryType", dataRepositoryType); + if( dataRepositoryMetadata != null ) + declaredFields.put("dataRepositoryMetadata", dataRepositoryMetadata); + if( documentMetadata != null ) + declaredFields.put("documentMetadata", documentMetadata); + if( chunkMetadata != null ) + declaredFields.put("chunkMetadata", chunkMetadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DocumentGroundingFilter} 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 DocumentGroundingFilter documentGroundingFilter = (DocumentGroundingFilter) o; + return Objects.equals(this.cloudSdkCustomFields, documentGroundingFilter.cloudSdkCustomFields) + && Objects.equals(this.id, documentGroundingFilter.id) + && Objects.equals(this.searchConfig, documentGroundingFilter.searchConfig) + && Objects.equals(this.dataRepositories, documentGroundingFilter.dataRepositories) + && Objects.equals(this.dataRepositoryType, documentGroundingFilter.dataRepositoryType) + && Objects.equals(this.dataRepositoryMetadata, documentGroundingFilter.dataRepositoryMetadata) + && Objects.equals(this.documentMetadata, documentGroundingFilter.documentMetadata) + && Objects.equals(this.chunkMetadata, documentGroundingFilter.chunkMetadata); + } + + @Override + public int hashCode() + { + return Objects + .hash( + id, + searchConfig, + dataRepositories, + dataRepositoryType, + dataRepositoryMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentGroundingFilter {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" searchConfig: ").append(toIndentedString(searchConfig)).append("\n"); + sb.append(" dataRepositories: ").append(toIndentedString(dataRepositories)).append("\n"); + sb.append(" dataRepositoryType: ").append(toIndentedString(dataRepositoryType)).append("\n"); + sb.append(" dataRepositoryMetadata: ").append(toIndentedString(dataRepositoryMetadata)).append("\n"); + sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); + sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java new file mode 100644 index 000000000..449e750ee --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * ErrorResponse + */ + +@Beta // CHECKSTYLE:OFF +public class ErrorResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "request_id" ) + private String requestId; + + @JsonProperty( "message" ) + private String message; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ErrorResponse. + */ + protected ErrorResponse() + { + } + + /** + * Set the requestId of this {@link ErrorResponse} instance and return the same instance. + * + * @param requestId + * The requestId of this {@link ErrorResponse} + * @return The same instance of this {@link ErrorResponse} class + */ + @Nonnull + public ErrorResponse requestId( @Nonnull final String requestId ) + { + this.requestId = requestId; + return this; + } + + /** + * Get requestId + * + * @return requestId The requestId of this {@link ErrorResponse} instance. + */ + @Nonnull + public String getRequestId() + { + return requestId; + } + + /** + * Set the requestId of this {@link ErrorResponse} instance. + * + * @param requestId + * The requestId of this {@link ErrorResponse} + */ + public void setRequestId( @Nonnull final String requestId ) + { + this.requestId = requestId; + } + + /** + * Set the message of this {@link ErrorResponse} instance and return the same instance. + * + * @param message + * The message of this {@link ErrorResponse} + * @return The same instance of this {@link ErrorResponse} class + */ + @Nonnull + public ErrorResponse message( @Nonnull final String message ) + { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link ErrorResponse} instance. + */ + @Nonnull + public String getMessage() + { + return message; + } + + /** + * Set the message of this {@link ErrorResponse} instance. + * + * @param message + * The message of this {@link ErrorResponse} + */ + public void setMessage( @Nonnull final String message ) + { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link ErrorResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ErrorResponse} 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("ErrorResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ErrorResponse} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( requestId != null ) + declaredFields.put("requestId", requestId); + if( message != null ) + declaredFields.put("message", message); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ErrorResponse} 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 ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.cloudSdkCustomFields, errorResponse.cloudSdkCustomFields) + && Objects.equals(this.requestId, errorResponse.requestId) + && Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() + { + return Objects.hash(requestId, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java new file mode 100644 index 000000000..648ad36f8 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * FilteringModuleConfig + */ + +@Beta // CHECKSTYLE:OFF +public class FilteringModuleConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "input" ) + private InputFilteringConfig input; + + @JsonProperty( "output" ) + private OutputFilteringConfig output; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for FilteringModuleConfig. + */ + protected FilteringModuleConfig() + { + } + + /** + * Set the input of this {@link FilteringModuleConfig} instance and return the same instance. + * + * @param input + * List of provider type and filters + * @return The same instance of this {@link FilteringModuleConfig} class + */ + @Nonnull + public FilteringModuleConfig input( @Nullable final InputFilteringConfig input ) + { + this.input = input; + return this; + } + + /** + * List of provider type and filters + * + * @return input The input of this {@link FilteringModuleConfig} instance. + */ + @Nonnull + public InputFilteringConfig getInput() + { + return input; + } + + /** + * Set the input of this {@link FilteringModuleConfig} instance. + * + * @param input + * List of provider type and filters + */ + public void setInput( @Nullable final InputFilteringConfig input ) + { + this.input = input; + } + + /** + * Set the output of this {@link FilteringModuleConfig} instance and return the same instance. + * + * @param output + * List of provider type and filters + * @return The same instance of this {@link FilteringModuleConfig} class + */ + @Nonnull + public FilteringModuleConfig output( @Nullable final OutputFilteringConfig output ) + { + this.output = output; + return this; + } + + /** + * List of provider type and filters + * + * @return output The output of this {@link FilteringModuleConfig} instance. + */ + @Nonnull + public OutputFilteringConfig getOutput() + { + return output; + } + + /** + * Set the output of this {@link FilteringModuleConfig} instance. + * + * @param output + * List of provider type and filters + */ + public void setOutput( @Nullable final OutputFilteringConfig output ) + { + this.output = output; + } + + /** + * Get the names of the unrecognizable properties of the {@link FilteringModuleConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FilteringModuleConfig} 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("FilteringModuleConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FilteringModuleConfig} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( input != null ) + declaredFields.put("input", input); + if( output != null ) + declaredFields.put("output", output); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FilteringModuleConfig} 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 FilteringModuleConfig filteringModuleConfig = (FilteringModuleConfig) o; + return Objects.equals(this.cloudSdkCustomFields, filteringModuleConfig.cloudSdkCustomFields) + && Objects.equals(this.input, filteringModuleConfig.input) + && Objects.equals(this.output, filteringModuleConfig.output); + } + + @Override + public int hashCode() + { + return Objects.hash(input, output, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class FilteringModuleConfig {\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java new file mode 100644 index 000000000..77629a087 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Stream options for output filtering. Will be ignored if stream is false. + */ + +@Beta // CHECKSTYLE:OFF +public class FilteringStreamOptions +// CHECKSTYLE:ON +{ + @JsonProperty( "overlap" ) + private Integer overlap = 0; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for FilteringStreamOptions. + */ + protected FilteringStreamOptions() + { + } + + /** + * Set the overlap of this {@link FilteringStreamOptions} instance and return the same instance. + * + * @param overlap + * Number of characters that should be additionally sent to content filtering services from previous + * chunks as additional context. Minimum: 0 Maximum: 10000 + * @return The same instance of this {@link FilteringStreamOptions} class + */ + @Nonnull + public FilteringStreamOptions overlap( @Nullable final Integer overlap ) + { + this.overlap = overlap; + return this; + } + + /** + * Number of characters that should be additionally sent to content filtering services from previous chunks as + * additional context. minimum: 0 maximum: 10000 + * + * @return overlap The overlap of this {@link FilteringStreamOptions} instance. + */ + @Nonnull + public Integer getOverlap() + { + return overlap; + } + + /** + * Set the overlap of this {@link FilteringStreamOptions} instance. + * + * @param overlap + * Number of characters that should be additionally sent to content filtering services from previous + * chunks as additional context. Minimum: 0 Maximum: 10000 + */ + public void setOverlap( @Nullable final Integer overlap ) + { + this.overlap = overlap; + } + + /** + * Get the names of the unrecognizable properties of the {@link FilteringStreamOptions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FilteringStreamOptions} 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("FilteringStreamOptions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FilteringStreamOptions} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( overlap != null ) + declaredFields.put("overlap", overlap); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FilteringStreamOptions} 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 FilteringStreamOptions filteringStreamOptions = (FilteringStreamOptions) o; + return Objects.equals(this.cloudSdkCustomFields, filteringStreamOptions.cloudSdkCustomFields) + && Objects.equals(this.overlap, filteringStreamOptions.overlap); + } + + @Override + public int hashCode() + { + return Objects.hash(overlap, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class FilteringStreamOptions {\n"); + sb.append(" overlap: ").append(toIndentedString(overlap)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java new file mode 100644 index 000000000..93e7c7882 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * FunctionObject + */ + +@Beta // CHECKSTYLE:OFF +public class FunctionObject +// CHECKSTYLE:ON +{ + @JsonProperty( "description" ) + private String description; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "parameters" ) + private Map parameters = new HashMap<>(); + + @JsonProperty( "strict" ) + private Boolean strict = false; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for FunctionObject. + */ + protected FunctionObject() + { + } + + /** + * Set the description of this {@link FunctionObject} instance and return the same instance. + * + * @param description + * A description of what the function does, used by the model to choose when and how to call the + * function. + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject description( @Nullable final String description ) + { + this.description = description; + return this; + } + + /** + * A description of what the function does, used by the model to choose when and how to call the function. + * + * @return description The description of this {@link FunctionObject} instance. + */ + @Nonnull + public String getDescription() + { + return description; + } + + /** + * Set the description of this {@link FunctionObject} instance. + * + * @param description + * A description of what the function does, used by the model to choose when and how to call the + * function. + */ + public void setDescription( @Nullable final String description ) + { + this.description = description; + } + + /** + * Set the name of this {@link FunctionObject} instance and return the same instance. + * + * @param name + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with + * a maximum length of 64. + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum + * length of 64. + * + * @return name The name of this {@link FunctionObject} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link FunctionObject} instance. + * + * @param name + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with + * a maximum length of 64. + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the parameters of this {@link FunctionObject} instance and return the same instance. + * + * @param parameters + * The parameters the functions accepts, described as a JSON Schema object. See the + * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema + * reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + * Omitting `parameters` defines a function with an empty parameter list. + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject parameters( @Nullable final Map parameters ) + { + this.parameters = parameters; + return this; + } + + /** + * Put one parameters instance to this {@link FunctionObject} instance. + * + * @param key + * The String key of this parameters instance + * @param parametersItem + * The parameters that should be added under the given key + * @return The same instance of type {@link FunctionObject} + */ + @Nonnull + public FunctionObject putparametersItem( @Nonnull final String key, @Nullable final Object parametersItem ) + { + if( this.parameters == null ) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * The parameters the functions accepts, described as a JSON Schema object. See the + * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema + * reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting + * `parameters` defines a function with an empty parameter list. + * + * @return parameters The parameters of this {@link FunctionObject} instance. + */ + @Nonnull + public Map getParameters() + { + return parameters; + } + + /** + * Set the parameters of this {@link FunctionObject} instance. + * + * @param parameters + * The parameters the functions accepts, described as a JSON Schema object. See the + * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema + * reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + * Omitting `parameters` defines a function with an empty parameter list. + */ + public void setParameters( @Nullable final Map parameters ) + { + this.parameters = parameters; + } + + /** + * Set the strict of this {@link FunctionObject} instance and return the same instance. + * + * @param strict + * Whether to enable strict schema adherence when generating the function call. If set to true, the model + * will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema + * is supported when `strict` is `true`. Learn more about Structured Outputs in the + * [function calling guide](docs/guides/function-calling). + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject strict( @Nullable final Boolean strict ) + { + this.strict = strict; + return this; + } + + /** + * Whether to enable strict schema adherence when generating the function call. If set to true, the model will + * follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported + * when `strict` is `true`. Learn more about Structured Outputs in the [function calling + * guide](docs/guides/function-calling). + * + * @return strict The strict of this {@link FunctionObject} instance. + */ + @Nullable + public Boolean isStrict() + { + return strict; + } + + /** + * Set the strict of this {@link FunctionObject} instance. + * + * @param strict + * Whether to enable strict schema adherence when generating the function call. If set to true, the model + * will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema + * is supported when `strict` is `true`. Learn more about Structured Outputs in the + * [function calling guide](docs/guides/function-calling). + */ + public void setStrict( @Nullable final Boolean strict ) + { + this.strict = strict; + } + + /** + * Get the names of the unrecognizable properties of the {@link FunctionObject}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FunctionObject} 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("FunctionObject has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FunctionObject} 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( name != null ) + declaredFields.put("name", name); + if( parameters != null ) + declaredFields.put("parameters", parameters); + if( strict != null ) + declaredFields.put("strict", strict); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FunctionObject} 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 FunctionObject functionObject = (FunctionObject) o; + return Objects.equals(this.cloudSdkCustomFields, functionObject.cloudSdkCustomFields) + && Objects.equals(this.description, functionObject.description) + && Objects.equals(this.name, functionObject.name) + && Objects.equals(this.parameters, functionObject.parameters) + && Objects.equals(this.strict, functionObject.strict); + } + + @Override + public int hashCode() + { + return Objects.hash(description, name, parameters, strict, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class FunctionObject {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" strict: ").append(toIndentedString(strict)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java new file mode 100644 index 000000000..a79b819ef --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Options for streaming. Will be ignored if enabled is false. + */ + +@Beta // CHECKSTYLE:OFF +public class GlobalStreamOptions +// CHECKSTYLE:ON +{ + @JsonProperty( "enabled" ) + private Boolean enabled = false; + + @JsonProperty( "chunk_size" ) + private Integer chunkSize = 100; + + @JsonProperty( "delimiters" ) + private List delimiters = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for GlobalStreamOptions. + */ + protected GlobalStreamOptions() + { + } + + /** + * Set the enabled of this {@link GlobalStreamOptions} instance and return the same instance. + * + * @param enabled + * If true, the response will be streamed back to the client + * @return The same instance of this {@link GlobalStreamOptions} class + */ + @Nonnull + public GlobalStreamOptions enabled( @Nullable final Boolean enabled ) + { + this.enabled = enabled; + return this; + } + + /** + * If true, the response will be streamed back to the client + * + * @return enabled The enabled of this {@link GlobalStreamOptions} instance. + */ + @Nonnull + public Boolean isEnabled() + { + return enabled; + } + + /** + * Set the enabled of this {@link GlobalStreamOptions} instance. + * + * @param enabled + * If true, the response will be streamed back to the client + */ + public void setEnabled( @Nullable final Boolean enabled ) + { + this.enabled = enabled; + } + + /** + * Set the chunkSize of this {@link GlobalStreamOptions} instance and return the same instance. + * + * @param chunkSize + * Minimum number of characters per chunk that post-LLM modules operate on. Minimum: 1 Maximum: 10000 + * @return The same instance of this {@link GlobalStreamOptions} class + */ + @Nonnull + public GlobalStreamOptions chunkSize( @Nullable final Integer chunkSize ) + { + this.chunkSize = chunkSize; + return this; + } + + /** + * Minimum number of characters per chunk that post-LLM modules operate on. minimum: 1 maximum: 10000 + * + * @return chunkSize The chunkSize of this {@link GlobalStreamOptions} instance. + */ + @Nonnull + public Integer getChunkSize() + { + return chunkSize; + } + + /** + * Set the chunkSize of this {@link GlobalStreamOptions} instance. + * + * @param chunkSize + * Minimum number of characters per chunk that post-LLM modules operate on. Minimum: 1 Maximum: 10000 + */ + public void setChunkSize( @Nullable final Integer chunkSize ) + { + this.chunkSize = chunkSize; + } + + /** + * Set the delimiters of this {@link GlobalStreamOptions} instance and return the same instance. + * + * @param delimiters + * List of delimiters to split the input text into chunks.Please note, this is a required parameter when + * `input_translation_module_config` or `output_translation_module_config` are + * configured. + * @return The same instance of this {@link GlobalStreamOptions} class + */ + @Nonnull + public GlobalStreamOptions delimiters( @Nullable final List delimiters ) + { + this.delimiters = delimiters; + return this; + } + + /** + * Add one delimiters instance to this {@link GlobalStreamOptions}. + * + * @param delimitersItem + * The delimiters that should be added + * @return The same instance of type {@link GlobalStreamOptions} + */ + @Nonnull + public GlobalStreamOptions addDelimitersItem( @Nonnull final String delimitersItem ) + { + if( this.delimiters == null ) { + this.delimiters = new ArrayList<>(); + } + this.delimiters.add(delimitersItem); + return this; + } + + /** + * List of delimiters to split the input text into chunks.Please note, this is a required parameter when + * `input_translation_module_config` or `output_translation_module_config` are configured. + * + * @return delimiters The delimiters of this {@link GlobalStreamOptions} instance. + */ + @Nonnull + public List getDelimiters() + { + return delimiters; + } + + /** + * Set the delimiters of this {@link GlobalStreamOptions} instance. + * + * @param delimiters + * List of delimiters to split the input text into chunks.Please note, this is a required parameter when + * `input_translation_module_config` or `output_translation_module_config` are + * configured. + */ + public void setDelimiters( @Nullable final List delimiters ) + { + this.delimiters = delimiters; + } + + /** + * Get the names of the unrecognizable properties of the {@link GlobalStreamOptions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GlobalStreamOptions} 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("GlobalStreamOptions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GlobalStreamOptions} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( enabled != null ) + declaredFields.put("enabled", enabled); + if( chunkSize != null ) + declaredFields.put("chunkSize", chunkSize); + if( delimiters != null ) + declaredFields.put("delimiters", delimiters); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GlobalStreamOptions} 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 GlobalStreamOptions globalStreamOptions = (GlobalStreamOptions) o; + return Objects.equals(this.cloudSdkCustomFields, globalStreamOptions.cloudSdkCustomFields) + && Objects.equals(this.enabled, globalStreamOptions.enabled) + && Objects.equals(this.chunkSize, globalStreamOptions.chunkSize) + && Objects.equals(this.delimiters, globalStreamOptions.delimiters); + } + + @Override + public int hashCode() + { + return Objects.hash(enabled, chunkSize, delimiters, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class GlobalStreamOptions {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" chunkSize: ").append(toIndentedString(chunkSize)).append("\n"); + sb.append(" delimiters: ").append(toIndentedString(delimiters)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java new file mode 100644 index 000000000..0027dac92 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * GroundingFilterSearchConfiguration + */ + +@Beta // CHECKSTYLE:OFF +public class GroundingFilterSearchConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty( "max_chunk_count" ) + private Integer maxChunkCount; + + @JsonProperty( "max_document_count" ) + private Integer maxDocumentCount; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for GroundingFilterSearchConfiguration. + */ + protected GroundingFilterSearchConfiguration() + { + } + + /** + * Set the maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance and return the same instance. + * + * @param maxChunkCount + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. Minimum: 0 + * @return The same instance of this {@link GroundingFilterSearchConfiguration} class + */ + @Nonnull + public GroundingFilterSearchConfiguration maxChunkCount( @Nullable final Integer maxChunkCount ) + { + this.maxChunkCount = maxChunkCount; + return this; + } + + /** + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. minimum: 0 + * + * @return maxChunkCount The maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance. + */ + @Nonnull + public Integer getMaxChunkCount() + { + return maxChunkCount; + } + + /** + * Set the maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance. + * + * @param maxChunkCount + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. Minimum: 0 + */ + public void setMaxChunkCount( @Nullable final Integer maxChunkCount ) + { + this.maxChunkCount = maxChunkCount; + } + + /** + * Set the maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance and return the same + * instance. + * + * @param maxDocumentCount + * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. + * Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per + * document is returned. Minimum: 0 + * @return The same instance of this {@link GroundingFilterSearchConfiguration} class + */ + @Nonnull + public GroundingFilterSearchConfiguration maxDocumentCount( @Nullable final Integer maxDocumentCount ) + { + this.maxDocumentCount = maxDocumentCount; + return this; + } + + /** + * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used + * with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per document is returned. + * minimum: 0 + * + * @return maxDocumentCount The maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance. + */ + @Nonnull + public Integer getMaxDocumentCount() + { + return maxDocumentCount; + } + + /** + * Set the maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance. + * + * @param maxDocumentCount + * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. + * Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per + * document is returned. Minimum: 0 + */ + public void setMaxDocumentCount( @Nullable final Integer maxDocumentCount ) + { + this.maxDocumentCount = maxDocumentCount; + } + + /** + * Get the names of the unrecognizable properties of the {@link GroundingFilterSearchConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingFilterSearchConfiguration} 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( + "GroundingFilterSearchConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GroundingFilterSearchConfiguration} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( maxChunkCount != null ) + declaredFields.put("maxChunkCount", maxChunkCount); + if( maxDocumentCount != null ) + declaredFields.put("maxDocumentCount", maxDocumentCount); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GroundingFilterSearchConfiguration} 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 GroundingFilterSearchConfiguration groundingFilterSearchConfiguration = + (GroundingFilterSearchConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, groundingFilterSearchConfiguration.cloudSdkCustomFields) + && Objects.equals(this.maxChunkCount, groundingFilterSearchConfiguration.maxChunkCount) + && Objects.equals(this.maxDocumentCount, groundingFilterSearchConfiguration.maxDocumentCount); + } + + @Override + public int hashCode() + { + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class GroundingFilterSearchConfiguration {\n"); + sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); + sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java new file mode 100644 index 000000000..fe17aff6a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * GroundingModuleConfig + */ + +@Beta // CHECKSTYLE:OFF +public class GroundingModuleConfig +// CHECKSTYLE:ON +{ + /** + * Gets or Sets type + */ + public enum TypeEnum + { + /** + * The DOCUMENT_GROUNDING_SERVICE option of this GroundingModuleConfig + */ + DOCUMENT_GROUNDING_SERVICE("document_grounding_service"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this GroundingModuleConfig + */ + 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 GroundingModuleConfig + */ + @JsonCreator + @Nullable + public static TypeEnum fromValue( @Nonnull final String value ) + { + for( TypeEnum b : TypeEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return null; + } + } + + @JsonProperty( "type" ) + private TypeEnum type; + + @JsonProperty( "config" ) + private GroundingModuleConfigConfig config; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for GroundingModuleConfig. + */ + protected GroundingModuleConfig() + { + } + + /** + * Set the type of this {@link GroundingModuleConfig} instance and return the same instance. + * + * @param type + * The type of this {@link GroundingModuleConfig} + * @return The same instance of this {@link GroundingModuleConfig} class + */ + @Nonnull + public GroundingModuleConfig type( @Nullable final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link GroundingModuleConfig} instance. + */ + @Nullable + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link GroundingModuleConfig} instance. + * + * @param type + * The type of this {@link GroundingModuleConfig} + */ + public void setType( @Nullable final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the config of this {@link GroundingModuleConfig} instance and return the same instance. + * + * @param config + * The config of this {@link GroundingModuleConfig} + * @return The same instance of this {@link GroundingModuleConfig} class + */ + @Nonnull + public GroundingModuleConfig config( @Nonnull final GroundingModuleConfigConfig config ) + { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link GroundingModuleConfig} instance. + */ + @Nonnull + public GroundingModuleConfigConfig getConfig() + { + return config; + } + + /** + * Set the config of this {@link GroundingModuleConfig} instance. + * + * @param config + * The config of this {@link GroundingModuleConfig} + */ + public void setConfig( @Nonnull final GroundingModuleConfigConfig config ) + { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link GroundingModuleConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingModuleConfig} 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("GroundingModuleConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GroundingModuleConfig} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( config != null ) + declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GroundingModuleConfig} 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 GroundingModuleConfig groundingModuleConfig = (GroundingModuleConfig) o; + return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfig.cloudSdkCustomFields) + && Objects.equals(this.type, groundingModuleConfig.type) + && Objects.equals(this.config, groundingModuleConfig.config); + } + + @Override + public int hashCode() + { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class GroundingModuleConfig {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java new file mode 100644 index 000000000..d51035d24 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * GroundingModuleConfigConfig + */ + +@Beta // CHECKSTYLE:OFF +public class GroundingModuleConfigConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "filters" ) + private List filters = new ArrayList<>(); + + @JsonProperty( "placeholders" ) + private GroundingModuleConfigConfigPlaceholders placeholders; + + @JsonProperty( "metadata_params" ) + private List metadataParams = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for GroundingModuleConfigConfig. + */ + protected GroundingModuleConfigConfig() + { + } + + /** + * Set the filters of this {@link GroundingModuleConfigConfig} instance and return the same instance. + * + * @param filters + * Document grounding service filters to be used + * @return The same instance of this {@link GroundingModuleConfigConfig} class + */ + @Nonnull + public GroundingModuleConfigConfig filters( @Nullable final List filters ) + { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link GroundingModuleConfigConfig}. + * + * @param filtersItem + * The filters that should be added + * @return The same instance of type {@link GroundingModuleConfigConfig} + */ + @Nonnull + public GroundingModuleConfigConfig addFiltersItem( + @Nonnull final GroundingModuleConfigConfigFiltersInner filtersItem ) + { + if( this.filters == null ) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Document grounding service filters to be used + * + * @return filters The filters of this {@link GroundingModuleConfigConfig} instance. + */ + @Nonnull + public List getFilters() + { + return filters; + } + + /** + * Set the filters of this {@link GroundingModuleConfigConfig} instance. + * + * @param filters + * Document grounding service filters to be used + */ + public void setFilters( @Nullable final List filters ) + { + this.filters = filters; + } + + /** + * Set the placeholders of this {@link GroundingModuleConfigConfig} instance and return the same instance. + * + * @param placeholders + * The placeholders of this {@link GroundingModuleConfigConfig} + * @return The same instance of this {@link GroundingModuleConfigConfig} class + */ + @Nonnull + public GroundingModuleConfigConfig placeholders( + @Nonnull final GroundingModuleConfigConfigPlaceholders placeholders ) + { + this.placeholders = placeholders; + return this; + } + + /** + * Get placeholders + * + * @return placeholders The placeholders of this {@link GroundingModuleConfigConfig} instance. + */ + @Nonnull + public GroundingModuleConfigConfigPlaceholders getPlaceholders() + { + return placeholders; + } + + /** + * Set the placeholders of this {@link GroundingModuleConfigConfig} instance. + * + * @param placeholders + * The placeholders of this {@link GroundingModuleConfigConfig} + */ + public void setPlaceholders( @Nonnull final GroundingModuleConfigConfigPlaceholders placeholders ) + { + this.placeholders = placeholders; + } + + /** + * Set the metadataParams of this {@link GroundingModuleConfigConfig} instance and return the same instance. + * + * @param metadataParams + * Parameter name used for specifying metadata parameters + * @return The same instance of this {@link GroundingModuleConfigConfig} class + */ + @Nonnull + public GroundingModuleConfigConfig metadataParams( @Nullable final List metadataParams ) + { + this.metadataParams = metadataParams; + return this; + } + + /** + * Add one metadataParams instance to this {@link GroundingModuleConfigConfig}. + * + * @param metadataParamsItem + * The metadataParams that should be added + * @return The same instance of type {@link GroundingModuleConfigConfig} + */ + @Nonnull + public GroundingModuleConfigConfig addMetadataParamsItem( @Nonnull final String metadataParamsItem ) + { + if( this.metadataParams == null ) { + this.metadataParams = new ArrayList<>(); + } + this.metadataParams.add(metadataParamsItem); + return this; + } + + /** + * Parameter name used for specifying metadata parameters + * + * @return metadataParams The metadataParams of this {@link GroundingModuleConfigConfig} instance. + */ + @Nonnull + public List getMetadataParams() + { + return metadataParams; + } + + /** + * Set the metadataParams of this {@link GroundingModuleConfigConfig} instance. + * + * @param metadataParams + * Parameter name used for specifying metadata parameters + */ + public void setMetadataParams( @Nullable final List metadataParams ) + { + this.metadataParams = metadataParams; + } + + /** + * Get the names of the unrecognizable properties of the {@link GroundingModuleConfigConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingModuleConfigConfig} 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("GroundingModuleConfigConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GroundingModuleConfigConfig} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( filters != null ) + declaredFields.put("filters", filters); + if( placeholders != null ) + declaredFields.put("placeholders", placeholders); + if( metadataParams != null ) + declaredFields.put("metadataParams", metadataParams); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GroundingModuleConfigConfig} 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 GroundingModuleConfigConfig groundingModuleConfigConfig = (GroundingModuleConfigConfig) o; + return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfigConfig.cloudSdkCustomFields) + && Objects.equals(this.filters, groundingModuleConfigConfig.filters) + && Objects.equals(this.placeholders, groundingModuleConfigConfig.placeholders) + && Objects.equals(this.metadataParams, groundingModuleConfigConfig.metadataParams); + } + + @Override + public int hashCode() + { + return Objects.hash(filters, placeholders, metadataParams, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class GroundingModuleConfigConfig {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" placeholders: ").append(toIndentedString(placeholders)).append("\n"); + sb.append(" metadataParams: ").append(toIndentedString(metadataParams)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java new file mode 100644 index 000000000..7108206c9 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * GroundingModuleConfigConfigFiltersInner + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { @JsonSubTypes.Type( value = DocumentGroundingFilter.class ), } ) + +public interface GroundingModuleConfigConfigFiltersInner +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java new file mode 100644 index 000000000..19d4b31fc --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Placeholders to be used for grounding input questions and output + */ + +@Beta // CHECKSTYLE:OFF +public class GroundingModuleConfigConfigPlaceholders +// CHECKSTYLE:ON +{ + @JsonProperty( "input" ) + private List input = new ArrayList<>(); + + @JsonProperty( "output" ) + private String output; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for GroundingModuleConfigConfigPlaceholders. + */ + protected GroundingModuleConfigConfigPlaceholders() + { + } + + /** + * Set the input of this {@link GroundingModuleConfigConfigPlaceholders} instance and return the same instance. + * + * @param input + * Contains the input parameters used for grounding input questions + * @return The same instance of this {@link GroundingModuleConfigConfigPlaceholders} class + */ + @Nonnull + public GroundingModuleConfigConfigPlaceholders input( @Nonnull final List input ) + { + this.input = input; + return this; + } + + /** + * Add one input instance to this {@link GroundingModuleConfigConfigPlaceholders}. + * + * @param inputItem + * The input that should be added + * @return The same instance of type {@link GroundingModuleConfigConfigPlaceholders} + */ + @Nonnull + public GroundingModuleConfigConfigPlaceholders addInputItem( @Nonnull final String inputItem ) + { + if( this.input == null ) { + this.input = new ArrayList<>(); + } + this.input.add(inputItem); + return this; + } + + /** + * Contains the input parameters used for grounding input questions + * + * @return input The input of this {@link GroundingModuleConfigConfigPlaceholders} instance. + */ + @Nonnull + public List getInput() + { + return input; + } + + /** + * Set the input of this {@link GroundingModuleConfigConfigPlaceholders} instance. + * + * @param input + * Contains the input parameters used for grounding input questions + */ + public void setInput( @Nonnull final List input ) + { + this.input = input; + } + + /** + * Set the output of this {@link GroundingModuleConfigConfigPlaceholders} instance and return the same instance. + * + * @param output + * Placeholder name for grounding output + * @return The same instance of this {@link GroundingModuleConfigConfigPlaceholders} class + */ + @Nonnull + public GroundingModuleConfigConfigPlaceholders output( @Nonnull final String output ) + { + this.output = output; + return this; + } + + /** + * Placeholder name for grounding output + * + * @return output The output of this {@link GroundingModuleConfigConfigPlaceholders} instance. + */ + @Nonnull + public String getOutput() + { + return output; + } + + /** + * Set the output of this {@link GroundingModuleConfigConfigPlaceholders} instance. + * + * @param output + * Placeholder name for grounding output + */ + public void setOutput( @Nonnull final String output ) + { + this.output = output; + } + + /** + * Get the names of the unrecognizable properties of the {@link GroundingModuleConfigConfigPlaceholders}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingModuleConfigConfigPlaceholders} 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( + "GroundingModuleConfigConfigPlaceholders has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GroundingModuleConfigConfigPlaceholders} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( input != null ) + declaredFields.put("input", input); + if( output != null ) + declaredFields.put("output", output); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GroundingModuleConfigConfigPlaceholders} 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 GroundingModuleConfigConfigPlaceholders groundingModuleConfigConfigPlaceholders = + (GroundingModuleConfigConfigPlaceholders) o; + return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfigConfigPlaceholders.cloudSdkCustomFields) + && Objects.equals(this.input, groundingModuleConfigConfigPlaceholders.input) + && Objects.equals(this.output, groundingModuleConfigConfigPlaceholders.output); + } + + @Override + public int hashCode() + { + return Objects.hash(input, output, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class GroundingModuleConfigConfigPlaceholders {\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java new file mode 100644 index 000000000..a36f2d705 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * ImageContent + */ + +@Beta // CHECKSTYLE:OFF +public class ImageContent implements MultiChatContent +// CHECKSTYLE:ON +{ + /** + * Gets or Sets type + */ + public enum TypeEnum + { + /** + * The IMAGE_URL option of this ImageContent + */ + IMAGE_URL("image_url"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this ImageContent + */ + 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 ImageContent + */ + @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( "image_url" ) + private ImageContentImageUrl imageUrl; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ImageContent. + */ + protected ImageContent() + { + } + + /** + * Set the type of this {@link ImageContent} instance and return the same instance. + * + * @param type + * The type of this {@link ImageContent} + * @return The same instance of this {@link ImageContent} class + */ + @Nonnull + public ImageContent type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link ImageContent} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link ImageContent} instance. + * + * @param type + * The type of this {@link ImageContent} + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the imageUrl of this {@link ImageContent} instance and return the same instance. + * + * @param imageUrl + * The imageUrl of this {@link ImageContent} + * @return The same instance of this {@link ImageContent} class + */ + @Nonnull + public ImageContent imageUrl( @Nonnull final ImageContentImageUrl imageUrl ) + { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * + * @return imageUrl The imageUrl of this {@link ImageContent} instance. + */ + @Nonnull + public ImageContentImageUrl getImageUrl() + { + return imageUrl; + } + + /** + * Set the imageUrl of this {@link ImageContent} instance. + * + * @param imageUrl + * The imageUrl of this {@link ImageContent} + */ + public void setImageUrl( @Nonnull final ImageContentImageUrl imageUrl ) + { + this.imageUrl = imageUrl; + } + + /** + * Get the names of the unrecognizable properties of the {@link ImageContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ImageContent} 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("ImageContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ImageContent} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( imageUrl != null ) + declaredFields.put("imageUrl", imageUrl); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ImageContent} 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 ImageContent imageContent = (ImageContent) o; + return Objects.equals(this.cloudSdkCustomFields, imageContent.cloudSdkCustomFields) + && Objects.equals(this.type, imageContent.type) + && Objects.equals(this.imageUrl, imageContent.imageUrl); + } + + @Override + public int hashCode() + { + return Objects.hash(type, imageUrl, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ImageContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java new file mode 100644 index 000000000..dcfd9bc5f --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * ImageContentImageUrl + */ + +@Beta // CHECKSTYLE:OFF +public class ImageContentImageUrl +// CHECKSTYLE:ON +{ + @JsonProperty( "url" ) + private String url; + + @JsonProperty( "detail" ) + private String detail = "auto"; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ImageContentImageUrl. + */ + protected ImageContentImageUrl() + { + } + + /** + * Set the url of this {@link ImageContentImageUrl} instance and return the same instance. + * + * @param url + * The url of this {@link ImageContentImageUrl} + * @return The same instance of this {@link ImageContentImageUrl} class + */ + @Nonnull + public ImageContentImageUrl url( @Nonnull final String url ) + { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url The url of this {@link ImageContentImageUrl} instance. + */ + @Nonnull + public String getUrl() + { + return url; + } + + /** + * Set the url of this {@link ImageContentImageUrl} instance. + * + * @param url + * The url of this {@link ImageContentImageUrl} + */ + public void setUrl( @Nonnull final String url ) + { + this.url = url; + } + + /** + * Set the detail of this {@link ImageContentImageUrl} instance and return the same instance. + * + * @param detail + * The detail of this {@link ImageContentImageUrl} + * @return The same instance of this {@link ImageContentImageUrl} class + */ + @Nonnull + public ImageContentImageUrl detail( @Nullable final String detail ) + { + this.detail = detail; + return this; + } + + /** + * Get detail + * + * @return detail The detail of this {@link ImageContentImageUrl} instance. + */ + @Nonnull + public String getDetail() + { + return detail; + } + + /** + * Set the detail of this {@link ImageContentImageUrl} instance. + * + * @param detail + * The detail of this {@link ImageContentImageUrl} + */ + public void setDetail( @Nullable final String detail ) + { + this.detail = detail; + } + + /** + * Get the names of the unrecognizable properties of the {@link ImageContentImageUrl}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ImageContentImageUrl} 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("ImageContentImageUrl has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ImageContentImageUrl} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( url != null ) + declaredFields.put("url", url); + if( detail != null ) + declaredFields.put("detail", detail); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ImageContentImageUrl} 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 ImageContentImageUrl imageContentImageUrl = (ImageContentImageUrl) o; + return Objects.equals(this.cloudSdkCustomFields, imageContentImageUrl.cloudSdkCustomFields) + && Objects.equals(this.url, imageContentImageUrl.url) + && Objects.equals(this.detail, imageContentImageUrl.detail); + } + + @Override + public int hashCode() + { + return Objects.hash(url, detail, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ImageContentImageUrl {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java new file mode 100644 index 000000000..b06e269e9 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * ImageContentUrl + */ + +@Beta // CHECKSTYLE:OFF +public class ImageContentUrl +// CHECKSTYLE:ON +{ + @JsonProperty( "url" ) + private String url; + + @JsonProperty( "detail" ) + private String detail = "auto"; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ImageContentUrl. + */ + protected ImageContentUrl() + { + } + + /** + * Set the url of this {@link ImageContentUrl} instance and return the same instance. + * + * @param url + * The url of this {@link ImageContentUrl} + * @return The same instance of this {@link ImageContentUrl} class + */ + @Nonnull + public ImageContentUrl url( @Nonnull final String url ) + { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url The url of this {@link ImageContentUrl} instance. + */ + @Nonnull + public String getUrl() + { + return url; + } + + /** + * Set the url of this {@link ImageContentUrl} instance. + * + * @param url + * The url of this {@link ImageContentUrl} + */ + public void setUrl( @Nonnull final String url ) + { + this.url = url; + } + + /** + * Set the detail of this {@link ImageContentUrl} instance and return the same instance. + * + * @param detail + * The detail of this {@link ImageContentUrl} + * @return The same instance of this {@link ImageContentUrl} class + */ + @Nonnull + public ImageContentUrl detail( @Nullable final String detail ) + { + this.detail = detail; + return this; + } + + /** + * Get detail + * + * @return detail The detail of this {@link ImageContentUrl} instance. + */ + @Nonnull + public String getDetail() + { + return detail; + } + + /** + * Set the detail of this {@link ImageContentUrl} instance. + * + * @param detail + * The detail of this {@link ImageContentUrl} + */ + public void setDetail( @Nullable final String detail ) + { + this.detail = detail; + } + + /** + * Get the names of the unrecognizable properties of the {@link ImageContentUrl}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ImageContentUrl} 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("ImageContentUrl has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ImageContentUrl} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( url != null ) + declaredFields.put("url", url); + if( detail != null ) + declaredFields.put("detail", detail); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ImageContentUrl} 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 ImageContentUrl imageContentUrl = (ImageContentUrl) o; + return Objects.equals(this.cloudSdkCustomFields, imageContentUrl.cloudSdkCustomFields) + && Objects.equals(this.url, imageContentUrl.url) + && Objects.equals(this.detail, imageContentUrl.detail); + } + + @Override + public int hashCode() + { + return Objects.hash(url, detail, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ImageContentUrl {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java new file mode 100644 index 000000000..3bb81df8e --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * InputFilterConfig + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = AzureContentSafetyInputFilterConfig.class ), + @JsonSubTypes.Type( value = LlamaGuard38bFilterConfig.class ), } ) + +public interface InputFilterConfig +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java new file mode 100644 index 000000000..66a973504 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * InputFilteringConfig + */ + +@Beta // CHECKSTYLE:OFF +public class InputFilteringConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "filters" ) + private List filters = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for InputFilteringConfig. + */ + protected InputFilteringConfig() + { + } + + /** + * Set the filters of this {@link InputFilteringConfig} instance and return the same instance. + * + * @param filters + * Configuration for content filtering services that should be used for the given filtering step (input + * filtering). + * @return The same instance of this {@link InputFilteringConfig} class + */ + @Nonnull + public InputFilteringConfig filters( @Nonnull final List filters ) + { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link InputFilteringConfig}. + * + * @param filtersItem + * The filters that should be added + * @return The same instance of type {@link InputFilteringConfig} + */ + @Nonnull + public InputFilteringConfig addFiltersItem( @Nonnull final InputFilterConfig filtersItem ) + { + if( this.filters == null ) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Configuration for content filtering services that should be used for the given filtering step (input filtering). + * + * @return filters The filters of this {@link InputFilteringConfig} instance. + */ + @Nonnull + public List getFilters() + { + return filters; + } + + /** + * Set the filters of this {@link InputFilteringConfig} instance. + * + * @param filters + * Configuration for content filtering services that should be used for the given filtering step (input + * filtering). + */ + public void setFilters( @Nonnull final List filters ) + { + this.filters = filters; + } + + /** + * Get the names of the unrecognizable properties of the {@link InputFilteringConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link InputFilteringConfig} 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("InputFilteringConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link InputFilteringConfig} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( filters != null ) + declaredFields.put("filters", filters); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link InputFilteringConfig} 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 InputFilteringConfig inputFilteringConfig = (InputFilteringConfig) o; + return Objects.equals(this.cloudSdkCustomFields, inputFilteringConfig.cloudSdkCustomFields) + && Objects.equals(this.filters, inputFilteringConfig.filters); + } + + @Override + public int hashCode() + { + return Objects.hash(filters, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class InputFilteringConfig {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java new file mode 100644 index 000000000..245f3d533 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * KeyValueListPair + */ + +@Beta // CHECKSTYLE:OFF +public class KeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty( "key" ) + private String key; + + @JsonProperty( "value" ) + private List value = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for KeyValueListPair. + */ + protected KeyValueListPair() + { + } + + /** + * Set the key of this {@link KeyValueListPair} instance and return the same instance. + * + * @param key + * The key of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair key( @Nonnull final String key ) + { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link KeyValueListPair} instance. + */ + @Nonnull + public String getKey() + { + return key; + } + + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key + * The key of this {@link KeyValueListPair} + */ + public void setKey( @Nonnull final String key ) + { + this.key = key; + } + + /** + * Set the value of this {@link KeyValueListPair} instance and return the same instance. + * + * @param value + * The value of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair value( @Nonnull final List value ) + { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link KeyValueListPair}. + * + * @param valueItem + * The value that should be added + * @return The same instance of type {@link KeyValueListPair} + */ + @Nonnull + public KeyValueListPair addValueItem( @Nonnull final String valueItem ) + { + if( this.value == null ) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link KeyValueListPair} instance. + */ + @Nonnull + public List getValue() + { + return value; + } + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value + * The value of this {@link KeyValueListPair} + */ + public void setValue( @Nonnull final List value ) + { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link KeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link KeyValueListPair} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name + * The name of the property + * @return The value of the property + * @throws NoSuchElementException + * If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField( @Nonnull final String name ) + throws NoSuchElementException + { + if( !cloudSdkCustomFields.containsKey(name) ) { + throw new NoSuchElementException("KeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link KeyValueListPair} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( key != null ) + declaredFields.put("key", key); + if( value != null ) + declaredFields.put("value", value); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link KeyValueListPair} instance. If the map previously contained a + * mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final KeyValueListPair keyValueListPair = (KeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, keyValueListPair.key) + && Objects.equals(this.value, keyValueListPair.value); + } + + @Override + public int hashCode() + { + return Objects.hash(key, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class KeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java new file mode 100644 index 000000000..c5ce5e330 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * The model and parameters to be used for the prompt templating. This is the model that will be used to generate the + * response. + */ + +@Beta // CHECKSTYLE:OFF +public class LLMModelDetails +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version = "latest"; + + @JsonProperty( "params" ) + private Map params = new HashMap<>(); + + @JsonProperty( "timeout" ) + private Integer timeout = 600; + + @JsonProperty( "max_retries" ) + private Integer maxRetries = 2; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for LLMModelDetails. + */ + protected LLMModelDetails() + { + } + + /** + * Set the name of this {@link LLMModelDetails} instance and return the same instance. + * + * @param name + * Name of the model as in LLM Access configuration + * @return The same instance of this {@link LLMModelDetails} class + */ + @Nonnull + public LLMModelDetails name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Name of the model as in LLM Access configuration + * + * @return name The name of this {@link LLMModelDetails} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link LLMModelDetails} instance. + * + * @param name + * Name of the model as in LLM Access configuration + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link LLMModelDetails} instance and return the same instance. + * + * @param version + * Version of the model to be used + * @return The same instance of this {@link LLMModelDetails} class + */ + @Nonnull + public LLMModelDetails version( @Nullable final String version ) + { + this.version = version; + return this; + } + + /** + * Version of the model to be used + * + * @return version The version of this {@link LLMModelDetails} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link LLMModelDetails} instance. + * + * @param version + * Version of the model to be used + */ + public void setVersion( @Nullable final String version ) + { + this.version = version; + } + + /** + * Set the params of this {@link LLMModelDetails} instance and return the same instance. + * + * @param params + * Additional parameters for the model. Default values are used for mandatory parameters. + * @return The same instance of this {@link LLMModelDetails} class + */ + @Nonnull + public LLMModelDetails params( @Nullable final Map params ) + { + this.params = params; + return this; + } + + /** + * Put one params instance to this {@link LLMModelDetails} instance. + * + * @param key + * The String key of this params instance + * @param paramsItem + * The params that should be added under the given key + * @return The same instance of type {@link LLMModelDetails} + */ + @Nonnull + public LLMModelDetails putparamsItem( @Nonnull final String key, @Nullable final Object paramsItem ) + { + if( this.params == null ) { + this.params = new HashMap<>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Additional parameters for the model. Default values are used for mandatory parameters. + * + * @return params The params of this {@link LLMModelDetails} instance. + */ + @Nonnull + public Map getParams() + { + return params; + } + + /** + * Set the params of this {@link LLMModelDetails} instance. + * + * @param params + * Additional parameters for the model. Default values are used for mandatory parameters. + */ + public void setParams( @Nullable final Map params ) + { + this.params = params; + } + + /** + * Set the timeout of this {@link LLMModelDetails} instance and return the same instance. + * + * @param timeout + * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. + * Minimum: 1 Maximum: 600 + * @return The same instance of this {@link LLMModelDetails} class + */ + @Nonnull + public LLMModelDetails timeout( @Nullable final Integer timeout ) + { + this.timeout = timeout; + return this; + } + + /** + * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. minimum: 1 + * maximum: 600 + * + * @return timeout The timeout of this {@link LLMModelDetails} instance. + */ + @Nonnull + public Integer getTimeout() + { + return timeout; + } + + /** + * Set the timeout of this {@link LLMModelDetails} instance. + * + * @param timeout + * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. + * Minimum: 1 Maximum: 600 + */ + public void setTimeout( @Nullable final Integer timeout ) + { + this.timeout = timeout; + } + + /** + * Set the maxRetries of this {@link LLMModelDetails} instance and return the same instance. + * + * @param maxRetries + * Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI + * models. Minimum: 0 Maximum: 5 + * @return The same instance of this {@link LLMModelDetails} class + */ + @Nonnull + public LLMModelDetails maxRetries( @Nullable final Integer maxRetries ) + { + this.maxRetries = maxRetries; + return this; + } + + /** + * Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI models. minimum: + * 0 maximum: 5 + * + * @return maxRetries The maxRetries of this {@link LLMModelDetails} instance. + */ + @Nonnull + public Integer getMaxRetries() + { + return maxRetries; + } + + /** + * Set the maxRetries of this {@link LLMModelDetails} instance. + * + * @param maxRetries + * Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI + * models. Minimum: 0 Maximum: 5 + */ + public void setMaxRetries( @Nullable final Integer maxRetries ) + { + this.maxRetries = maxRetries; + } + + /** + * Get the names of the unrecognizable properties of the {@link LLMModelDetails}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LLMModelDetails} 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("LLMModelDetails has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link LLMModelDetails} 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( version != null ) + declaredFields.put("version", version); + if( params != null ) + declaredFields.put("params", params); + if( timeout != null ) + declaredFields.put("timeout", timeout); + if( maxRetries != null ) + declaredFields.put("maxRetries", maxRetries); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link LLMModelDetails} 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 LLMModelDetails llMModelDetails = (LLMModelDetails) o; + return Objects.equals(this.cloudSdkCustomFields, llMModelDetails.cloudSdkCustomFields) + && Objects.equals(this.name, llMModelDetails.name) + && Objects.equals(this.version, llMModelDetails.version) + && Objects.equals(this.params, llMModelDetails.params) + && Objects.equals(this.timeout, llMModelDetails.timeout) + && Objects.equals(this.maxRetries, llMModelDetails.maxRetries); + } + + @Override + public int hashCode() + { + return Objects.hash(name, version, params, timeout, maxRetries, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class LLMModelDetails {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java new file mode 100644 index 000000000..8d2a41130 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java @@ -0,0 +1,773 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Filter configuration for Llama Guard 3 8B + */ + +@Beta // CHECKSTYLE:OFF +public class LlamaGuard38b +// CHECKSTYLE:ON +{ + @JsonProperty( "violent_crimes" ) + private Boolean violentCrimes; + + @JsonProperty( "non_violent_crimes" ) + private Boolean nonViolentCrimes; + + @JsonProperty( "sex_crimes" ) + private Boolean sexCrimes; + + @JsonProperty( "child_exploitation" ) + private Boolean childExploitation; + + @JsonProperty( "defamation" ) + private Boolean defamation; + + @JsonProperty( "specialized_advice" ) + private Boolean specializedAdvice; + + @JsonProperty( "privacy" ) + private Boolean privacy; + + @JsonProperty( "intellectual_property" ) + private Boolean intellectualProperty; + + @JsonProperty( "indiscriminate_weapons" ) + private Boolean indiscriminateWeapons; + + @JsonProperty( "hate" ) + private Boolean hate; + + @JsonProperty( "self_harm" ) + private Boolean selfHarm; + + @JsonProperty( "sexual_content" ) + private Boolean sexualContent; + + @JsonProperty( "elections" ) + private Boolean elections; + + @JsonProperty( "code_interpreter_abuse" ) + private Boolean codeInterpreterAbuse; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for LlamaGuard38b. + */ + protected LlamaGuard38b() + { + } + + /** + * Set the violentCrimes of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param violentCrimes + * The violentCrimes of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b violentCrimes( @Nullable final Boolean violentCrimes ) + { + this.violentCrimes = violentCrimes; + return this; + } + + /** + * Get violentCrimes + * + * @return violentCrimes The violentCrimes of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isViolentCrimes() + { + return violentCrimes; + } + + /** + * Set the violentCrimes of this {@link LlamaGuard38b} instance. + * + * @param violentCrimes + * The violentCrimes of this {@link LlamaGuard38b} + */ + public void setViolentCrimes( @Nullable final Boolean violentCrimes ) + { + this.violentCrimes = violentCrimes; + } + + /** + * Set the nonViolentCrimes of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param nonViolentCrimes + * The nonViolentCrimes of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b nonViolentCrimes( @Nullable final Boolean nonViolentCrimes ) + { + this.nonViolentCrimes = nonViolentCrimes; + return this; + } + + /** + * Get nonViolentCrimes + * + * @return nonViolentCrimes The nonViolentCrimes of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isNonViolentCrimes() + { + return nonViolentCrimes; + } + + /** + * Set the nonViolentCrimes of this {@link LlamaGuard38b} instance. + * + * @param nonViolentCrimes + * The nonViolentCrimes of this {@link LlamaGuard38b} + */ + public void setNonViolentCrimes( @Nullable final Boolean nonViolentCrimes ) + { + this.nonViolentCrimes = nonViolentCrimes; + } + + /** + * Set the sexCrimes of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param sexCrimes + * The sexCrimes of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b sexCrimes( @Nullable final Boolean sexCrimes ) + { + this.sexCrimes = sexCrimes; + return this; + } + + /** + * Get sexCrimes + * + * @return sexCrimes The sexCrimes of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSexCrimes() + { + return sexCrimes; + } + + /** + * Set the sexCrimes of this {@link LlamaGuard38b} instance. + * + * @param sexCrimes + * The sexCrimes of this {@link LlamaGuard38b} + */ + public void setSexCrimes( @Nullable final Boolean sexCrimes ) + { + this.sexCrimes = sexCrimes; + } + + /** + * Set the childExploitation of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param childExploitation + * The childExploitation of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b childExploitation( @Nullable final Boolean childExploitation ) + { + this.childExploitation = childExploitation; + return this; + } + + /** + * Get childExploitation + * + * @return childExploitation The childExploitation of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isChildExploitation() + { + return childExploitation; + } + + /** + * Set the childExploitation of this {@link LlamaGuard38b} instance. + * + * @param childExploitation + * The childExploitation of this {@link LlamaGuard38b} + */ + public void setChildExploitation( @Nullable final Boolean childExploitation ) + { + this.childExploitation = childExploitation; + } + + /** + * Set the defamation of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param defamation + * The defamation of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b defamation( @Nullable final Boolean defamation ) + { + this.defamation = defamation; + return this; + } + + /** + * Get defamation + * + * @return defamation The defamation of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isDefamation() + { + return defamation; + } + + /** + * Set the defamation of this {@link LlamaGuard38b} instance. + * + * @param defamation + * The defamation of this {@link LlamaGuard38b} + */ + public void setDefamation( @Nullable final Boolean defamation ) + { + this.defamation = defamation; + } + + /** + * Set the specializedAdvice of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param specializedAdvice + * The specializedAdvice of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b specializedAdvice( @Nullable final Boolean specializedAdvice ) + { + this.specializedAdvice = specializedAdvice; + return this; + } + + /** + * Get specializedAdvice + * + * @return specializedAdvice The specializedAdvice of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSpecializedAdvice() + { + return specializedAdvice; + } + + /** + * Set the specializedAdvice of this {@link LlamaGuard38b} instance. + * + * @param specializedAdvice + * The specializedAdvice of this {@link LlamaGuard38b} + */ + public void setSpecializedAdvice( @Nullable final Boolean specializedAdvice ) + { + this.specializedAdvice = specializedAdvice; + } + + /** + * Set the privacy of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param privacy + * The privacy of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b privacy( @Nullable final Boolean privacy ) + { + this.privacy = privacy; + return this; + } + + /** + * Get privacy + * + * @return privacy The privacy of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isPrivacy() + { + return privacy; + } + + /** + * Set the privacy of this {@link LlamaGuard38b} instance. + * + * @param privacy + * The privacy of this {@link LlamaGuard38b} + */ + public void setPrivacy( @Nullable final Boolean privacy ) + { + this.privacy = privacy; + } + + /** + * Set the intellectualProperty of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param intellectualProperty + * The intellectualProperty of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b intellectualProperty( @Nullable final Boolean intellectualProperty ) + { + this.intellectualProperty = intellectualProperty; + return this; + } + + /** + * Get intellectualProperty + * + * @return intellectualProperty The intellectualProperty of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isIntellectualProperty() + { + return intellectualProperty; + } + + /** + * Set the intellectualProperty of this {@link LlamaGuard38b} instance. + * + * @param intellectualProperty + * The intellectualProperty of this {@link LlamaGuard38b} + */ + public void setIntellectualProperty( @Nullable final Boolean intellectualProperty ) + { + this.intellectualProperty = intellectualProperty; + } + + /** + * Set the indiscriminateWeapons of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param indiscriminateWeapons + * The indiscriminateWeapons of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b indiscriminateWeapons( @Nullable final Boolean indiscriminateWeapons ) + { + this.indiscriminateWeapons = indiscriminateWeapons; + return this; + } + + /** + * Get indiscriminateWeapons + * + * @return indiscriminateWeapons The indiscriminateWeapons of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isIndiscriminateWeapons() + { + return indiscriminateWeapons; + } + + /** + * Set the indiscriminateWeapons of this {@link LlamaGuard38b} instance. + * + * @param indiscriminateWeapons + * The indiscriminateWeapons of this {@link LlamaGuard38b} + */ + public void setIndiscriminateWeapons( @Nullable final Boolean indiscriminateWeapons ) + { + this.indiscriminateWeapons = indiscriminateWeapons; + } + + /** + * Set the hate of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param hate + * The hate of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b hate( @Nullable final Boolean hate ) + { + this.hate = hate; + return this; + } + + /** + * Get hate + * + * @return hate The hate of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isHate() + { + return hate; + } + + /** + * Set the hate of this {@link LlamaGuard38b} instance. + * + * @param hate + * The hate of this {@link LlamaGuard38b} + */ + public void setHate( @Nullable final Boolean hate ) + { + this.hate = hate; + } + + /** + * Set the selfHarm of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param selfHarm + * The selfHarm of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b selfHarm( @Nullable final Boolean selfHarm ) + { + this.selfHarm = selfHarm; + return this; + } + + /** + * Get selfHarm + * + * @return selfHarm The selfHarm of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSelfHarm() + { + return selfHarm; + } + + /** + * Set the selfHarm of this {@link LlamaGuard38b} instance. + * + * @param selfHarm + * The selfHarm of this {@link LlamaGuard38b} + */ + public void setSelfHarm( @Nullable final Boolean selfHarm ) + { + this.selfHarm = selfHarm; + } + + /** + * Set the sexualContent of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param sexualContent + * The sexualContent of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b sexualContent( @Nullable final Boolean sexualContent ) + { + this.sexualContent = sexualContent; + return this; + } + + /** + * Get sexualContent + * + * @return sexualContent The sexualContent of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSexualContent() + { + return sexualContent; + } + + /** + * Set the sexualContent of this {@link LlamaGuard38b} instance. + * + * @param sexualContent + * The sexualContent of this {@link LlamaGuard38b} + */ + public void setSexualContent( @Nullable final Boolean sexualContent ) + { + this.sexualContent = sexualContent; + } + + /** + * Set the elections of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param elections + * The elections of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b elections( @Nullable final Boolean elections ) + { + this.elections = elections; + return this; + } + + /** + * Get elections + * + * @return elections The elections of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isElections() + { + return elections; + } + + /** + * Set the elections of this {@link LlamaGuard38b} instance. + * + * @param elections + * The elections of this {@link LlamaGuard38b} + */ + public void setElections( @Nullable final Boolean elections ) + { + this.elections = elections; + } + + /** + * Set the codeInterpreterAbuse of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param codeInterpreterAbuse + * The codeInterpreterAbuse of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b codeInterpreterAbuse( @Nullable final Boolean codeInterpreterAbuse ) + { + this.codeInterpreterAbuse = codeInterpreterAbuse; + return this; + } + + /** + * Get codeInterpreterAbuse + * + * @return codeInterpreterAbuse The codeInterpreterAbuse of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isCodeInterpreterAbuse() + { + return codeInterpreterAbuse; + } + + /** + * Set the codeInterpreterAbuse of this {@link LlamaGuard38b} instance. + * + * @param codeInterpreterAbuse + * The codeInterpreterAbuse of this {@link LlamaGuard38b} + */ + public void setCodeInterpreterAbuse( @Nullable final Boolean codeInterpreterAbuse ) + { + this.codeInterpreterAbuse = codeInterpreterAbuse; + } + + /** + * Get the names of the unrecognizable properties of the {@link LlamaGuard38b}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LlamaGuard38b} 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("LlamaGuard38b has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link LlamaGuard38b} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( violentCrimes != null ) + declaredFields.put("violentCrimes", violentCrimes); + if( nonViolentCrimes != null ) + declaredFields.put("nonViolentCrimes", nonViolentCrimes); + if( sexCrimes != null ) + declaredFields.put("sexCrimes", sexCrimes); + if( childExploitation != null ) + declaredFields.put("childExploitation", childExploitation); + if( defamation != null ) + declaredFields.put("defamation", defamation); + if( specializedAdvice != null ) + declaredFields.put("specializedAdvice", specializedAdvice); + if( privacy != null ) + declaredFields.put("privacy", privacy); + if( intellectualProperty != null ) + declaredFields.put("intellectualProperty", intellectualProperty); + if( indiscriminateWeapons != null ) + declaredFields.put("indiscriminateWeapons", indiscriminateWeapons); + if( hate != null ) + declaredFields.put("hate", hate); + if( selfHarm != null ) + declaredFields.put("selfHarm", selfHarm); + if( sexualContent != null ) + declaredFields.put("sexualContent", sexualContent); + if( elections != null ) + declaredFields.put("elections", elections); + if( codeInterpreterAbuse != null ) + declaredFields.put("codeInterpreterAbuse", codeInterpreterAbuse); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link LlamaGuard38b} 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 LlamaGuard38b llamaGuard38b = (LlamaGuard38b) o; + return Objects.equals(this.cloudSdkCustomFields, llamaGuard38b.cloudSdkCustomFields) + && Objects.equals(this.violentCrimes, llamaGuard38b.violentCrimes) + && Objects.equals(this.nonViolentCrimes, llamaGuard38b.nonViolentCrimes) + && Objects.equals(this.sexCrimes, llamaGuard38b.sexCrimes) + && Objects.equals(this.childExploitation, llamaGuard38b.childExploitation) + && Objects.equals(this.defamation, llamaGuard38b.defamation) + && Objects.equals(this.specializedAdvice, llamaGuard38b.specializedAdvice) + && Objects.equals(this.privacy, llamaGuard38b.privacy) + && Objects.equals(this.intellectualProperty, llamaGuard38b.intellectualProperty) + && Objects.equals(this.indiscriminateWeapons, llamaGuard38b.indiscriminateWeapons) + && Objects.equals(this.hate, llamaGuard38b.hate) + && Objects.equals(this.selfHarm, llamaGuard38b.selfHarm) + && Objects.equals(this.sexualContent, llamaGuard38b.sexualContent) + && Objects.equals(this.elections, llamaGuard38b.elections) + && Objects.equals(this.codeInterpreterAbuse, llamaGuard38b.codeInterpreterAbuse); + } + + @Override + public int hashCode() + { + return Objects + .hash( + violentCrimes, + nonViolentCrimes, + sexCrimes, + childExploitation, + defamation, + specializedAdvice, + privacy, + intellectualProperty, + indiscriminateWeapons, + hate, + selfHarm, + sexualContent, + elections, + codeInterpreterAbuse, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class LlamaGuard38b {\n"); + sb.append(" violentCrimes: ").append(toIndentedString(violentCrimes)).append("\n"); + sb.append(" nonViolentCrimes: ").append(toIndentedString(nonViolentCrimes)).append("\n"); + sb.append(" sexCrimes: ").append(toIndentedString(sexCrimes)).append("\n"); + sb.append(" childExploitation: ").append(toIndentedString(childExploitation)).append("\n"); + sb.append(" defamation: ").append(toIndentedString(defamation)).append("\n"); + sb.append(" specializedAdvice: ").append(toIndentedString(specializedAdvice)).append("\n"); + sb.append(" privacy: ").append(toIndentedString(privacy)).append("\n"); + sb.append(" intellectualProperty: ").append(toIndentedString(intellectualProperty)).append("\n"); + sb.append(" indiscriminateWeapons: ").append(toIndentedString(indiscriminateWeapons)).append("\n"); + sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); + sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); + sb.append(" sexualContent: ").append(toIndentedString(sexualContent)).append("\n"); + sb.append(" elections: ").append(toIndentedString(elections)).append("\n"); + sb.append(" codeInterpreterAbuse: ").append(toIndentedString(codeInterpreterAbuse)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java new file mode 100644 index 000000000..dcd3b3c94 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * LlamaGuard38bFilterConfig + */ + +@Beta // CHECKSTYLE:OFF +public class LlamaGuard38bFilterConfig implements InputFilterConfig, OutputFilterConfig +// CHECKSTYLE:ON +{ + /** + * Name of the filter provider type + */ + public enum TypeEnum + { + /** + * The LLAMA_GUARD_3_8B option of this LlamaGuard38bFilterConfig + */ + LLAMA_GUARD_3_8B("llama_guard_3_8b"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this LlamaGuard38bFilterConfig + */ + 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 LlamaGuard38bFilterConfig + */ + @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 LlamaGuard38b config; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for LlamaGuard38bFilterConfig. + */ + protected LlamaGuard38bFilterConfig() + { + } + + /** + * Set the type of this {@link LlamaGuard38bFilterConfig} instance and return the same instance. + * + * @param type + * Name of the filter provider type + * @return The same instance of this {@link LlamaGuard38bFilterConfig} class + */ + @Nonnull + public LlamaGuard38bFilterConfig type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Name of the filter provider type + * + * @return type The type of this {@link LlamaGuard38bFilterConfig} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link LlamaGuard38bFilterConfig} instance. + * + * @param type + * Name of the filter provider type + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the config of this {@link LlamaGuard38bFilterConfig} instance and return the same instance. + * + * @param config + * The config of this {@link LlamaGuard38bFilterConfig} + * @return The same instance of this {@link LlamaGuard38bFilterConfig} class + */ + @Nonnull + public LlamaGuard38bFilterConfig config( @Nonnull final LlamaGuard38b config ) + { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link LlamaGuard38bFilterConfig} instance. + */ + @Nonnull + public LlamaGuard38b getConfig() + { + return config; + } + + /** + * Set the config of this {@link LlamaGuard38bFilterConfig} instance. + * + * @param config + * The config of this {@link LlamaGuard38bFilterConfig} + */ + public void setConfig( @Nonnull final LlamaGuard38b config ) + { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link LlamaGuard38bFilterConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LlamaGuard38bFilterConfig} 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("LlamaGuard38bFilterConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link LlamaGuard38bFilterConfig} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( config != null ) + declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link LlamaGuard38bFilterConfig} 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 LlamaGuard38bFilterConfig llamaGuard38bFilterConfig = (LlamaGuard38bFilterConfig) o; + return Objects.equals(this.cloudSdkCustomFields, llamaGuard38bFilterConfig.cloudSdkCustomFields) + && Objects.equals(this.type, llamaGuard38bFilterConfig.type) + && Objects.equals(this.config, llamaGuard38bFilterConfig.config); + } + + @Override + public int hashCode() + { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class LlamaGuard38bFilterConfig {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java new file mode 100644 index 000000000..2a4474192 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * MaskingModuleConfig + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = MaskingModuleConfigMaskingProviders.class ), + @JsonSubTypes.Type( value = MaskingModuleConfigProviders.class ), } ) + +public interface MaskingModuleConfig +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java new file mode 100644 index 000000000..6ec620150 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * MaskingModuleConfigMaskingProviders + */ + +@Beta // CHECKSTYLE:OFF +public class MaskingModuleConfigMaskingProviders implements MaskingModuleConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "masking_providers" ) + private List maskingProviders = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for MaskingModuleConfigMaskingProviders. + */ + protected MaskingModuleConfigMaskingProviders() + { + } + + /** + * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance and return the same + * instance. + * + * @param maskingProviders + * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use + * `providers` property instead. + * @return The same instance of this {@link MaskingModuleConfigMaskingProviders} class + */ + @Nonnull + public MaskingModuleConfigMaskingProviders maskingProviders( @Nonnull final List maskingProviders ) + { + this.maskingProviders = maskingProviders; + return this; + } + + /** + * Add one maskingProviders instance to this {@link MaskingModuleConfigMaskingProviders}. + * + * @param maskingProvidersItem + * The maskingProviders that should be added + * @return The same instance of type {@link MaskingModuleConfigMaskingProviders} + */ + @Nonnull + public MaskingModuleConfigMaskingProviders addMaskingProvidersItem( @Nonnull final DPIConfig maskingProvidersItem ) + { + if( this.maskingProviders == null ) { + this.maskingProviders = new ArrayList<>(); + } + this.maskingProviders.add(maskingProvidersItem); + return this; + } + + /** + * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` + * property instead. + * + * @return maskingProviders The maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. + * @deprecated + */ + @Deprecated + @Nonnull + public List getMaskingProviders() + { + return maskingProviders; + } + + /** + * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. + * + * @param maskingProviders + * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use + * `providers` property instead. + */ + public void setMaskingProviders( @Nonnull final List maskingProviders ) + { + this.maskingProviders = maskingProviders; + } + + /** + * Get the names of the unrecognizable properties of the {@link MaskingModuleConfigMaskingProviders}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MaskingModuleConfigMaskingProviders} 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( + "MaskingModuleConfigMaskingProviders has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MaskingModuleConfigMaskingProviders} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( maskingProviders != null ) + declaredFields.put("maskingProviders", maskingProviders); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MaskingModuleConfigMaskingProviders} 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 MaskingModuleConfigMaskingProviders maskingModuleConfigMaskingProviders = + (MaskingModuleConfigMaskingProviders) o; + return Objects.equals(this.cloudSdkCustomFields, maskingModuleConfigMaskingProviders.cloudSdkCustomFields) + && Objects.equals(this.maskingProviders, maskingModuleConfigMaskingProviders.maskingProviders); + } + + @Override + public int hashCode() + { + return Objects.hash(maskingProviders, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class MaskingModuleConfigMaskingProviders {\n"); + sb.append(" maskingProviders: ").append(toIndentedString(maskingProviders)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java new file mode 100644 index 000000000..8465d3086 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * MaskingModuleConfigProviders + */ + +@Beta // CHECKSTYLE:OFF +public class MaskingModuleConfigProviders implements MaskingModuleConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "providers" ) + private List providers = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for MaskingModuleConfigProviders. + */ + protected MaskingModuleConfigProviders() + { + } + + /** + * Set the providers of this {@link MaskingModuleConfigProviders} instance and return the same instance. + * + * @param providers + * List of masking service providers + * @return The same instance of this {@link MaskingModuleConfigProviders} class + */ + @Nonnull + public MaskingModuleConfigProviders providers( @Nonnull final List providers ) + { + this.providers = providers; + return this; + } + + /** + * Add one providers instance to this {@link MaskingModuleConfigProviders}. + * + * @param providersItem + * The providers that should be added + * @return The same instance of type {@link MaskingModuleConfigProviders} + */ + @Nonnull + public MaskingModuleConfigProviders addProvidersItem( @Nonnull final DPIConfig providersItem ) + { + if( this.providers == null ) { + this.providers = new ArrayList<>(); + } + this.providers.add(providersItem); + return this; + } + + /** + * List of masking service providers + * + * @return providers The providers of this {@link MaskingModuleConfigProviders} instance. + */ + @Nonnull + public List getProviders() + { + return providers; + } + + /** + * Set the providers of this {@link MaskingModuleConfigProviders} instance. + * + * @param providers + * List of masking service providers + */ + public void setProviders( @Nonnull final List providers ) + { + this.providers = providers; + } + + /** + * Get the names of the unrecognizable properties of the {@link MaskingModuleConfigProviders}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MaskingModuleConfigProviders} 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("MaskingModuleConfigProviders has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MaskingModuleConfigProviders} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( providers != null ) + declaredFields.put("providers", providers); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MaskingModuleConfigProviders} 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 MaskingModuleConfigProviders maskingModuleConfigProviders = (MaskingModuleConfigProviders) o; + return Objects.equals(this.cloudSdkCustomFields, maskingModuleConfigProviders.cloudSdkCustomFields) + && Objects.equals(this.providers, maskingModuleConfigProviders.providers); + } + + @Override + public int hashCode() + { + return Objects.hash(providers, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class MaskingModuleConfigProviders {\n"); + sb.append(" providers: ").append(toIndentedString(providers)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java new file mode 100644 index 000000000..54c929f92 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * MessageToolCall + */ + +@Beta // CHECKSTYLE:OFF +public class MessageToolCall +// CHECKSTYLE:ON +{ + @JsonProperty( "id" ) + private String id; + + /** + * The type of the tool. Currently, only `function` is supported. + */ + public enum TypeEnum + { + /** + * The FUNCTION option of this MessageToolCall + */ + FUNCTION("function"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this MessageToolCall + */ + 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 MessageToolCall + */ + @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( "function" ) + private MessageToolCallFunction function; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for MessageToolCall. + */ + protected MessageToolCall() + { + } + + /** + * Set the id of this {@link MessageToolCall} instance and return the same instance. + * + * @param id + * The ID of the tool call. + * @return The same instance of this {@link MessageToolCall} class + */ + @Nonnull + public MessageToolCall id( @Nonnull final String id ) + { + this.id = id; + return this; + } + + /** + * The ID of the tool call. + * + * @return id The id of this {@link MessageToolCall} instance. + */ + @Nonnull + public String getId() + { + return id; + } + + /** + * Set the id of this {@link MessageToolCall} instance. + * + * @param id + * The ID of the tool call. + */ + public void setId( @Nonnull final String id ) + { + this.id = id; + } + + /** + * Set the type of this {@link MessageToolCall} instance and return the same instance. + * + * @param type + * The type of the tool. Currently, only `function` is supported. + * @return The same instance of this {@link MessageToolCall} class + */ + @Nonnull + public MessageToolCall type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * The type of the tool. Currently, only `function` is supported. + * + * @return type The type of this {@link MessageToolCall} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link MessageToolCall} instance. + * + * @param type + * The type of the tool. Currently, only `function` is supported. + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the function of this {@link MessageToolCall} instance and return the same instance. + * + * @param function + * The function of this {@link MessageToolCall} + * @return The same instance of this {@link MessageToolCall} class + */ + @Nonnull + public MessageToolCall function( @Nonnull final MessageToolCallFunction function ) + { + this.function = function; + return this; + } + + /** + * Get function + * + * @return function The function of this {@link MessageToolCall} instance. + */ + @Nonnull + public MessageToolCallFunction getFunction() + { + return function; + } + + /** + * Set the function of this {@link MessageToolCall} instance. + * + * @param function + * The function of this {@link MessageToolCall} + */ + public void setFunction( @Nonnull final MessageToolCallFunction function ) + { + this.function = function; + } + + /** + * Get the names of the unrecognizable properties of the {@link MessageToolCall}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MessageToolCall} 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("MessageToolCall has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MessageToolCall} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( id != null ) + declaredFields.put("id", id); + if( type != null ) + declaredFields.put("type", type); + if( function != null ) + declaredFields.put("function", function); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MessageToolCall} 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 MessageToolCall messageToolCall = (MessageToolCall) o; + return Objects.equals(this.cloudSdkCustomFields, messageToolCall.cloudSdkCustomFields) + && Objects.equals(this.id, messageToolCall.id) + && Objects.equals(this.type, messageToolCall.type) + && Objects.equals(this.function, messageToolCall.function); + } + + @Override + public int hashCode() + { + return Objects.hash(id, type, function, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class MessageToolCall {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java new file mode 100644 index 000000000..e6bd2178a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * The function that the model called. + */ + +@Beta // CHECKSTYLE:OFF +public class MessageToolCallFunction +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "arguments" ) + private String arguments; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for MessageToolCallFunction. + */ + protected MessageToolCallFunction() + { + } + + /** + * Set the name of this {@link MessageToolCallFunction} instance and return the same instance. + * + * @param name + * The name of the function to call. + * @return The same instance of this {@link MessageToolCallFunction} class + */ + @Nonnull + public MessageToolCallFunction name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * The name of the function to call. + * + * @return name The name of this {@link MessageToolCallFunction} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link MessageToolCallFunction} instance. + * + * @param name + * The name of the function to call. + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the arguments of this {@link MessageToolCallFunction} instance and return the same instance. + * + * @param arguments + * The arguments to call the function with, as generated by the model in JSON format. Note that the model + * does not always generate valid JSON, and may hallucinate parameters not defined by your function + * schema. Validate the arguments in your code before calling your function. + * @return The same instance of this {@link MessageToolCallFunction} class + */ + @Nonnull + public MessageToolCallFunction arguments( @Nonnull final String arguments ) + { + this.arguments = arguments; + return this; + } + + /** + * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not + * always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + * + * @return arguments The arguments of this {@link MessageToolCallFunction} instance. + */ + @Nonnull + public String getArguments() + { + return arguments; + } + + /** + * Set the arguments of this {@link MessageToolCallFunction} instance. + * + * @param arguments + * The arguments to call the function with, as generated by the model in JSON format. Note that the model + * does not always generate valid JSON, and may hallucinate parameters not defined by your function + * schema. Validate the arguments in your code before calling your function. + */ + public void setArguments( @Nonnull final String arguments ) + { + this.arguments = arguments; + } + + /** + * Get the names of the unrecognizable properties of the {@link MessageToolCallFunction}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MessageToolCallFunction} 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("MessageToolCallFunction has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MessageToolCallFunction} 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( arguments != null ) + declaredFields.put("arguments", arguments); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MessageToolCallFunction} 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 MessageToolCallFunction messageToolCallFunction = (MessageToolCallFunction) o; + return Objects.equals(this.cloudSdkCustomFields, messageToolCallFunction.cloudSdkCustomFields) + && Objects.equals(this.name, messageToolCallFunction.name) + && Objects.equals(this.arguments, messageToolCallFunction.arguments); + } + + @Override + public int hashCode() + { + return Objects.hash(name, arguments, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class MessageToolCallFunction {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java new file mode 100644 index 000000000..51809571b --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * ModuleConfigs + */ + +@Beta // CHECKSTYLE:OFF +public class ModuleConfigs +// CHECKSTYLE:ON +{ + @JsonProperty( "prompt_templating" ) + private PromptTemplatingModuleConfig promptTemplating; + + @JsonProperty( "filtering" ) + private FilteringModuleConfig filtering; + + @JsonProperty( "masking" ) + private MaskingModuleConfig masking; + + @JsonProperty( "grounding" ) + private GroundingModuleConfig grounding; + + @JsonProperty( "translation" ) + private TranslationModuleConfig translation; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ModuleConfigs. + */ + protected ModuleConfigs() + { + } + + /** + * Set the promptTemplating of this {@link ModuleConfigs} instance and return the same instance. + * + * @param promptTemplating + * The promptTemplating of this {@link ModuleConfigs} + * @return The same instance of this {@link ModuleConfigs} class + */ + @Nonnull + public ModuleConfigs promptTemplating( @Nonnull final PromptTemplatingModuleConfig promptTemplating ) + { + this.promptTemplating = promptTemplating; + return this; + } + + /** + * Get promptTemplating + * + * @return promptTemplating The promptTemplating of this {@link ModuleConfigs} instance. + */ + @Nonnull + public PromptTemplatingModuleConfig getPromptTemplating() + { + return promptTemplating; + } + + /** + * Set the promptTemplating of this {@link ModuleConfigs} instance. + * + * @param promptTemplating + * The promptTemplating of this {@link ModuleConfigs} + */ + public void setPromptTemplating( @Nonnull final PromptTemplatingModuleConfig promptTemplating ) + { + this.promptTemplating = promptTemplating; + } + + /** + * Set the filtering of this {@link ModuleConfigs} instance and return the same instance. + * + * @param filtering + * The filtering of this {@link ModuleConfigs} + * @return The same instance of this {@link ModuleConfigs} class + */ + @Nonnull + public ModuleConfigs filtering( @Nullable final FilteringModuleConfig filtering ) + { + this.filtering = filtering; + return this; + } + + /** + * Get filtering + * + * @return filtering The filtering of this {@link ModuleConfigs} instance. + */ + @Nonnull + public FilteringModuleConfig getFiltering() + { + return filtering; + } + + /** + * Set the filtering of this {@link ModuleConfigs} instance. + * + * @param filtering + * The filtering of this {@link ModuleConfigs} + */ + public void setFiltering( @Nullable final FilteringModuleConfig filtering ) + { + this.filtering = filtering; + } + + /** + * Set the masking of this {@link ModuleConfigs} instance and return the same instance. + * + * @param masking + * The masking of this {@link ModuleConfigs} + * @return The same instance of this {@link ModuleConfigs} class + */ + @Nonnull + public ModuleConfigs masking( @Nullable final MaskingModuleConfig masking ) + { + this.masking = masking; + return this; + } + + /** + * Get masking + * + * @return masking The masking of this {@link ModuleConfigs} instance. + */ + @Nonnull + public MaskingModuleConfig getMasking() + { + return masking; + } + + /** + * Set the masking of this {@link ModuleConfigs} instance. + * + * @param masking + * The masking of this {@link ModuleConfigs} + */ + public void setMasking( @Nullable final MaskingModuleConfig masking ) + { + this.masking = masking; + } + + /** + * Set the grounding of this {@link ModuleConfigs} instance and return the same instance. + * + * @param grounding + * The grounding of this {@link ModuleConfigs} + * @return The same instance of this {@link ModuleConfigs} class + */ + @Nonnull + public ModuleConfigs grounding( @Nullable final GroundingModuleConfig grounding ) + { + this.grounding = grounding; + return this; + } + + /** + * Get grounding + * + * @return grounding The grounding of this {@link ModuleConfigs} instance. + */ + @Nonnull + public GroundingModuleConfig getGrounding() + { + return grounding; + } + + /** + * Set the grounding of this {@link ModuleConfigs} instance. + * + * @param grounding + * The grounding of this {@link ModuleConfigs} + */ + public void setGrounding( @Nullable final GroundingModuleConfig grounding ) + { + this.grounding = grounding; + } + + /** + * Set the translation of this {@link ModuleConfigs} instance and return the same instance. + * + * @param translation + * The translation of this {@link ModuleConfigs} + * @return The same instance of this {@link ModuleConfigs} class + */ + @Nonnull + public ModuleConfigs translation( @Nullable final TranslationModuleConfig translation ) + { + this.translation = translation; + return this; + } + + /** + * Get translation + * + * @return translation The translation of this {@link ModuleConfigs} instance. + */ + @Nonnull + public TranslationModuleConfig getTranslation() + { + return translation; + } + + /** + * Set the translation of this {@link ModuleConfigs} instance. + * + * @param translation + * The translation of this {@link ModuleConfigs} + */ + public void setTranslation( @Nullable final TranslationModuleConfig translation ) + { + this.translation = translation; + } + + /** + * Get the names of the unrecognizable properties of the {@link ModuleConfigs}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ModuleConfigs} 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("ModuleConfigs has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ModuleConfigs} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( promptTemplating != null ) + declaredFields.put("promptTemplating", promptTemplating); + if( filtering != null ) + declaredFields.put("filtering", filtering); + if( masking != null ) + declaredFields.put("masking", masking); + if( grounding != null ) + declaredFields.put("grounding", grounding); + if( translation != null ) + declaredFields.put("translation", translation); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ModuleConfigs} 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 ModuleConfigs moduleConfigs = (ModuleConfigs) o; + return Objects.equals(this.cloudSdkCustomFields, moduleConfigs.cloudSdkCustomFields) + && Objects.equals(this.promptTemplating, moduleConfigs.promptTemplating) + && Objects.equals(this.filtering, moduleConfigs.filtering) + && Objects.equals(this.masking, moduleConfigs.masking) + && Objects.equals(this.grounding, moduleConfigs.grounding) + && Objects.equals(this.translation, moduleConfigs.translation); + } + + @Override + public int hashCode() + { + return Objects.hash(promptTemplating, filtering, masking, grounding, translation, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ModuleConfigs {\n"); + sb.append(" promptTemplating: ").append(toIndentedString(promptTemplating)).append("\n"); + sb.append(" filtering: ").append(toIndentedString(filtering)).append("\n"); + sb.append(" masking: ").append(toIndentedString(masking)).append("\n"); + sb.append(" grounding: ").append(toIndentedString(grounding)).append("\n"); + sb.append(" translation: ").append(toIndentedString(translation)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java new file mode 100644 index 000000000..1c48f4e11 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * MultiChatContent + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { @JsonSubTypes.Type( value = ImageContent.class ), @JsonSubTypes.Type( value = TextContent.class ), } ) + +public interface MultiChatContent +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java new file mode 100644 index 000000000..63a5be7fd --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * MultiChatTemplate + */ + +@Beta // CHECKSTYLE:OFF +public class MultiChatTemplate implements PromptTemplate +// CHECKSTYLE:ON +{ + @JsonProperty( "role" ) + private String role; + + @JsonProperty( "content" ) + private List content = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for MultiChatTemplate. + */ + protected MultiChatTemplate() + { + } + + /** + * Set the role of this {@link MultiChatTemplate} instance and return the same instance. + * + * @param role + * The role of this {@link MultiChatTemplate} + * @return The same instance of this {@link MultiChatTemplate} class + */ + @Nonnull + public MultiChatTemplate role( @Nonnull final String role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link MultiChatTemplate} instance. + */ + @Nonnull + public String getRole() + { + return role; + } + + /** + * Set the role of this {@link MultiChatTemplate} instance. + * + * @param role + * The role of this {@link MultiChatTemplate} + */ + public void setRole( @Nonnull final String role ) + { + this.role = role; + } + + /** + * Set the content of this {@link MultiChatTemplate} instance and return the same instance. + * + * @param content + * The content of this {@link MultiChatTemplate} + * @return The same instance of this {@link MultiChatTemplate} class + */ + @Nonnull + public MultiChatTemplate content( @Nonnull final List content ) + { + this.content = content; + return this; + } + + /** + * Add one content instance to this {@link MultiChatTemplate}. + * + * @param contentItem + * The content that should be added + * @return The same instance of type {@link MultiChatTemplate} + */ + @Nonnull + public MultiChatTemplate addContentItem( @Nonnull final MultiChatContent contentItem ) + { + if( this.content == null ) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * + * @return content The content of this {@link MultiChatTemplate} instance. + */ + @Nonnull + public List getContent() + { + return content; + } + + /** + * Set the content of this {@link MultiChatTemplate} instance. + * + * @param content + * The content of this {@link MultiChatTemplate} + */ + public void setContent( @Nonnull final List content ) + { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link MultiChatTemplate}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MultiChatTemplate} 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("MultiChatTemplate has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MultiChatTemplate} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( role != null ) + declaredFields.put("role", role); + if( content != null ) + declaredFields.put("content", content); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MultiChatTemplate} 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 MultiChatTemplate multiChatTemplate = (MultiChatTemplate) o; + return Objects.equals(this.cloudSdkCustomFields, multiChatTemplate.cloudSdkCustomFields) + && Objects.equals(this.role, multiChatTemplate.role) + && Objects.equals(this.content, multiChatTemplate.content); + } + + @Override + public int hashCode() + { + return Objects.hash(role, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class MultiChatTemplate {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java new file mode 100644 index 000000000..41863b943 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfig + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "modules" ) + private ModuleConfigs modules; + + @JsonProperty( "stream" ) + private GlobalStreamOptions stream; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfig. + */ + protected OrchestrationConfig() + { + } + + /** + * Set the modules of this {@link OrchestrationConfig} instance and return the same instance. + * + * @param modules + * The modules of this {@link OrchestrationConfig} + * @return The same instance of this {@link OrchestrationConfig} class + */ + @Nonnull + public OrchestrationConfig modules( @Nonnull final ModuleConfigs modules ) + { + this.modules = modules; + return this; + } + + /** + * Get modules + * + * @return modules The modules of this {@link OrchestrationConfig} instance. + */ + @Nonnull + public ModuleConfigs getModules() + { + return modules; + } + + /** + * Set the modules of this {@link OrchestrationConfig} instance. + * + * @param modules + * The modules of this {@link OrchestrationConfig} + */ + public void setModules( @Nonnull final ModuleConfigs modules ) + { + this.modules = modules; + } + + /** + * Set the stream of this {@link OrchestrationConfig} instance and return the same instance. + * + * @param stream + * The stream of this {@link OrchestrationConfig} + * @return The same instance of this {@link OrchestrationConfig} class + */ + @Nonnull + public OrchestrationConfig stream( @Nullable final GlobalStreamOptions stream ) + { + this.stream = stream; + return this; + } + + /** + * Get stream + * + * @return stream The stream of this {@link OrchestrationConfig} instance. + */ + @Nonnull + public GlobalStreamOptions getStream() + { + return stream; + } + + /** + * Set the stream of this {@link OrchestrationConfig} instance. + * + * @param stream + * The stream of this {@link OrchestrationConfig} + */ + public void setStream( @Nullable final GlobalStreamOptions stream ) + { + this.stream = stream; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfig} 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("OrchestrationConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfig} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( modules != null ) + declaredFields.put("modules", modules); + if( stream != null ) + declaredFields.put("stream", stream); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfig} 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 OrchestrationConfig orchestrationConfig = (OrchestrationConfig) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfig.cloudSdkCustomFields) + && Objects.equals(this.modules, orchestrationConfig.modules) + && Objects.equals(this.stream, orchestrationConfig.stream); + } + + @Override + public int hashCode() + { + return Objects.hash(modules, stream, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfig {\n"); + sb.append(" modules: ").append(toIndentedString(modules)).append("\n"); + sb.append(" stream: ").append(toIndentedString(stream)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java new file mode 100644 index 000000000..220347c72 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfigDeleteResponse + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfigDeleteResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "message" ) + private String message; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfigDeleteResponse. + */ + protected OrchestrationConfigDeleteResponse() + { + } + + /** + * Set the message of this {@link OrchestrationConfigDeleteResponse} instance and return the same instance. + * + * @param message + * The message of this {@link OrchestrationConfigDeleteResponse} + * @return The same instance of this {@link OrchestrationConfigDeleteResponse} class + */ + @Nonnull + public OrchestrationConfigDeleteResponse message( @Nonnull final String message ) + { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link OrchestrationConfigDeleteResponse} instance. + */ + @Nonnull + public String getMessage() + { + return message; + } + + /** + * Set the message of this {@link OrchestrationConfigDeleteResponse} instance. + * + * @param message + * The message of this {@link OrchestrationConfigDeleteResponse} + */ + public void setMessage( @Nonnull final String message ) + { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfigDeleteResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfigDeleteResponse} 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( + "OrchestrationConfigDeleteResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfigDeleteResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( message != null ) + declaredFields.put("message", message); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfigDeleteResponse} 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 OrchestrationConfigDeleteResponse orchestrationConfigDeleteResponse = + (OrchestrationConfigDeleteResponse) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigDeleteResponse.cloudSdkCustomFields) + && Objects.equals(this.message, orchestrationConfigDeleteResponse.message); + } + + @Override + public int hashCode() + { + return Objects.hash(message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfigDeleteResponse {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java new file mode 100644 index 000000000..4981e48cc --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfigGetResponse + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfigGetResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "id" ) + private UUID id; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "creation_timestamp" ) + private String creationTimestamp; + + @JsonProperty( "managed_by" ) + private String managedBy; + + @JsonProperty( "is_version_head" ) + private Boolean isVersionHead; + + @JsonProperty( "resource_group_id" ) + private String resourceGroupId; + + @JsonProperty( "spec" ) + private OrchestrationConfig spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfigGetResponse. + */ + protected OrchestrationConfigGetResponse() + { + } + + /** + * Set the id of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param id + * The id of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse id( @Nullable final UUID id ) + { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public UUID getId() + { + return id; + } + + /** + * Set the id of this {@link OrchestrationConfigGetResponse} instance. + * + * @param id + * The id of this {@link OrchestrationConfigGetResponse} + */ + public void setId( @Nullable final UUID id ) + { + this.id = id; + } + + /** + * Set the name of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param name + * The name of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse name( @Nullable final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link OrchestrationConfigGetResponse} instance. + * + * @param name + * The name of this {@link OrchestrationConfigGetResponse} + */ + public void setName( @Nullable final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param version + * The version of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse version( @Nullable final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link OrchestrationConfigGetResponse} instance. + * + * @param version + * The version of this {@link OrchestrationConfigGetResponse} + */ + public void setVersion( @Nullable final String version ) + { + this.version = version; + } + + /** + * Set the scenario of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse scenario( @Nullable final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link OrchestrationConfigGetResponse} instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigGetResponse} + */ + public void setScenario( @Nullable final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the creationTimestamp of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param creationTimestamp + * The creationTimestamp of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse creationTimestamp( @Nullable final String creationTimestamp ) + { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * Get creationTimestamp + * + * @return creationTimestamp The creationTimestamp of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public String getCreationTimestamp() + { + return creationTimestamp; + } + + /** + * Set the creationTimestamp of this {@link OrchestrationConfigGetResponse} instance. + * + * @param creationTimestamp + * The creationTimestamp of this {@link OrchestrationConfigGetResponse} + */ + public void setCreationTimestamp( @Nullable final String creationTimestamp ) + { + this.creationTimestamp = creationTimestamp; + } + + /** + * Set the managedBy of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param managedBy + * The managedBy of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse managedBy( @Nullable final String managedBy ) + { + this.managedBy = managedBy; + return this; + } + + /** + * Get managedBy + * + * @return managedBy The managedBy of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public String getManagedBy() + { + return managedBy; + } + + /** + * Set the managedBy of this {@link OrchestrationConfigGetResponse} instance. + * + * @param managedBy + * The managedBy of this {@link OrchestrationConfigGetResponse} + */ + public void setManagedBy( @Nullable final String managedBy ) + { + this.managedBy = managedBy; + } + + /** + * Set the isVersionHead of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param isVersionHead + * The isVersionHead of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse isVersionHead( @Nullable final Boolean isVersionHead ) + { + this.isVersionHead = isVersionHead; + return this; + } + + /** + * Get isVersionHead + * + * @return isVersionHead The isVersionHead of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public Boolean isIsVersionHead() + { + return isVersionHead; + } + + /** + * Set the isVersionHead of this {@link OrchestrationConfigGetResponse} instance. + * + * @param isVersionHead + * The isVersionHead of this {@link OrchestrationConfigGetResponse} + */ + public void setIsVersionHead( @Nullable final Boolean isVersionHead ) + { + this.isVersionHead = isVersionHead; + } + + /** + * Set the resourceGroupId of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param resourceGroupId + * The resourceGroupId of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse resourceGroupId( @Nullable final String resourceGroupId ) + { + this.resourceGroupId = resourceGroupId; + return this; + } + + /** + * Get resourceGroupId + * + * @return resourceGroupId The resourceGroupId of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public String getResourceGroupId() + { + return resourceGroupId; + } + + /** + * Set the resourceGroupId of this {@link OrchestrationConfigGetResponse} instance. + * + * @param resourceGroupId + * The resourceGroupId of this {@link OrchestrationConfigGetResponse} + */ + public void setResourceGroupId( @Nullable final String resourceGroupId ) + { + this.resourceGroupId = resourceGroupId; + } + + /** + * Set the spec of this {@link OrchestrationConfigGetResponse} instance and return the same instance. + * + * @param spec + * The spec of this {@link OrchestrationConfigGetResponse} + * @return The same instance of this {@link OrchestrationConfigGetResponse} class + */ + @Nonnull + public OrchestrationConfigGetResponse spec( @Nullable final OrchestrationConfig spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link OrchestrationConfigGetResponse} instance. + */ + @Nonnull + public OrchestrationConfig getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link OrchestrationConfigGetResponse} instance. + * + * @param spec + * The spec of this {@link OrchestrationConfigGetResponse} + */ + public void setSpec( @Nullable final OrchestrationConfig spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfigGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfigGetResponse} 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("OrchestrationConfigGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfigGetResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( id != null ) + declaredFields.put("id", id); + if( name != null ) + declaredFields.put("name", name); + if( version != null ) + declaredFields.put("version", version); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( creationTimestamp != null ) + declaredFields.put("creationTimestamp", creationTimestamp); + if( managedBy != null ) + declaredFields.put("managedBy", managedBy); + if( isVersionHead != null ) + declaredFields.put("isVersionHead", isVersionHead); + if( resourceGroupId != null ) + declaredFields.put("resourceGroupId", resourceGroupId); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfigGetResponse} 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 OrchestrationConfigGetResponse orchestrationConfigGetResponse = (OrchestrationConfigGetResponse) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, orchestrationConfigGetResponse.id) + && Objects.equals(this.name, orchestrationConfigGetResponse.name) + && Objects.equals(this.version, orchestrationConfigGetResponse.version) + && Objects.equals(this.scenario, orchestrationConfigGetResponse.scenario) + && Objects.equals(this.creationTimestamp, orchestrationConfigGetResponse.creationTimestamp) + && Objects.equals(this.managedBy, orchestrationConfigGetResponse.managedBy) + && Objects.equals(this.isVersionHead, orchestrationConfigGetResponse.isVersionHead) + && Objects.equals(this.resourceGroupId, orchestrationConfigGetResponse.resourceGroupId) + && Objects.equals(this.spec, orchestrationConfigGetResponse.spec); + } + + @Override + public int hashCode() + { + return Objects + .hash( + id, + name, + version, + scenario, + creationTimestamp, + managedBy, + isVersionHead, + resourceGroupId, + spec, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfigGetResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" managedBy: ").append(toIndentedString(managedBy)).append("\n"); + sb.append(" isVersionHead: ").append(toIndentedString(isVersionHead)).append("\n"); + sb.append(" resourceGroupId: ").append(toIndentedString(resourceGroupId)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java new file mode 100644 index 000000000..bbb96af9f --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfigListResponse + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfigListResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "count" ) + private Integer count; + + @JsonProperty( "resources" ) + private List resources = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfigListResponse. + */ + protected OrchestrationConfigListResponse() + { + } + + /** + * Set the count of this {@link OrchestrationConfigListResponse} instance and return the same instance. + * + * @param count + * The count of this {@link OrchestrationConfigListResponse} + * @return The same instance of this {@link OrchestrationConfigListResponse} class + */ + @Nonnull + public OrchestrationConfigListResponse count( @Nonnull final Integer count ) + { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link OrchestrationConfigListResponse} instance. + */ + @Nonnull + public Integer getCount() + { + return count; + } + + /** + * Set the count of this {@link OrchestrationConfigListResponse} instance. + * + * @param count + * The count of this {@link OrchestrationConfigListResponse} + */ + public void setCount( @Nonnull final Integer count ) + { + this.count = count; + } + + /** + * Set the resources of this {@link OrchestrationConfigListResponse} instance and return the same instance. + * + * @param resources + * The resources of this {@link OrchestrationConfigListResponse} + * @return The same instance of this {@link OrchestrationConfigListResponse} class + */ + @Nonnull + public OrchestrationConfigListResponse resources( @Nonnull final List resources ) + { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link OrchestrationConfigListResponse}. + * + * @param resourcesItem + * The resources that should be added + * @return The same instance of type {@link OrchestrationConfigListResponse} + */ + @Nonnull + public OrchestrationConfigListResponse addResourcesItem( + @Nonnull final OrchestrationConfigGetResponse resourcesItem ) + { + if( this.resources == null ) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link OrchestrationConfigListResponse} instance. + */ + @Nonnull + public List getResources() + { + return resources; + } + + /** + * Set the resources of this {@link OrchestrationConfigListResponse} instance. + * + * @param resources + * The resources of this {@link OrchestrationConfigListResponse} + */ + public void setResources( @Nonnull final List resources ) + { + this.resources = resources; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfigListResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfigListResponse} 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("OrchestrationConfigListResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfigListResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( count != null ) + declaredFields.put("count", count); + if( resources != null ) + declaredFields.put("resources", resources); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfigListResponse} 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 OrchestrationConfigListResponse orchestrationConfigListResponse = (OrchestrationConfigListResponse) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigListResponse.cloudSdkCustomFields) + && Objects.equals(this.count, orchestrationConfigListResponse.count) + && Objects.equals(this.resources, orchestrationConfigListResponse.resources); + } + + @Override + public int hashCode() + { + return Objects.hash(count, resources, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfigListResponse {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java new file mode 100644 index 000000000..3d13ac2ac --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfigPostRequest + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfigPostRequest +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "spec" ) + private OrchestrationConfig spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfigPostRequest. + */ + protected OrchestrationConfigPostRequest() + { + } + + /** + * Set the name of this {@link OrchestrationConfigPostRequest} instance and return the same instance. + * + * @param name + * The name of this {@link OrchestrationConfigPostRequest} + * @return The same instance of this {@link OrchestrationConfigPostRequest} class + */ + @Nonnull + public OrchestrationConfigPostRequest name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link OrchestrationConfigPostRequest} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link OrchestrationConfigPostRequest} instance. + * + * @param name + * The name of this {@link OrchestrationConfigPostRequest} + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link OrchestrationConfigPostRequest} instance and return the same instance. + * + * @param version + * The version of this {@link OrchestrationConfigPostRequest} + * @return The same instance of this {@link OrchestrationConfigPostRequest} class + */ + @Nonnull + public OrchestrationConfigPostRequest version( @Nonnull final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link OrchestrationConfigPostRequest} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link OrchestrationConfigPostRequest} instance. + * + * @param version + * The version of this {@link OrchestrationConfigPostRequest} + */ + public void setVersion( @Nonnull final String version ) + { + this.version = version; + } + + /** + * Set the scenario of this {@link OrchestrationConfigPostRequest} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigPostRequest} + * @return The same instance of this {@link OrchestrationConfigPostRequest} class + */ + @Nonnull + public OrchestrationConfigPostRequest scenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link OrchestrationConfigPostRequest} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link OrchestrationConfigPostRequest} instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigPostRequest} + */ + public void setScenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the spec of this {@link OrchestrationConfigPostRequest} instance and return the same instance. + * + * @param spec + * The spec of this {@link OrchestrationConfigPostRequest} + * @return The same instance of this {@link OrchestrationConfigPostRequest} class + */ + @Nonnull + public OrchestrationConfigPostRequest spec( @Nonnull final OrchestrationConfig spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link OrchestrationConfigPostRequest} instance. + */ + @Nonnull + public OrchestrationConfig getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link OrchestrationConfigPostRequest} instance. + * + * @param spec + * The spec of this {@link OrchestrationConfigPostRequest} + */ + public void setSpec( @Nonnull final OrchestrationConfig spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfigPostRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfigPostRequest} 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("OrchestrationConfigPostRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfigPostRequest} 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( version != null ) + declaredFields.put("version", version); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfigPostRequest} 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 OrchestrationConfigPostRequest orchestrationConfigPostRequest = (OrchestrationConfigPostRequest) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigPostRequest.cloudSdkCustomFields) + && Objects.equals(this.name, orchestrationConfigPostRequest.name) + && Objects.equals(this.version, orchestrationConfigPostRequest.version) + && Objects.equals(this.scenario, orchestrationConfigPostRequest.scenario) + && Objects.equals(this.spec, orchestrationConfigPostRequest.spec); + } + + @Override + public int hashCode() + { + return Objects.hash(name, version, scenario, spec, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfigPostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java new file mode 100644 index 000000000..55b98baba --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java @@ -0,0 +1,372 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfigPostResponse + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfigPostResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "message" ) + private String message; + + @JsonProperty( "id" ) + private UUID id; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfigPostResponse. + */ + protected OrchestrationConfigPostResponse() + { + } + + /** + * Set the message of this {@link OrchestrationConfigPostResponse} instance and return the same instance. + * + * @param message + * The message of this {@link OrchestrationConfigPostResponse} + * @return The same instance of this {@link OrchestrationConfigPostResponse} class + */ + @Nonnull + public OrchestrationConfigPostResponse message( @Nonnull final String message ) + { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link OrchestrationConfigPostResponse} instance. + */ + @Nonnull + public String getMessage() + { + return message; + } + + /** + * Set the message of this {@link OrchestrationConfigPostResponse} instance. + * + * @param message + * The message of this {@link OrchestrationConfigPostResponse} + */ + public void setMessage( @Nonnull final String message ) + { + this.message = message; + } + + /** + * Set the id of this {@link OrchestrationConfigPostResponse} instance and return the same instance. + * + * @param id + * The id of this {@link OrchestrationConfigPostResponse} + * @return The same instance of this {@link OrchestrationConfigPostResponse} class + */ + @Nonnull + public OrchestrationConfigPostResponse id( @Nonnull final UUID id ) + { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link OrchestrationConfigPostResponse} instance. + */ + @Nonnull + public UUID getId() + { + return id; + } + + /** + * Set the id of this {@link OrchestrationConfigPostResponse} instance. + * + * @param id + * The id of this {@link OrchestrationConfigPostResponse} + */ + public void setId( @Nonnull final UUID id ) + { + this.id = id; + } + + /** + * Set the scenario of this {@link OrchestrationConfigPostResponse} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigPostResponse} + * @return The same instance of this {@link OrchestrationConfigPostResponse} class + */ + @Nonnull + public OrchestrationConfigPostResponse scenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link OrchestrationConfigPostResponse} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link OrchestrationConfigPostResponse} instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigPostResponse} + */ + public void setScenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the name of this {@link OrchestrationConfigPostResponse} instance and return the same instance. + * + * @param name + * The name of this {@link OrchestrationConfigPostResponse} + * @return The same instance of this {@link OrchestrationConfigPostResponse} class + */ + @Nonnull + public OrchestrationConfigPostResponse name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link OrchestrationConfigPostResponse} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link OrchestrationConfigPostResponse} instance. + * + * @param name + * The name of this {@link OrchestrationConfigPostResponse} + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link OrchestrationConfigPostResponse} instance and return the same instance. + * + * @param version + * The version of this {@link OrchestrationConfigPostResponse} + * @return The same instance of this {@link OrchestrationConfigPostResponse} class + */ + @Nonnull + public OrchestrationConfigPostResponse version( @Nonnull final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link OrchestrationConfigPostResponse} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link OrchestrationConfigPostResponse} instance. + * + * @param version + * The version of this {@link OrchestrationConfigPostResponse} + */ + public void setVersion( @Nonnull final String version ) + { + this.version = version; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfigPostResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfigPostResponse} 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("OrchestrationConfigPostResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfigPostResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( message != null ) + declaredFields.put("message", message); + if( id != null ) + declaredFields.put("id", id); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( name != null ) + declaredFields.put("name", name); + if( version != null ) + declaredFields.put("version", version); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfigPostResponse} 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 OrchestrationConfigPostResponse orchestrationConfigPostResponse = (OrchestrationConfigPostResponse) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigPostResponse.cloudSdkCustomFields) + && Objects.equals(this.message, orchestrationConfigPostResponse.message) + && Objects.equals(this.id, orchestrationConfigPostResponse.id) + && Objects.equals(this.scenario, orchestrationConfigPostResponse.scenario) + && Objects.equals(this.name, orchestrationConfigPostResponse.name) + && Objects.equals(this.version, orchestrationConfigPostResponse.version); + } + + @Override + public int hashCode() + { + return Objects.hash(message, id, scenario, name, version, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfigPostResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java new file mode 100644 index 000000000..a5850409a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrchestrationConfigResource + */ + +@Beta // CHECKSTYLE:OFF +public class OrchestrationConfigResource +// CHECKSTYLE:ON +{ + @JsonProperty( "id" ) + private UUID id; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "creation_timestamp" ) + private String creationTimestamp; + + @JsonProperty( "managed_by" ) + private String managedBy; + + @JsonProperty( "is_version_head" ) + private Boolean isVersionHead; + + @JsonProperty( "resource_group_id" ) + private String resourceGroupId; + + @JsonProperty( "spec" ) + private OrchestrationConfig spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrchestrationConfigResource. + */ + protected OrchestrationConfigResource() + { + } + + /** + * Set the id of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param id + * The id of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource id( @Nullable final UUID id ) + { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public UUID getId() + { + return id; + } + + /** + * Set the id of this {@link OrchestrationConfigResource} instance. + * + * @param id + * The id of this {@link OrchestrationConfigResource} + */ + public void setId( @Nullable final UUID id ) + { + this.id = id; + } + + /** + * Set the name of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param name + * The name of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource name( @Nullable final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link OrchestrationConfigResource} instance. + * + * @param name + * The name of this {@link OrchestrationConfigResource} + */ + public void setName( @Nullable final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param version + * The version of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource version( @Nullable final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link OrchestrationConfigResource} instance. + * + * @param version + * The version of this {@link OrchestrationConfigResource} + */ + public void setVersion( @Nullable final String version ) + { + this.version = version; + } + + /** + * Set the scenario of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource scenario( @Nullable final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link OrchestrationConfigResource} instance. + * + * @param scenario + * The scenario of this {@link OrchestrationConfigResource} + */ + public void setScenario( @Nullable final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the creationTimestamp of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param creationTimestamp + * The creationTimestamp of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource creationTimestamp( @Nullable final String creationTimestamp ) + { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * Get creationTimestamp + * + * @return creationTimestamp The creationTimestamp of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public String getCreationTimestamp() + { + return creationTimestamp; + } + + /** + * Set the creationTimestamp of this {@link OrchestrationConfigResource} instance. + * + * @param creationTimestamp + * The creationTimestamp of this {@link OrchestrationConfigResource} + */ + public void setCreationTimestamp( @Nullable final String creationTimestamp ) + { + this.creationTimestamp = creationTimestamp; + } + + /** + * Set the managedBy of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param managedBy + * The managedBy of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource managedBy( @Nullable final String managedBy ) + { + this.managedBy = managedBy; + return this; + } + + /** + * Get managedBy + * + * @return managedBy The managedBy of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public String getManagedBy() + { + return managedBy; + } + + /** + * Set the managedBy of this {@link OrchestrationConfigResource} instance. + * + * @param managedBy + * The managedBy of this {@link OrchestrationConfigResource} + */ + public void setManagedBy( @Nullable final String managedBy ) + { + this.managedBy = managedBy; + } + + /** + * Set the isVersionHead of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param isVersionHead + * The isVersionHead of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource isVersionHead( @Nullable final Boolean isVersionHead ) + { + this.isVersionHead = isVersionHead; + return this; + } + + /** + * Get isVersionHead + * + * @return isVersionHead The isVersionHead of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public Boolean isIsVersionHead() + { + return isVersionHead; + } + + /** + * Set the isVersionHead of this {@link OrchestrationConfigResource} instance. + * + * @param isVersionHead + * The isVersionHead of this {@link OrchestrationConfigResource} + */ + public void setIsVersionHead( @Nullable final Boolean isVersionHead ) + { + this.isVersionHead = isVersionHead; + } + + /** + * Set the resourceGroupId of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param resourceGroupId + * The resourceGroupId of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource resourceGroupId( @Nullable final String resourceGroupId ) + { + this.resourceGroupId = resourceGroupId; + return this; + } + + /** + * Get resourceGroupId + * + * @return resourceGroupId The resourceGroupId of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public String getResourceGroupId() + { + return resourceGroupId; + } + + /** + * Set the resourceGroupId of this {@link OrchestrationConfigResource} instance. + * + * @param resourceGroupId + * The resourceGroupId of this {@link OrchestrationConfigResource} + */ + public void setResourceGroupId( @Nullable final String resourceGroupId ) + { + this.resourceGroupId = resourceGroupId; + } + + /** + * Set the spec of this {@link OrchestrationConfigResource} instance and return the same instance. + * + * @param spec + * The spec of this {@link OrchestrationConfigResource} + * @return The same instance of this {@link OrchestrationConfigResource} class + */ + @Nonnull + public OrchestrationConfigResource spec( @Nullable final OrchestrationConfig spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link OrchestrationConfigResource} instance. + */ + @Nonnull + public OrchestrationConfig getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link OrchestrationConfigResource} instance. + * + * @param spec + * The spec of this {@link OrchestrationConfigResource} + */ + public void setSpec( @Nullable final OrchestrationConfig spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrchestrationConfigResource}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrchestrationConfigResource} 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("OrchestrationConfigResource has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrchestrationConfigResource} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( id != null ) + declaredFields.put("id", id); + if( name != null ) + declaredFields.put("name", name); + if( version != null ) + declaredFields.put("version", version); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( creationTimestamp != null ) + declaredFields.put("creationTimestamp", creationTimestamp); + if( managedBy != null ) + declaredFields.put("managedBy", managedBy); + if( isVersionHead != null ) + declaredFields.put("isVersionHead", isVersionHead); + if( resourceGroupId != null ) + declaredFields.put("resourceGroupId", resourceGroupId); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrchestrationConfigResource} 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 OrchestrationConfigResource orchestrationConfigResource = (OrchestrationConfigResource) o; + return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigResource.cloudSdkCustomFields) + && Objects.equals(this.id, orchestrationConfigResource.id) + && Objects.equals(this.name, orchestrationConfigResource.name) + && Objects.equals(this.version, orchestrationConfigResource.version) + && Objects.equals(this.scenario, orchestrationConfigResource.scenario) + && Objects.equals(this.creationTimestamp, orchestrationConfigResource.creationTimestamp) + && Objects.equals(this.managedBy, orchestrationConfigResource.managedBy) + && Objects.equals(this.isVersionHead, orchestrationConfigResource.isVersionHead) + && Objects.equals(this.resourceGroupId, orchestrationConfigResource.resourceGroupId) + && Objects.equals(this.spec, orchestrationConfigResource.spec); + } + + @Override + public int hashCode() + { + return Objects + .hash( + id, + name, + version, + scenario, + creationTimestamp, + managedBy, + isVersionHead, + resourceGroupId, + spec, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrchestrationConfigResource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" managedBy: ").append(toIndentedString(managedBy)).append("\n"); + sb.append(" isVersionHead: ").append(toIndentedString(isVersionHead)).append("\n"); + sb.append(" resourceGroupId: ").append(toIndentedString(resourceGroupId)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java new file mode 100644 index 000000000..ee970066b --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * OutputFilterConfig + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = AzureContentSafetyOutputFilterConfig.class ), + @JsonSubTypes.Type( value = LlamaGuard38bFilterConfig.class ), } ) + +public interface OutputFilterConfig +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java new file mode 100644 index 000000000..e36747309 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OutputFilteringConfig + */ + +@Beta // CHECKSTYLE:OFF +public class OutputFilteringConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "filters" ) + private List filters = new ArrayList<>(); + + @JsonProperty( "stream_options" ) + private FilteringStreamOptions streamOptions; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OutputFilteringConfig. + */ + protected OutputFilteringConfig() + { + } + + /** + * Set the filters of this {@link OutputFilteringConfig} instance and return the same instance. + * + * @param filters + * Configuration for content filtering services that should be used for the given filtering step (output + * filtering). + * @return The same instance of this {@link OutputFilteringConfig} class + */ + @Nonnull + public OutputFilteringConfig filters( @Nonnull final List filters ) + { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link OutputFilteringConfig}. + * + * @param filtersItem + * The filters that should be added + * @return The same instance of type {@link OutputFilteringConfig} + */ + @Nonnull + public OutputFilteringConfig addFiltersItem( @Nonnull final OutputFilterConfig filtersItem ) + { + if( this.filters == null ) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Configuration for content filtering services that should be used for the given filtering step (output filtering). + * + * @return filters The filters of this {@link OutputFilteringConfig} instance. + */ + @Nonnull + public List getFilters() + { + return filters; + } + + /** + * Set the filters of this {@link OutputFilteringConfig} instance. + * + * @param filters + * Configuration for content filtering services that should be used for the given filtering step (output + * filtering). + */ + public void setFilters( @Nonnull final List filters ) + { + this.filters = filters; + } + + /** + * Set the streamOptions of this {@link OutputFilteringConfig} instance and return the same instance. + * + * @param streamOptions + * The streamOptions of this {@link OutputFilteringConfig} + * @return The same instance of this {@link OutputFilteringConfig} class + */ + @Nonnull + public OutputFilteringConfig streamOptions( @Nullable final FilteringStreamOptions streamOptions ) + { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get streamOptions + * + * @return streamOptions The streamOptions of this {@link OutputFilteringConfig} instance. + */ + @Nonnull + public FilteringStreamOptions getStreamOptions() + { + return streamOptions; + } + + /** + * Set the streamOptions of this {@link OutputFilteringConfig} instance. + * + * @param streamOptions + * The streamOptions of this {@link OutputFilteringConfig} + */ + public void setStreamOptions( @Nullable final FilteringStreamOptions streamOptions ) + { + this.streamOptions = streamOptions; + } + + /** + * Get the names of the unrecognizable properties of the {@link OutputFilteringConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OutputFilteringConfig} 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("OutputFilteringConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OutputFilteringConfig} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( filters != null ) + declaredFields.put("filters", filters); + if( streamOptions != null ) + declaredFields.put("streamOptions", streamOptions); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OutputFilteringConfig} 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 OutputFilteringConfig outputFilteringConfig = (OutputFilteringConfig) o; + return Objects.equals(this.cloudSdkCustomFields, outputFilteringConfig.cloudSdkCustomFields) + && Objects.equals(this.filters, outputFilteringConfig.filters) + && Objects.equals(this.streamOptions, outputFilteringConfig.streamOptions); + } + + @Override + public int hashCode() + { + return Objects.hash(filters, streamOptions, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OutputFilteringConfig {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java new file mode 100644 index 000000000..3f75bd4e6 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * PromptTemplate + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = MultiChatTemplate.class ), + @JsonSubTypes.Type( value = SingleChatTemplate.class ), } ) + +public interface PromptTemplate +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java new file mode 100644 index 000000000..8eab815bf --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplateDeleteResponse + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplateDeleteResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "message" ) + private String message; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplateDeleteResponse. + */ + protected PromptTemplateDeleteResponse() + { + } + + /** + * Set the message of this {@link PromptTemplateDeleteResponse} instance and return the same instance. + * + * @param message + * The message of this {@link PromptTemplateDeleteResponse} + * @return The same instance of this {@link PromptTemplateDeleteResponse} class + */ + @Nonnull + public PromptTemplateDeleteResponse message( @Nonnull final String message ) + { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link PromptTemplateDeleteResponse} instance. + */ + @Nonnull + public String getMessage() + { + return message; + } + + /** + * Set the message of this {@link PromptTemplateDeleteResponse} instance. + * + * @param message + * The message of this {@link PromptTemplateDeleteResponse} + */ + public void setMessage( @Nonnull final String message ) + { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplateDeleteResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplateDeleteResponse} 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("PromptTemplateDeleteResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplateDeleteResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( message != null ) + declaredFields.put("message", message); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplateDeleteResponse} 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 PromptTemplateDeleteResponse promptTemplateDeleteResponse = (PromptTemplateDeleteResponse) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplateDeleteResponse.cloudSdkCustomFields) + && Objects.equals(this.message, promptTemplateDeleteResponse.message); + } + + @Override + public int hashCode() + { + return Objects.hash(message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplateDeleteResponse {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java new file mode 100644 index 000000000..62eb8761d --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplateGetResponse + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplateGetResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "id" ) + private UUID id; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "creationTimestamp" ) + private String creationTimestamp; + + @JsonProperty( "managedBy" ) + private String managedBy; + + @JsonProperty( "isVersionHead" ) + private Boolean isVersionHead; + + @JsonProperty( "resourceGroupId" ) + private String resourceGroupId; + + @JsonProperty( "spec" ) + private PromptTemplateSpec spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplateGetResponse. + */ + protected PromptTemplateGetResponse() + { + } + + /** + * Set the id of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param id + * The id of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse id( @Nullable final UUID id ) + { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public UUID getId() + { + return id; + } + + /** + * Set the id of this {@link PromptTemplateGetResponse} instance. + * + * @param id + * The id of this {@link PromptTemplateGetResponse} + */ + public void setId( @Nullable final UUID id ) + { + this.id = id; + } + + /** + * Set the name of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param name + * The name of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse name( @Nullable final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link PromptTemplateGetResponse} instance. + * + * @param name + * The name of this {@link PromptTemplateGetResponse} + */ + public void setName( @Nullable final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param version + * The version of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse version( @Nullable final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link PromptTemplateGetResponse} instance. + * + * @param version + * The version of this {@link PromptTemplateGetResponse} + */ + public void setVersion( @Nullable final String version ) + { + this.version = version; + } + + /** + * Set the scenario of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse scenario( @Nullable final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link PromptTemplateGetResponse} instance. + * + * @param scenario + * The scenario of this {@link PromptTemplateGetResponse} + */ + public void setScenario( @Nullable final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the creationTimestamp of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param creationTimestamp + * The creationTimestamp of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse creationTimestamp( @Nullable final String creationTimestamp ) + { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * Get creationTimestamp + * + * @return creationTimestamp The creationTimestamp of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public String getCreationTimestamp() + { + return creationTimestamp; + } + + /** + * Set the creationTimestamp of this {@link PromptTemplateGetResponse} instance. + * + * @param creationTimestamp + * The creationTimestamp of this {@link PromptTemplateGetResponse} + */ + public void setCreationTimestamp( @Nullable final String creationTimestamp ) + { + this.creationTimestamp = creationTimestamp; + } + + /** + * Set the managedBy of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param managedBy + * The managedBy of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse managedBy( @Nullable final String managedBy ) + { + this.managedBy = managedBy; + return this; + } + + /** + * Get managedBy + * + * @return managedBy The managedBy of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public String getManagedBy() + { + return managedBy; + } + + /** + * Set the managedBy of this {@link PromptTemplateGetResponse} instance. + * + * @param managedBy + * The managedBy of this {@link PromptTemplateGetResponse} + */ + public void setManagedBy( @Nullable final String managedBy ) + { + this.managedBy = managedBy; + } + + /** + * Set the isVersionHead of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param isVersionHead + * The isVersionHead of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse isVersionHead( @Nullable final Boolean isVersionHead ) + { + this.isVersionHead = isVersionHead; + return this; + } + + /** + * Get isVersionHead + * + * @return isVersionHead The isVersionHead of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public Boolean isIsVersionHead() + { + return isVersionHead; + } + + /** + * Set the isVersionHead of this {@link PromptTemplateGetResponse} instance. + * + * @param isVersionHead + * The isVersionHead of this {@link PromptTemplateGetResponse} + */ + public void setIsVersionHead( @Nullable final Boolean isVersionHead ) + { + this.isVersionHead = isVersionHead; + } + + /** + * Set the resourceGroupId of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param resourceGroupId + * The resourceGroupId of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse resourceGroupId( @Nullable final String resourceGroupId ) + { + this.resourceGroupId = resourceGroupId; + return this; + } + + /** + * Get resourceGroupId + * + * @return resourceGroupId The resourceGroupId of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public String getResourceGroupId() + { + return resourceGroupId; + } + + /** + * Set the resourceGroupId of this {@link PromptTemplateGetResponse} instance. + * + * @param resourceGroupId + * The resourceGroupId of this {@link PromptTemplateGetResponse} + */ + public void setResourceGroupId( @Nullable final String resourceGroupId ) + { + this.resourceGroupId = resourceGroupId; + } + + /** + * Set the spec of this {@link PromptTemplateGetResponse} instance and return the same instance. + * + * @param spec + * The spec of this {@link PromptTemplateGetResponse} + * @return The same instance of this {@link PromptTemplateGetResponse} class + */ + @Nonnull + public PromptTemplateGetResponse spec( @Nullable final PromptTemplateSpec spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link PromptTemplateGetResponse} instance. + */ + @Nonnull + public PromptTemplateSpec getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link PromptTemplateGetResponse} instance. + * + * @param spec + * The spec of this {@link PromptTemplateGetResponse} + */ + public void setSpec( @Nullable final PromptTemplateSpec spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplateGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplateGetResponse} 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("PromptTemplateGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplateGetResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( id != null ) + declaredFields.put("id", id); + if( name != null ) + declaredFields.put("name", name); + if( version != null ) + declaredFields.put("version", version); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( creationTimestamp != null ) + declaredFields.put("creationTimestamp", creationTimestamp); + if( managedBy != null ) + declaredFields.put("managedBy", managedBy); + if( isVersionHead != null ) + declaredFields.put("isVersionHead", isVersionHead); + if( resourceGroupId != null ) + declaredFields.put("resourceGroupId", resourceGroupId); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplateGetResponse} 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 PromptTemplateGetResponse promptTemplateGetResponse = (PromptTemplateGetResponse) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplateGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, promptTemplateGetResponse.id) + && Objects.equals(this.name, promptTemplateGetResponse.name) + && Objects.equals(this.version, promptTemplateGetResponse.version) + && Objects.equals(this.scenario, promptTemplateGetResponse.scenario) + && Objects.equals(this.creationTimestamp, promptTemplateGetResponse.creationTimestamp) + && Objects.equals(this.managedBy, promptTemplateGetResponse.managedBy) + && Objects.equals(this.isVersionHead, promptTemplateGetResponse.isVersionHead) + && Objects.equals(this.resourceGroupId, promptTemplateGetResponse.resourceGroupId) + && Objects.equals(this.spec, promptTemplateGetResponse.spec); + } + + @Override + public int hashCode() + { + return Objects + .hash( + id, + name, + version, + scenario, + creationTimestamp, + managedBy, + isVersionHead, + resourceGroupId, + spec, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplateGetResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" managedBy: ").append(toIndentedString(managedBy)).append("\n"); + sb.append(" isVersionHead: ").append(toIndentedString(isVersionHead)).append("\n"); + sb.append(" resourceGroupId: ").append(toIndentedString(resourceGroupId)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java new file mode 100644 index 000000000..52fb91df9 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplateListResponse + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplateListResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "count" ) + private Integer count; + + @JsonProperty( "resources" ) + private List resources = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplateListResponse. + */ + protected PromptTemplateListResponse() + { + } + + /** + * Set the count of this {@link PromptTemplateListResponse} instance and return the same instance. + * + * @param count + * The count of this {@link PromptTemplateListResponse} + * @return The same instance of this {@link PromptTemplateListResponse} class + */ + @Nonnull + public PromptTemplateListResponse count( @Nonnull final Integer count ) + { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link PromptTemplateListResponse} instance. + */ + @Nonnull + public Integer getCount() + { + return count; + } + + /** + * Set the count of this {@link PromptTemplateListResponse} instance. + * + * @param count + * The count of this {@link PromptTemplateListResponse} + */ + public void setCount( @Nonnull final Integer count ) + { + this.count = count; + } + + /** + * Set the resources of this {@link PromptTemplateListResponse} instance and return the same instance. + * + * @param resources + * The resources of this {@link PromptTemplateListResponse} + * @return The same instance of this {@link PromptTemplateListResponse} class + */ + @Nonnull + public PromptTemplateListResponse resources( @Nonnull final List resources ) + { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link PromptTemplateListResponse}. + * + * @param resourcesItem + * The resources that should be added + * @return The same instance of type {@link PromptTemplateListResponse} + */ + @Nonnull + public PromptTemplateListResponse addResourcesItem( @Nonnull final PromptTemplateGetResponse resourcesItem ) + { + if( this.resources == null ) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link PromptTemplateListResponse} instance. + */ + @Nonnull + public List getResources() + { + return resources; + } + + /** + * Set the resources of this {@link PromptTemplateListResponse} instance. + * + * @param resources + * The resources of this {@link PromptTemplateListResponse} + */ + public void setResources( @Nonnull final List resources ) + { + this.resources = resources; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplateListResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplateListResponse} 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("PromptTemplateListResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplateListResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( count != null ) + declaredFields.put("count", count); + if( resources != null ) + declaredFields.put("resources", resources); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplateListResponse} 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 PromptTemplateListResponse promptTemplateListResponse = (PromptTemplateListResponse) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplateListResponse.cloudSdkCustomFields) + && Objects.equals(this.count, promptTemplateListResponse.count) + && Objects.equals(this.resources, promptTemplateListResponse.resources); + } + + @Override + public int hashCode() + { + return Objects.hash(count, resources, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplateListResponse {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java new file mode 100644 index 000000000..dde36cd5d --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplatePostRequest + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplatePostRequest +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "spec" ) + private PromptTemplateSpec spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplatePostRequest. + */ + protected PromptTemplatePostRequest() + { + } + + /** + * Set the name of this {@link PromptTemplatePostRequest} instance and return the same instance. + * + * @param name + * The name of this {@link PromptTemplatePostRequest} + * @return The same instance of this {@link PromptTemplatePostRequest} class + */ + @Nonnull + public PromptTemplatePostRequest name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PromptTemplatePostRequest} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link PromptTemplatePostRequest} instance. + * + * @param name + * The name of this {@link PromptTemplatePostRequest} + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link PromptTemplatePostRequest} instance and return the same instance. + * + * @param version + * The version of this {@link PromptTemplatePostRequest} + * @return The same instance of this {@link PromptTemplatePostRequest} class + */ + @Nonnull + public PromptTemplatePostRequest version( @Nonnull final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link PromptTemplatePostRequest} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link PromptTemplatePostRequest} instance. + * + * @param version + * The version of this {@link PromptTemplatePostRequest} + */ + public void setVersion( @Nonnull final String version ) + { + this.version = version; + } + + /** + * Set the scenario of this {@link PromptTemplatePostRequest} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link PromptTemplatePostRequest} + * @return The same instance of this {@link PromptTemplatePostRequest} class + */ + @Nonnull + public PromptTemplatePostRequest scenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link PromptTemplatePostRequest} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link PromptTemplatePostRequest} instance. + * + * @param scenario + * The scenario of this {@link PromptTemplatePostRequest} + */ + public void setScenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the spec of this {@link PromptTemplatePostRequest} instance and return the same instance. + * + * @param spec + * The spec of this {@link PromptTemplatePostRequest} + * @return The same instance of this {@link PromptTemplatePostRequest} class + */ + @Nonnull + public PromptTemplatePostRequest spec( @Nonnull final PromptTemplateSpec spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link PromptTemplatePostRequest} instance. + */ + @Nonnull + public PromptTemplateSpec getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link PromptTemplatePostRequest} instance. + * + * @param spec + * The spec of this {@link PromptTemplatePostRequest} + */ + public void setSpec( @Nonnull final PromptTemplateSpec spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplatePostRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplatePostRequest} 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("PromptTemplatePostRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplatePostRequest} 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( version != null ) + declaredFields.put("version", version); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplatePostRequest} 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 PromptTemplatePostRequest promptTemplatePostRequest = (PromptTemplatePostRequest) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplatePostRequest.cloudSdkCustomFields) + && Objects.equals(this.name, promptTemplatePostRequest.name) + && Objects.equals(this.version, promptTemplatePostRequest.version) + && Objects.equals(this.scenario, promptTemplatePostRequest.scenario) + && Objects.equals(this.spec, promptTemplatePostRequest.spec); + } + + @Override + public int hashCode() + { + return Objects.hash(name, version, scenario, spec, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplatePostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java new file mode 100644 index 000000000..11507bb3f --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java @@ -0,0 +1,372 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplatePostResponse + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplatePostResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "message" ) + private String message; + + @JsonProperty( "id" ) + private UUID id; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplatePostResponse. + */ + protected PromptTemplatePostResponse() + { + } + + /** + * Set the message of this {@link PromptTemplatePostResponse} instance and return the same instance. + * + * @param message + * The message of this {@link PromptTemplatePostResponse} + * @return The same instance of this {@link PromptTemplatePostResponse} class + */ + @Nonnull + public PromptTemplatePostResponse message( @Nonnull final String message ) + { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link PromptTemplatePostResponse} instance. + */ + @Nonnull + public String getMessage() + { + return message; + } + + /** + * Set the message of this {@link PromptTemplatePostResponse} instance. + * + * @param message + * The message of this {@link PromptTemplatePostResponse} + */ + public void setMessage( @Nonnull final String message ) + { + this.message = message; + } + + /** + * Set the id of this {@link PromptTemplatePostResponse} instance and return the same instance. + * + * @param id + * The id of this {@link PromptTemplatePostResponse} + * @return The same instance of this {@link PromptTemplatePostResponse} class + */ + @Nonnull + public PromptTemplatePostResponse id( @Nonnull final UUID id ) + { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PromptTemplatePostResponse} instance. + */ + @Nonnull + public UUID getId() + { + return id; + } + + /** + * Set the id of this {@link PromptTemplatePostResponse} instance. + * + * @param id + * The id of this {@link PromptTemplatePostResponse} + */ + public void setId( @Nonnull final UUID id ) + { + this.id = id; + } + + /** + * Set the scenario of this {@link PromptTemplatePostResponse} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link PromptTemplatePostResponse} + * @return The same instance of this {@link PromptTemplatePostResponse} class + */ + @Nonnull + public PromptTemplatePostResponse scenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link PromptTemplatePostResponse} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link PromptTemplatePostResponse} instance. + * + * @param scenario + * The scenario of this {@link PromptTemplatePostResponse} + */ + public void setScenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the name of this {@link PromptTemplatePostResponse} instance and return the same instance. + * + * @param name + * The name of this {@link PromptTemplatePostResponse} + * @return The same instance of this {@link PromptTemplatePostResponse} class + */ + @Nonnull + public PromptTemplatePostResponse name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link PromptTemplatePostResponse} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link PromptTemplatePostResponse} instance. + * + * @param name + * The name of this {@link PromptTemplatePostResponse} + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link PromptTemplatePostResponse} instance and return the same instance. + * + * @param version + * The version of this {@link PromptTemplatePostResponse} + * @return The same instance of this {@link PromptTemplatePostResponse} class + */ + @Nonnull + public PromptTemplatePostResponse version( @Nonnull final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link PromptTemplatePostResponse} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link PromptTemplatePostResponse} instance. + * + * @param version + * The version of this {@link PromptTemplatePostResponse} + */ + public void setVersion( @Nonnull final String version ) + { + this.version = version; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplatePostResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplatePostResponse} 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("PromptTemplatePostResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplatePostResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( message != null ) + declaredFields.put("message", message); + if( id != null ) + declaredFields.put("id", id); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( name != null ) + declaredFields.put("name", name); + if( version != null ) + declaredFields.put("version", version); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplatePostResponse} 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 PromptTemplatePostResponse promptTemplatePostResponse = (PromptTemplatePostResponse) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplatePostResponse.cloudSdkCustomFields) + && Objects.equals(this.message, promptTemplatePostResponse.message) + && Objects.equals(this.id, promptTemplatePostResponse.id) + && Objects.equals(this.scenario, promptTemplatePostResponse.scenario) + && Objects.equals(this.name, promptTemplatePostResponse.name) + && Objects.equals(this.version, promptTemplatePostResponse.version); + } + + @Override + public int hashCode() + { + return Objects.hash(message, id, scenario, name, version, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplatePostResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java new file mode 100644 index 000000000..fc354f94c --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java @@ -0,0 +1,411 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplateSpec + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplateSpec +// CHECKSTYLE:ON +{ + @JsonProperty( "template" ) + private List template = new ArrayList<>(); + + @JsonProperty( "defaults" ) + private Object defaults; + + @JsonProperty( "additionalFields" ) + private Object additionalFields; + + @JsonProperty( "response_format" ) + private PromptTemplateSpecResponseFormat responseFormat; + + @JsonProperty( "tools" ) + private List tools = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplateSpec. + */ + protected PromptTemplateSpec() + { + } + + /** + * Set the template of this {@link PromptTemplateSpec} instance and return the same instance. + * + * @param template + * The template of this {@link PromptTemplateSpec} + * @return The same instance of this {@link PromptTemplateSpec} class + */ + @Nonnull + public PromptTemplateSpec template( @Nonnull final List template ) + { + this.template = template; + return this; + } + + /** + * Add one template instance to this {@link PromptTemplateSpec}. + * + * @param templateItem + * The template that should be added + * @return The same instance of type {@link PromptTemplateSpec} + */ + @Nonnull + public PromptTemplateSpec addTemplateItem( @Nonnull final PromptTemplate templateItem ) + { + if( this.template == null ) { + this.template = new ArrayList<>(); + } + this.template.add(templateItem); + return this; + } + + /** + * Get template + * + * @return template The template of this {@link PromptTemplateSpec} instance. + */ + @Nonnull + public List getTemplate() + { + return template; + } + + /** + * Set the template of this {@link PromptTemplateSpec} instance. + * + * @param template + * The template of this {@link PromptTemplateSpec} + */ + public void setTemplate( @Nonnull final List template ) + { + this.template = template; + } + + /** + * Set the defaults of this {@link PromptTemplateSpec} instance and return the same instance. + * + * @param defaults + * The defaults of this {@link PromptTemplateSpec} + * @return The same instance of this {@link PromptTemplateSpec} class + */ + @Nonnull + public PromptTemplateSpec defaults( @Nullable final Object defaults ) + { + this.defaults = defaults; + return this; + } + + /** + * Get defaults + * + * @return defaults The defaults of this {@link PromptTemplateSpec} instance. + */ + @Nonnull + public Object getDefaults() + { + return defaults; + } + + /** + * Set the defaults of this {@link PromptTemplateSpec} instance. + * + * @param defaults + * The defaults of this {@link PromptTemplateSpec} + */ + public void setDefaults( @Nullable final Object defaults ) + { + this.defaults = defaults; + } + + /** + * Set the additionalFields of this {@link PromptTemplateSpec} instance and return the same instance. + * + * @param additionalFields + * DEPRECATED. Please use additional_fields instead. + * @return The same instance of this {@link PromptTemplateSpec} class + */ + @Nonnull + public PromptTemplateSpec additionalFields( @Nullable final Object additionalFields ) + { + this.additionalFields = additionalFields; + return this; + } + + /** + * DEPRECATED. Please use additional_fields instead. + * + * @return additionalFields The additionalFields of this {@link PromptTemplateSpec} instance. + * @deprecated + */ + @Deprecated + @Nonnull + public Object getAdditionalFields() + { + return additionalFields; + } + + /** + * Set the additionalFields of this {@link PromptTemplateSpec} instance. + * + * @param additionalFields + * DEPRECATED. Please use additional_fields instead. + */ + public void setAdditionalFields( @Nullable final Object additionalFields ) + { + this.additionalFields = additionalFields; + } + + /** + * Set the responseFormat of this {@link PromptTemplateSpec} instance and return the same instance. + * + * @param responseFormat + * The responseFormat of this {@link PromptTemplateSpec} + * @return The same instance of this {@link PromptTemplateSpec} class + */ + @Nonnull + public PromptTemplateSpec responseFormat( @Nullable final PromptTemplateSpecResponseFormat responseFormat ) + { + this.responseFormat = responseFormat; + return this; + } + + /** + * Get responseFormat + * + * @return responseFormat The responseFormat of this {@link PromptTemplateSpec} instance. + */ + @Nonnull + public PromptTemplateSpecResponseFormat getResponseFormat() + { + return responseFormat; + } + + /** + * Set the responseFormat of this {@link PromptTemplateSpec} instance. + * + * @param responseFormat + * The responseFormat of this {@link PromptTemplateSpec} + */ + public void setResponseFormat( @Nullable final PromptTemplateSpecResponseFormat responseFormat ) + { + this.responseFormat = responseFormat; + } + + /** + * Set the tools of this {@link PromptTemplateSpec} instance and return the same instance. + * + * @param tools + * A list of tools the model may call. Used to provide a list of functions the model may generate JSON + * inputs for. This is the same as the OpenAI definition. + * @return The same instance of this {@link PromptTemplateSpec} class + */ + @Nonnull + public PromptTemplateSpec tools( @Nullable final List tools ) + { + this.tools = tools; + return this; + } + + /** + * Add one tools instance to this {@link PromptTemplateSpec}. + * + * @param toolsItem + * The tools that should be added + * @return The same instance of type {@link PromptTemplateSpec} + */ + @Nonnull + public PromptTemplateSpec addToolsItem( @Nonnull final ChatCompletionTool toolsItem ) + { + if( this.tools == null ) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. + * This is the same as the OpenAI definition. + * + * @return tools The tools of this {@link PromptTemplateSpec} instance. + */ + @Nonnull + public List getTools() + { + return tools; + } + + /** + * Set the tools of this {@link PromptTemplateSpec} instance. + * + * @param tools + * A list of tools the model may call. Used to provide a list of functions the model may generate JSON + * inputs for. This is the same as the OpenAI definition. + */ + public void setTools( @Nullable final List tools ) + { + this.tools = tools; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplateSpec}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplateSpec} 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("PromptTemplateSpec has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplateSpec} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( template != null ) + declaredFields.put("template", template); + if( defaults != null ) + declaredFields.put("defaults", defaults); + if( additionalFields != null ) + declaredFields.put("additionalFields", additionalFields); + if( responseFormat != null ) + declaredFields.put("responseFormat", responseFormat); + if( tools != null ) + declaredFields.put("tools", tools); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplateSpec} 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 PromptTemplateSpec promptTemplateSpec = (PromptTemplateSpec) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplateSpec.cloudSdkCustomFields) + && Objects.equals(this.template, promptTemplateSpec.template) + && Objects.equals(this.defaults, promptTemplateSpec.defaults) + && Objects.equals(this.additionalFields, promptTemplateSpec.additionalFields) + && Objects.equals(this.responseFormat, promptTemplateSpec.responseFormat) + && Objects.equals(this.tools, promptTemplateSpec.tools); + } + + @Override + public int hashCode() + { + return Objects.hash(template, defaults, additionalFields, responseFormat, tools, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplateSpec {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); + sb.append(" additionalFields: ").append(toIndentedString(additionalFields)).append("\n"); + sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java new file mode 100644 index 000000000..0472f96ec --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * Response format that the model output should adhere to. This is the same as the OpenAI definition. Compatible with + * GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = ResponseFormatJsonObject.class ), + @JsonSubTypes.Type( value = ResponseFormatJsonSchema.class ), + @JsonSubTypes.Type( value = ResponseFormatText.class ), } ) + +public interface PromptTemplateSpecResponseFormat +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java new file mode 100644 index 000000000..dbd20f8ba --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplateSubstitutionRequest + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplateSubstitutionRequest +// CHECKSTYLE:ON +{ + @JsonProperty( "inputParams" ) + private Object inputParams; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplateSubstitutionRequest. + */ + protected PromptTemplateSubstitutionRequest() + { + } + + /** + * Set the inputParams of this {@link PromptTemplateSubstitutionRequest} instance and return the same instance. + * + * @param inputParams + * The inputParams of this {@link PromptTemplateSubstitutionRequest} + * @return The same instance of this {@link PromptTemplateSubstitutionRequest} class + */ + @Nonnull + public PromptTemplateSubstitutionRequest inputParams( @Nullable final Object inputParams ) + { + this.inputParams = inputParams; + return this; + } + + /** + * Get inputParams + * + * @return inputParams The inputParams of this {@link PromptTemplateSubstitutionRequest} instance. + */ + @Nonnull + public Object getInputParams() + { + return inputParams; + } + + /** + * Set the inputParams of this {@link PromptTemplateSubstitutionRequest} instance. + * + * @param inputParams + * The inputParams of this {@link PromptTemplateSubstitutionRequest} + */ + public void setInputParams( @Nullable final Object inputParams ) + { + this.inputParams = inputParams; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplateSubstitutionRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplateSubstitutionRequest} 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( + "PromptTemplateSubstitutionRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplateSubstitutionRequest} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( inputParams != null ) + declaredFields.put("inputParams", inputParams); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplateSubstitutionRequest} 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 PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest = + (PromptTemplateSubstitutionRequest) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplateSubstitutionRequest.cloudSdkCustomFields) + && Objects.equals(this.inputParams, promptTemplateSubstitutionRequest.inputParams); + } + + @Override + public int hashCode() + { + return Objects.hash(inputParams, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplateSubstitutionRequest {\n"); + sb.append(" inputParams: ").append(toIndentedString(inputParams)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java new file mode 100644 index 000000000..dcf52de93 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplateSubstitutionResponse + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplateSubstitutionResponse +// CHECKSTYLE:ON +{ + @JsonProperty( "parsedPrompt" ) + private List parsedPrompt = new ArrayList<>(); + + @JsonProperty( "resource" ) + private PromptTemplateGetResponse resource; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplateSubstitutionResponse. + */ + protected PromptTemplateSubstitutionResponse() + { + } + + /** + * Set the parsedPrompt of this {@link PromptTemplateSubstitutionResponse} instance and return the same instance. + * + * @param parsedPrompt + * The parsedPrompt of this {@link PromptTemplateSubstitutionResponse} + * @return The same instance of this {@link PromptTemplateSubstitutionResponse} class + */ + @Nonnull + public PromptTemplateSubstitutionResponse parsedPrompt( @Nullable final List parsedPrompt ) + { + this.parsedPrompt = parsedPrompt; + return this; + } + + /** + * Add one parsedPrompt instance to this {@link PromptTemplateSubstitutionResponse}. + * + * @param parsedPromptItem + * The parsedPrompt that should be added + * @return The same instance of type {@link PromptTemplateSubstitutionResponse} + */ + @Nonnull + public PromptTemplateSubstitutionResponse addParsedPromptItem( @Nonnull final PromptTemplate parsedPromptItem ) + { + if( this.parsedPrompt == null ) { + this.parsedPrompt = new ArrayList<>(); + } + this.parsedPrompt.add(parsedPromptItem); + return this; + } + + /** + * Get parsedPrompt + * + * @return parsedPrompt The parsedPrompt of this {@link PromptTemplateSubstitutionResponse} instance. + */ + @Nonnull + public List getParsedPrompt() + { + return parsedPrompt; + } + + /** + * Set the parsedPrompt of this {@link PromptTemplateSubstitutionResponse} instance. + * + * @param parsedPrompt + * The parsedPrompt of this {@link PromptTemplateSubstitutionResponse} + */ + public void setParsedPrompt( @Nullable final List parsedPrompt ) + { + this.parsedPrompt = parsedPrompt; + } + + /** + * Set the resource of this {@link PromptTemplateSubstitutionResponse} instance and return the same instance. + * + * @param resource + * The resource of this {@link PromptTemplateSubstitutionResponse} + * @return The same instance of this {@link PromptTemplateSubstitutionResponse} class + */ + @Nonnull + public PromptTemplateSubstitutionResponse resource( @Nullable final PromptTemplateGetResponse resource ) + { + this.resource = resource; + return this; + } + + /** + * Get resource + * + * @return resource The resource of this {@link PromptTemplateSubstitutionResponse} instance. + */ + @Nonnull + public PromptTemplateGetResponse getResource() + { + return resource; + } + + /** + * Set the resource of this {@link PromptTemplateSubstitutionResponse} instance. + * + * @param resource + * The resource of this {@link PromptTemplateSubstitutionResponse} + */ + public void setResource( @Nullable final PromptTemplateGetResponse resource ) + { + this.resource = resource; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplateSubstitutionResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplateSubstitutionResponse} 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( + "PromptTemplateSubstitutionResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplateSubstitutionResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( parsedPrompt != null ) + declaredFields.put("parsedPrompt", parsedPrompt); + if( resource != null ) + declaredFields.put("resource", resource); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplateSubstitutionResponse} 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 PromptTemplateSubstitutionResponse promptTemplateSubstitutionResponse = + (PromptTemplateSubstitutionResponse) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplateSubstitutionResponse.cloudSdkCustomFields) + && Objects.equals(this.parsedPrompt, promptTemplateSubstitutionResponse.parsedPrompt) + && Objects.equals(this.resource, promptTemplateSubstitutionResponse.resource); + } + + @Override + public int hashCode() + { + return Objects.hash(parsedPrompt, resource, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplateSubstitutionResponse {\n"); + sb.append(" parsedPrompt: ").append(toIndentedString(parsedPrompt)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java new file mode 100644 index 000000000..926da7f49 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * PromptTemplatingModuleConfig + */ + +@Beta // CHECKSTYLE:OFF +public class PromptTemplatingModuleConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "prompt" ) + private PromptTemplatingModuleConfigPrompt prompt; + + @JsonProperty( "model" ) + private LLMModelDetails model; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for PromptTemplatingModuleConfig. + */ + protected PromptTemplatingModuleConfig() + { + } + + /** + * Set the prompt of this {@link PromptTemplatingModuleConfig} instance and return the same instance. + * + * @param prompt + * The prompt of this {@link PromptTemplatingModuleConfig} + * @return The same instance of this {@link PromptTemplatingModuleConfig} class + */ + @Nonnull + public PromptTemplatingModuleConfig prompt( @Nonnull final PromptTemplatingModuleConfigPrompt prompt ) + { + this.prompt = prompt; + return this; + } + + /** + * Get prompt + * + * @return prompt The prompt of this {@link PromptTemplatingModuleConfig} instance. + */ + @Nonnull + public PromptTemplatingModuleConfigPrompt getPrompt() + { + return prompt; + } + + /** + * Set the prompt of this {@link PromptTemplatingModuleConfig} instance. + * + * @param prompt + * The prompt of this {@link PromptTemplatingModuleConfig} + */ + public void setPrompt( @Nonnull final PromptTemplatingModuleConfigPrompt prompt ) + { + this.prompt = prompt; + } + + /** + * Set the model of this {@link PromptTemplatingModuleConfig} instance and return the same instance. + * + * @param model + * The model of this {@link PromptTemplatingModuleConfig} + * @return The same instance of this {@link PromptTemplatingModuleConfig} class + */ + @Nonnull + public PromptTemplatingModuleConfig model( @Nonnull final LLMModelDetails model ) + { + this.model = model; + return this; + } + + /** + * Get model + * + * @return model The model of this {@link PromptTemplatingModuleConfig} instance. + */ + @Nonnull + public LLMModelDetails getModel() + { + return model; + } + + /** + * Set the model of this {@link PromptTemplatingModuleConfig} instance. + * + * @param model + * The model of this {@link PromptTemplatingModuleConfig} + */ + public void setModel( @Nonnull final LLMModelDetails model ) + { + this.model = model; + } + + /** + * Get the names of the unrecognizable properties of the {@link PromptTemplatingModuleConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PromptTemplatingModuleConfig} 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("PromptTemplatingModuleConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PromptTemplatingModuleConfig} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( prompt != null ) + declaredFields.put("prompt", prompt); + if( model != null ) + declaredFields.put("model", model); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PromptTemplatingModuleConfig} 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 PromptTemplatingModuleConfig promptTemplatingModuleConfig = (PromptTemplatingModuleConfig) o; + return Objects.equals(this.cloudSdkCustomFields, promptTemplatingModuleConfig.cloudSdkCustomFields) + && Objects.equals(this.prompt, promptTemplatingModuleConfig.prompt) + && Objects.equals(this.model, promptTemplatingModuleConfig.model); + } + + @Override + public int hashCode() + { + return Objects.hash(prompt, model, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class PromptTemplatingModuleConfig {\n"); + sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java new file mode 100644 index 000000000..63cdc26e7 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt + * registry. + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { @JsonSubTypes.Type( value = Template.class ), @JsonSubTypes.Type( value = TemplateRef.class ), } ) + +public interface PromptTemplatingModuleConfigPrompt +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java new file mode 100644 index 000000000..9cd995069 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * ResponseFormatJsonObject + */ + +@Beta // CHECKSTYLE:OFF +public class ResponseFormatJsonObject implements PromptTemplateSpecResponseFormat, TemplateResponseFormat +// CHECKSTYLE:ON +{ + /** + * The type of response format being defined: `json_object` + */ + public enum TypeEnum + { + /** + * The JSON_OBJECT option of this ResponseFormatJsonObject + */ + JSON_OBJECT("json_object"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatJsonObject + */ + 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 ResponseFormatJsonObject + */ + @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; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ResponseFormatJsonObject. + */ + protected ResponseFormatJsonObject() + { + } + + /** + * Set the type of this {@link ResponseFormatJsonObject} instance and return the same instance. + * + * @param type + * The type of response format being defined: `json_object` + * @return The same instance of this {@link ResponseFormatJsonObject} class + */ + @Nonnull + public ResponseFormatJsonObject type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * The type of response format being defined: `json_object` + * + * @return type The type of this {@link ResponseFormatJsonObject} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link ResponseFormatJsonObject} instance. + * + * @param type + * The type of response format being defined: `json_object` + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonObject}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatJsonObject} 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("ResponseFormatJsonObject has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ResponseFormatJsonObject} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatJsonObject} 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 ResponseFormatJsonObject responseFormatJsonObject = (ResponseFormatJsonObject) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonObject.cloudSdkCustomFields) + && Objects.equals(this.type, responseFormatJsonObject.type); + } + + @Override + public int hashCode() + { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatJsonObject {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java new file mode 100644 index 000000000..f43b74801 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * ResponseFormatJsonSchema + */ + +@Beta // CHECKSTYLE:OFF +public class ResponseFormatJsonSchema implements PromptTemplateSpecResponseFormat, TemplateResponseFormat +// CHECKSTYLE:ON +{ + /** + * The type of response format being defined: `json_schema` + */ + public enum TypeEnum + { + /** + * The JSON_SCHEMA option of this ResponseFormatJsonSchema + */ + JSON_SCHEMA("json_schema"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatJsonSchema + */ + 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 ResponseFormatJsonSchema + */ + @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( "json_schema" ) + private ResponseFormatJsonSchemaJsonSchema jsonSchema; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ResponseFormatJsonSchema. + */ + protected ResponseFormatJsonSchema() + { + } + + /** + * Set the type of this {@link ResponseFormatJsonSchema} instance and return the same instance. + * + * @param type + * The type of response format being defined: `json_schema` + * @return The same instance of this {@link ResponseFormatJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchema type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * The type of response format being defined: `json_schema` + * + * @return type The type of this {@link ResponseFormatJsonSchema} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link ResponseFormatJsonSchema} instance. + * + * @param type + * The type of response format being defined: `json_schema` + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance and return the same instance. + * + * @param jsonSchema + * The jsonSchema of this {@link ResponseFormatJsonSchema} + * @return The same instance of this {@link ResponseFormatJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchema jsonSchema( @Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema ) + { + this.jsonSchema = jsonSchema; + return this; + } + + /** + * Get jsonSchema + * + * @return jsonSchema The jsonSchema of this {@link ResponseFormatJsonSchema} instance. + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema getJsonSchema() + { + return jsonSchema; + } + + /** + * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance. + * + * @param jsonSchema + * The jsonSchema of this {@link ResponseFormatJsonSchema} + */ + public void setJsonSchema( @Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema ) + { + this.jsonSchema = jsonSchema; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonSchema}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchema} 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("ResponseFormatJsonSchema has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ResponseFormatJsonSchema} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( jsonSchema != null ) + declaredFields.put("jsonSchema", jsonSchema); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatJsonSchema} 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 ResponseFormatJsonSchema responseFormatJsonSchema = (ResponseFormatJsonSchema) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonSchema.cloudSdkCustomFields) + && Objects.equals(this.type, responseFormatJsonSchema.type) + && Objects.equals(this.jsonSchema, responseFormatJsonSchema.jsonSchema); + } + + @Override + public int hashCode() + { + return Objects.hash(type, jsonSchema, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatJsonSchema {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java new file mode 100644 index 000000000..37f9ed0c9 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * ResponseFormatJsonSchemaJsonSchema + */ + +@Beta // CHECKSTYLE:OFF +public class ResponseFormatJsonSchemaJsonSchema +// CHECKSTYLE:ON +{ + @JsonProperty( "description" ) + private String description; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "schema" ) + private Map schema = new HashMap<>(); + + @JsonProperty( "strict" ) + private Boolean strict = false; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ResponseFormatJsonSchemaJsonSchema. + */ + protected ResponseFormatJsonSchemaJsonSchema() + { + } + + /** + * Set the description of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. + * + * @param description + * A description of what the response format is for, used by the model to determine how to respond in the + * format. + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema description( @Nullable final String description ) + { + this.description = description; + return this; + } + + /** + * A description of what the response format is for, used by the model to determine how to respond in the format. + * + * @return description The description of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nonnull + public String getDescription() + { + return description; + } + + /** + * Set the description of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param description + * A description of what the response format is for, used by the model to determine how to respond in the + * format. + */ + public void setDescription( @Nullable final String description ) + { + this.description = description; + } + + /** + * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. + * + * @param name + * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a + * maximum length of 64. + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + * of 64. + * + * @return name The name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param name + * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a + * maximum length of 64. + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. + * + * @param schema + * The schema for the response format, described as a JSON Schema object. + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema schema( @Nullable final Map schema ) + { + this.schema = schema; + return this; + } + + /** + * Put one schema instance to this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param key + * The String key of this schema instance + * @param schemaItem + * The schema that should be added under the given key + * @return The same instance of type {@link ResponseFormatJsonSchemaJsonSchema} + */ + @Nonnull + public + ResponseFormatJsonSchemaJsonSchema + putschemaItem( @Nonnull final String key, @Nullable final Object schemaItem ) + { + if( this.schema == null ) { + this.schema = new HashMap<>(); + } + this.schema.put(key, schemaItem); + return this; + } + + /** + * The schema for the response format, described as a JSON Schema object. + * + * @return schema The schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nonnull + public Map getSchema() + { + return schema; + } + + /** + * Set the schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param schema + * The schema for the response format, described as a JSON Schema object. + */ + public void setSchema( @Nullable final Map schema ) + { + this.schema = schema; + } + + /** + * Set the strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. + * + * @param strict + * Whether to enable strict schema adherence when generating the output. If set to true, the model will + * always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema + * is supported when `strict` is `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema strict( @Nullable final Boolean strict ) + { + this.strict = strict; + return this; + } + + /** + * Whether to enable strict schema adherence when generating the output. If set to true, the model will always + * follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when + * `strict` is `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * @return strict The strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nullable + public Boolean isStrict() + { + return strict; + } + + /** + * Set the strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param strict + * Whether to enable strict schema adherence when generating the output. If set to true, the model will + * always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema + * is supported when `strict` is `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + */ + public void setStrict( @Nullable final Boolean strict ) + { + this.strict = strict; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonSchemaJsonSchema}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} 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( + "ResponseFormatJsonSchemaJsonSchema has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ResponseFormatJsonSchemaJsonSchema} 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( name != null ) + declaredFields.put("name", name); + if( schema != null ) + declaredFields.put("schema", schema); + if( strict != null ) + declaredFields.put("strict", strict); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} 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 ResponseFormatJsonSchemaJsonSchema responseFormatJsonSchemaJsonSchema = + (ResponseFormatJsonSchemaJsonSchema) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonSchemaJsonSchema.cloudSdkCustomFields) + && Objects.equals(this.description, responseFormatJsonSchemaJsonSchema.description) + && Objects.equals(this.name, responseFormatJsonSchemaJsonSchema.name) + && Objects.equals(this.schema, responseFormatJsonSchemaJsonSchema.schema) + && Objects.equals(this.strict, responseFormatJsonSchemaJsonSchema.strict); + } + + @Override + public int hashCode() + { + return Objects.hash(description, name, schema, strict, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatJsonSchemaJsonSchema {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" strict: ").append(toIndentedString(strict)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java new file mode 100644 index 000000000..f7e94b815 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * ResponseFormatText + */ + +@Beta // CHECKSTYLE:OFF +public class ResponseFormatText implements PromptTemplateSpecResponseFormat, TemplateResponseFormat +// CHECKSTYLE:ON +{ + /** + * The type of response format being defined: `text` + */ + public enum TypeEnum + { + /** + * The TEXT option of this ResponseFormatText + */ + TEXT("text"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatText + */ + 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 ResponseFormatText + */ + @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; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ResponseFormatText. + */ + protected ResponseFormatText() + { + } + + /** + * Set the type of this {@link ResponseFormatText} instance and return the same instance. + * + * @param type + * The type of response format being defined: `text` + * @return The same instance of this {@link ResponseFormatText} class + */ + @Nonnull + public ResponseFormatText type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * The type of response format being defined: `text` + * + * @return type The type of this {@link ResponseFormatText} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link ResponseFormatText} instance. + * + * @param type + * The type of response format being defined: `text` + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatText}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatText} 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("ResponseFormatText has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ResponseFormatText} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatText} 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 ResponseFormatText responseFormatText = (ResponseFormatText) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatText.cloudSdkCustomFields) + && Objects.equals(this.type, responseFormatText.type); + } + + @Override + public int hashCode() + { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatText {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java new file mode 100644 index 000000000..be9336af5 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * RuntimeOrchestrationConfigFile + */ + +@Beta // CHECKSTYLE:OFF +public class RuntimeOrchestrationConfigFile +// CHECKSTYLE:ON +{ + @JsonProperty( "apiVersion" ) + private String apiVersion; + + @JsonProperty( "kind" ) + private String kind; + + @JsonProperty( "metadata" ) + private RuntimePromptTemplateFileMetadata metadata; + + @JsonProperty( "spec" ) + private OrchestrationConfig spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for RuntimeOrchestrationConfigFile. + */ + protected RuntimeOrchestrationConfigFile() + { + } + + /** + * Set the apiVersion of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. + * + * @param apiVersion + * The apiVersion of this {@link RuntimeOrchestrationConfigFile} + * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class + */ + @Nonnull + public RuntimeOrchestrationConfigFile apiVersion( @Nullable final String apiVersion ) + { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get apiVersion + * + * @return apiVersion The apiVersion of this {@link RuntimeOrchestrationConfigFile} instance. + */ + @Nonnull + public String getApiVersion() + { + return apiVersion; + } + + /** + * Set the apiVersion of this {@link RuntimeOrchestrationConfigFile} instance. + * + * @param apiVersion + * The apiVersion of this {@link RuntimeOrchestrationConfigFile} + */ + public void setApiVersion( @Nullable final String apiVersion ) + { + this.apiVersion = apiVersion; + } + + /** + * Set the kind of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. + * + * @param kind + * The kind of this {@link RuntimeOrchestrationConfigFile} + * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class + */ + @Nonnull + public RuntimeOrchestrationConfigFile kind( @Nullable final String kind ) + { + this.kind = kind; + return this; + } + + /** + * Get kind + * + * @return kind The kind of this {@link RuntimeOrchestrationConfigFile} instance. + */ + @Nonnull + public String getKind() + { + return kind; + } + + /** + * Set the kind of this {@link RuntimeOrchestrationConfigFile} instance. + * + * @param kind + * The kind of this {@link RuntimeOrchestrationConfigFile} + */ + public void setKind( @Nullable final String kind ) + { + this.kind = kind; + } + + /** + * Set the metadata of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. + * + * @param metadata + * The metadata of this {@link RuntimeOrchestrationConfigFile} + * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class + */ + @Nonnull + public RuntimeOrchestrationConfigFile metadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) + { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link RuntimeOrchestrationConfigFile} instance. + */ + @Nonnull + public RuntimePromptTemplateFileMetadata getMetadata() + { + return metadata; + } + + /** + * Set the metadata of this {@link RuntimeOrchestrationConfigFile} instance. + * + * @param metadata + * The metadata of this {@link RuntimeOrchestrationConfigFile} + */ + public void setMetadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) + { + this.metadata = metadata; + } + + /** + * Set the spec of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. + * + * @param spec + * The spec of this {@link RuntimeOrchestrationConfigFile} + * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class + */ + @Nonnull + public RuntimeOrchestrationConfigFile spec( @Nullable final OrchestrationConfig spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link RuntimeOrchestrationConfigFile} instance. + */ + @Nonnull + public OrchestrationConfig getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link RuntimeOrchestrationConfigFile} instance. + * + * @param spec + * The spec of this {@link RuntimeOrchestrationConfigFile} + */ + public void setSpec( @Nullable final OrchestrationConfig spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link RuntimeOrchestrationConfigFile}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RuntimeOrchestrationConfigFile} 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("RuntimeOrchestrationConfigFile has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RuntimeOrchestrationConfigFile} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( apiVersion != null ) + declaredFields.put("apiVersion", apiVersion); + if( kind != null ) + declaredFields.put("kind", kind); + if( metadata != null ) + declaredFields.put("metadata", metadata); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RuntimeOrchestrationConfigFile} 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 RuntimeOrchestrationConfigFile runtimeOrchestrationConfigFile = (RuntimeOrchestrationConfigFile) o; + return Objects.equals(this.cloudSdkCustomFields, runtimeOrchestrationConfigFile.cloudSdkCustomFields) + && Objects.equals(this.apiVersion, runtimeOrchestrationConfigFile.apiVersion) + && Objects.equals(this.kind, runtimeOrchestrationConfigFile.kind) + && Objects.equals(this.metadata, runtimeOrchestrationConfigFile.metadata) + && Objects.equals(this.spec, runtimeOrchestrationConfigFile.spec); + } + + @Override + public int hashCode() + { + return Objects.hash(apiVersion, kind, metadata, spec, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class RuntimeOrchestrationConfigFile {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java new file mode 100644 index 000000000..e83eb630b --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * RuntimePromptTemplateFile + */ + +@Beta // CHECKSTYLE:OFF +public class RuntimePromptTemplateFile +// CHECKSTYLE:ON +{ + @JsonProperty( "apiVersion" ) + private String apiVersion; + + @JsonProperty( "kind" ) + private String kind; + + @JsonProperty( "metadata" ) + private RuntimePromptTemplateFileMetadata metadata; + + @JsonProperty( "spec" ) + private PromptTemplateSpec spec; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for RuntimePromptTemplateFile. + */ + protected RuntimePromptTemplateFile() + { + } + + /** + * Set the apiVersion of this {@link RuntimePromptTemplateFile} instance and return the same instance. + * + * @param apiVersion + * The apiVersion of this {@link RuntimePromptTemplateFile} + * @return The same instance of this {@link RuntimePromptTemplateFile} class + */ + @Nonnull + public RuntimePromptTemplateFile apiVersion( @Nullable final String apiVersion ) + { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get apiVersion + * + * @return apiVersion The apiVersion of this {@link RuntimePromptTemplateFile} instance. + */ + @Nonnull + public String getApiVersion() + { + return apiVersion; + } + + /** + * Set the apiVersion of this {@link RuntimePromptTemplateFile} instance. + * + * @param apiVersion + * The apiVersion of this {@link RuntimePromptTemplateFile} + */ + public void setApiVersion( @Nullable final String apiVersion ) + { + this.apiVersion = apiVersion; + } + + /** + * Set the kind of this {@link RuntimePromptTemplateFile} instance and return the same instance. + * + * @param kind + * The kind of this {@link RuntimePromptTemplateFile} + * @return The same instance of this {@link RuntimePromptTemplateFile} class + */ + @Nonnull + public RuntimePromptTemplateFile kind( @Nullable final String kind ) + { + this.kind = kind; + return this; + } + + /** + * Get kind + * + * @return kind The kind of this {@link RuntimePromptTemplateFile} instance. + */ + @Nonnull + public String getKind() + { + return kind; + } + + /** + * Set the kind of this {@link RuntimePromptTemplateFile} instance. + * + * @param kind + * The kind of this {@link RuntimePromptTemplateFile} + */ + public void setKind( @Nullable final String kind ) + { + this.kind = kind; + } + + /** + * Set the metadata of this {@link RuntimePromptTemplateFile} instance and return the same instance. + * + * @param metadata + * The metadata of this {@link RuntimePromptTemplateFile} + * @return The same instance of this {@link RuntimePromptTemplateFile} class + */ + @Nonnull + public RuntimePromptTemplateFile metadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) + { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link RuntimePromptTemplateFile} instance. + */ + @Nonnull + public RuntimePromptTemplateFileMetadata getMetadata() + { + return metadata; + } + + /** + * Set the metadata of this {@link RuntimePromptTemplateFile} instance. + * + * @param metadata + * The metadata of this {@link RuntimePromptTemplateFile} + */ + public void setMetadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) + { + this.metadata = metadata; + } + + /** + * Set the spec of this {@link RuntimePromptTemplateFile} instance and return the same instance. + * + * @param spec + * The spec of this {@link RuntimePromptTemplateFile} + * @return The same instance of this {@link RuntimePromptTemplateFile} class + */ + @Nonnull + public RuntimePromptTemplateFile spec( @Nullable final PromptTemplateSpec spec ) + { + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec The spec of this {@link RuntimePromptTemplateFile} instance. + */ + @Nonnull + public PromptTemplateSpec getSpec() + { + return spec; + } + + /** + * Set the spec of this {@link RuntimePromptTemplateFile} instance. + * + * @param spec + * The spec of this {@link RuntimePromptTemplateFile} + */ + public void setSpec( @Nullable final PromptTemplateSpec spec ) + { + this.spec = spec; + } + + /** + * Get the names of the unrecognizable properties of the {@link RuntimePromptTemplateFile}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RuntimePromptTemplateFile} 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("RuntimePromptTemplateFile has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RuntimePromptTemplateFile} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( apiVersion != null ) + declaredFields.put("apiVersion", apiVersion); + if( kind != null ) + declaredFields.put("kind", kind); + if( metadata != null ) + declaredFields.put("metadata", metadata); + if( spec != null ) + declaredFields.put("spec", spec); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RuntimePromptTemplateFile} 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 RuntimePromptTemplateFile runtimePromptTemplateFile = (RuntimePromptTemplateFile) o; + return Objects.equals(this.cloudSdkCustomFields, runtimePromptTemplateFile.cloudSdkCustomFields) + && Objects.equals(this.apiVersion, runtimePromptTemplateFile.apiVersion) + && Objects.equals(this.kind, runtimePromptTemplateFile.kind) + && Objects.equals(this.metadata, runtimePromptTemplateFile.metadata) + && Objects.equals(this.spec, runtimePromptTemplateFile.spec); + } + + @Override + public int hashCode() + { + return Objects.hash(apiVersion, kind, metadata, spec, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class RuntimePromptTemplateFile {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java new file mode 100644 index 000000000..c9aff79ee --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * RuntimePromptTemplateFileMetadata + */ + +@Beta // CHECKSTYLE:OFF +public class RuntimePromptTemplateFileMetadata +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + @JsonProperty( "scenario" ) + private String scenario; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for RuntimePromptTemplateFileMetadata. + */ + protected RuntimePromptTemplateFileMetadata() + { + } + + /** + * Set the name of this {@link RuntimePromptTemplateFileMetadata} instance and return the same instance. + * + * @param name + * The name of this {@link RuntimePromptTemplateFileMetadata} + * @return The same instance of this {@link RuntimePromptTemplateFileMetadata} class + */ + @Nonnull + public RuntimePromptTemplateFileMetadata name( @Nullable final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link RuntimePromptTemplateFileMetadata} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link RuntimePromptTemplateFileMetadata} instance. + * + * @param name + * The name of this {@link RuntimePromptTemplateFileMetadata} + */ + public void setName( @Nullable final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link RuntimePromptTemplateFileMetadata} instance and return the same instance. + * + * @param version + * The version of this {@link RuntimePromptTemplateFileMetadata} + * @return The same instance of this {@link RuntimePromptTemplateFileMetadata} class + */ + @Nonnull + public RuntimePromptTemplateFileMetadata version( @Nullable final String version ) + { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link RuntimePromptTemplateFileMetadata} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link RuntimePromptTemplateFileMetadata} instance. + * + * @param version + * The version of this {@link RuntimePromptTemplateFileMetadata} + */ + public void setVersion( @Nullable final String version ) + { + this.version = version; + } + + /** + * Set the scenario of this {@link RuntimePromptTemplateFileMetadata} instance and return the same instance. + * + * @param scenario + * The scenario of this {@link RuntimePromptTemplateFileMetadata} + * @return The same instance of this {@link RuntimePromptTemplateFileMetadata} class + */ + @Nonnull + public RuntimePromptTemplateFileMetadata scenario( @Nullable final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Get scenario + * + * @return scenario The scenario of this {@link RuntimePromptTemplateFileMetadata} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link RuntimePromptTemplateFileMetadata} instance. + * + * @param scenario + * The scenario of this {@link RuntimePromptTemplateFileMetadata} + */ + public void setScenario( @Nullable final String scenario ) + { + this.scenario = scenario; + } + + /** + * Get the names of the unrecognizable properties of the {@link RuntimePromptTemplateFileMetadata}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RuntimePromptTemplateFileMetadata} 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( + "RuntimePromptTemplateFileMetadata has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RuntimePromptTemplateFileMetadata} 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( version != null ) + declaredFields.put("version", version); + if( scenario != null ) + declaredFields.put("scenario", scenario); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RuntimePromptTemplateFileMetadata} 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 RuntimePromptTemplateFileMetadata runtimePromptTemplateFileMetadata = + (RuntimePromptTemplateFileMetadata) o; + return Objects.equals(this.cloudSdkCustomFields, runtimePromptTemplateFileMetadata.cloudSdkCustomFields) + && Objects.equals(this.name, runtimePromptTemplateFileMetadata.name) + && Objects.equals(this.version, runtimePromptTemplateFileMetadata.version) + && Objects.equals(this.scenario, runtimePromptTemplateFileMetadata.scenario); + } + + @Override + public int hashCode() + { + return Objects.hash(name, version, scenario, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class RuntimePromptTemplateFileMetadata {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java new file mode 100644 index 000000000..9371a8ab2 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java @@ -0,0 +1,384 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * This selector allows you to define the scope of translation, such as specific placeholders or messages with specific + * roles. For example, `{\"category\": \"placeholders\", \"items\": + * [\"user_input\"], \"source_language\": \"de-DE\"}` targets the value of + * \"user_input\" in `placeholder_values` specified in the request payload; and considers the value + * to be in German. + */ + +@Beta // CHECKSTYLE:OFF +public class SAPDocumentTranslationApplyToSelector +// CHECKSTYLE:ON +{ + /** + * Category to apply translation to. + */ + public enum CategoryEnum + { + /** + * The PLACEHOLDERS option of this SAPDocumentTranslationApplyToSelector + */ + PLACEHOLDERS("placeholders"), + + /** + * The TEMPLATE_ROLES option of this SAPDocumentTranslationApplyToSelector + */ + TEMPLATE_ROLES("template_roles"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this SAPDocumentTranslationApplyToSelector + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + CategoryEnum( 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 SAPDocumentTranslationApplyToSelector + */ + @JsonCreator + @Nonnull + public static CategoryEnum fromValue( @Nonnull final String value ) + { + for( CategoryEnum b : CategoryEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "category" ) + private CategoryEnum category; + + @JsonProperty( "items" ) + private List items = new ArrayList<>(); + + @JsonProperty( "source_language" ) + private String sourceLanguage; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SAPDocumentTranslationApplyToSelector. + */ + protected SAPDocumentTranslationApplyToSelector() + { + } + + /** + * Set the category of this {@link SAPDocumentTranslationApplyToSelector} instance and return the same instance. + * + * @param category + * Category to apply translation to. + * @return The same instance of this {@link SAPDocumentTranslationApplyToSelector} class + */ + @Nonnull + public SAPDocumentTranslationApplyToSelector category( @Nonnull final CategoryEnum category ) + { + this.category = category; + return this; + } + + /** + * Category to apply translation to. + * + * @return category The category of this {@link SAPDocumentTranslationApplyToSelector} instance. + */ + @Nonnull + public CategoryEnum getCategory() + { + return category; + } + + /** + * Set the category of this {@link SAPDocumentTranslationApplyToSelector} instance. + * + * @param category + * Category to apply translation to. + */ + public void setCategory( @Nonnull final CategoryEnum category ) + { + this.category = category; + } + + /** + * Set the items of this {@link SAPDocumentTranslationApplyToSelector} instance and return the same instance. + * + * @param items + * List of placeholders or roles to apply translation to + * @return The same instance of this {@link SAPDocumentTranslationApplyToSelector} class + */ + @Nonnull + public SAPDocumentTranslationApplyToSelector items( @Nonnull final List items ) + { + this.items = items; + return this; + } + + /** + * Add one items instance to this {@link SAPDocumentTranslationApplyToSelector}. + * + * @param itemsItem + * The items that should be added + * @return The same instance of type {@link SAPDocumentTranslationApplyToSelector} + */ + @Nonnull + public SAPDocumentTranslationApplyToSelector addItemsItem( @Nonnull final String itemsItem ) + { + if( this.items == null ) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * List of placeholders or roles to apply translation to + * + * @return items The items of this {@link SAPDocumentTranslationApplyToSelector} instance. + */ + @Nonnull + public List getItems() + { + return items; + } + + /** + * Set the items of this {@link SAPDocumentTranslationApplyToSelector} instance. + * + * @param items + * List of placeholders or roles to apply translation to + */ + public void setItems( @Nonnull final List items ) + { + this.items = items; + } + + /** + * Set the sourceLanguage of this {@link SAPDocumentTranslationApplyToSelector} instance and return the same + * instance. + * + * @param sourceLanguage + * Language of the text to be translated. + * @return The same instance of this {@link SAPDocumentTranslationApplyToSelector} class + */ + @Nonnull + public SAPDocumentTranslationApplyToSelector sourceLanguage( @Nullable final String sourceLanguage ) + { + this.sourceLanguage = sourceLanguage; + return this; + } + + /** + * Language of the text to be translated. + * + * @return sourceLanguage The sourceLanguage of this {@link SAPDocumentTranslationApplyToSelector} instance. + */ + @Nonnull + public String getSourceLanguage() + { + return sourceLanguage; + } + + /** + * Set the sourceLanguage of this {@link SAPDocumentTranslationApplyToSelector} instance. + * + * @param sourceLanguage + * Language of the text to be translated. + */ + public void setSourceLanguage( @Nullable final String sourceLanguage ) + { + this.sourceLanguage = sourceLanguage; + } + + /** + * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationApplyToSelector}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationApplyToSelector} 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( + "SAPDocumentTranslationApplyToSelector has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SAPDocumentTranslationApplyToSelector} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( category != null ) + declaredFields.put("category", category); + if( items != null ) + declaredFields.put("items", items); + if( sourceLanguage != null ) + declaredFields.put("sourceLanguage", sourceLanguage); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SAPDocumentTranslationApplyToSelector} 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 SAPDocumentTranslationApplyToSelector saPDocumentTranslationApplyToSelector = + (SAPDocumentTranslationApplyToSelector) o; + return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationApplyToSelector.cloudSdkCustomFields) + && Objects.equals(this.category, saPDocumentTranslationApplyToSelector.category) + && Objects.equals(this.items, saPDocumentTranslationApplyToSelector.items) + && Objects.equals(this.sourceLanguage, saPDocumentTranslationApplyToSelector.sourceLanguage); + } + + @Override + public int hashCode() + { + return Objects.hash(category, items, sourceLanguage, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SAPDocumentTranslationApplyToSelector {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" sourceLanguage: ").append(toIndentedString(sourceLanguage)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java new file mode 100644 index 000000000..b8cff778a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * SAPDocumentTranslationInput + */ + +@Beta // CHECKSTYLE:OFF +public class SAPDocumentTranslationInput +// CHECKSTYLE:ON +{ + /** + * Type of document translation provider + */ + public enum TypeEnum + { + /** + * The SAP_DOCUMENT_TRANSLATION option of this SAPDocumentTranslationInput + */ + SAP_DOCUMENT_TRANSLATION("sap_document_translation"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this SAPDocumentTranslationInput + */ + 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 SAPDocumentTranslationInput + */ + @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( "translate_messages_history" ) + private Boolean translateMessagesHistory = true; + + @JsonProperty( "config" ) + private SAPDocumentTranslationInputConfig config; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SAPDocumentTranslationInput. + */ + protected SAPDocumentTranslationInput() + { + } + + /** + * Set the type of this {@link SAPDocumentTranslationInput} instance and return the same instance. + * + * @param type + * Type of document translation provider + * @return The same instance of this {@link SAPDocumentTranslationInput} class + */ + @Nonnull + public SAPDocumentTranslationInput type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Type of document translation provider + * + * @return type The type of this {@link SAPDocumentTranslationInput} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link SAPDocumentTranslationInput} instance. + * + * @param type + * Type of document translation provider + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the translateMessagesHistory of this {@link SAPDocumentTranslationInput} instance and return the same + * instance. + * + * @param translateMessagesHistory + * If true, the messages history will be translated as well. + * @return The same instance of this {@link SAPDocumentTranslationInput} class + */ + @Nonnull + public SAPDocumentTranslationInput translateMessagesHistory( @Nullable final Boolean translateMessagesHistory ) + { + this.translateMessagesHistory = translateMessagesHistory; + return this; + } + + /** + * If true, the messages history will be translated as well. + * + * @return translateMessagesHistory The translateMessagesHistory of this {@link SAPDocumentTranslationInput} + * instance. + */ + @Nonnull + public Boolean isTranslateMessagesHistory() + { + return translateMessagesHistory; + } + + /** + * Set the translateMessagesHistory of this {@link SAPDocumentTranslationInput} instance. + * + * @param translateMessagesHistory + * If true, the messages history will be translated as well. + */ + public void setTranslateMessagesHistory( @Nullable final Boolean translateMessagesHistory ) + { + this.translateMessagesHistory = translateMessagesHistory; + } + + /** + * Set the config of this {@link SAPDocumentTranslationInput} instance and return the same instance. + * + * @param config + * The config of this {@link SAPDocumentTranslationInput} + * @return The same instance of this {@link SAPDocumentTranslationInput} class + */ + @Nonnull + public SAPDocumentTranslationInput config( @Nonnull final SAPDocumentTranslationInputConfig config ) + { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link SAPDocumentTranslationInput} instance. + */ + @Nonnull + public SAPDocumentTranslationInputConfig getConfig() + { + return config; + } + + /** + * Set the config of this {@link SAPDocumentTranslationInput} instance. + * + * @param config + * The config of this {@link SAPDocumentTranslationInput} + */ + public void setConfig( @Nonnull final SAPDocumentTranslationInputConfig config ) + { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationInput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationInput} 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("SAPDocumentTranslationInput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SAPDocumentTranslationInput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( translateMessagesHistory != null ) + declaredFields.put("translateMessagesHistory", translateMessagesHistory); + if( config != null ) + declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SAPDocumentTranslationInput} 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 SAPDocumentTranslationInput saPDocumentTranslationInput = (SAPDocumentTranslationInput) o; + return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationInput.cloudSdkCustomFields) + && Objects.equals(this.type, saPDocumentTranslationInput.type) + && Objects.equals(this.translateMessagesHistory, saPDocumentTranslationInput.translateMessagesHistory) + && Objects.equals(this.config, saPDocumentTranslationInput.config); + } + + @Override + public int hashCode() + { + return Objects.hash(type, translateMessagesHistory, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SAPDocumentTranslationInput {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" translateMessagesHistory: ").append(toIndentedString(translateMessagesHistory)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java new file mode 100644 index 000000000..a07a1cc70 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Configuration for `sap_document_translation` translation provider. + */ + +@Beta // CHECKSTYLE:OFF +public class SAPDocumentTranslationInputConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "source_language" ) + private String sourceLanguage; + + @JsonProperty( "apply_to" ) + private List applyTo = new ArrayList<>(); + + @JsonProperty( "target_language" ) + private String targetLanguage; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SAPDocumentTranslationInputConfig. + */ + protected SAPDocumentTranslationInputConfig() + { + } + + /** + * Set the sourceLanguage of this {@link SAPDocumentTranslationInputConfig} instance and return the same instance. + * + * @param sourceLanguage + * Language of the text to be translated. + * @return The same instance of this {@link SAPDocumentTranslationInputConfig} class + */ + @Nonnull + public SAPDocumentTranslationInputConfig sourceLanguage( @Nullable final String sourceLanguage ) + { + this.sourceLanguage = sourceLanguage; + return this; + } + + /** + * Language of the text to be translated. + * + * @return sourceLanguage The sourceLanguage of this {@link SAPDocumentTranslationInputConfig} instance. + */ + @Nonnull + public String getSourceLanguage() + { + return sourceLanguage; + } + + /** + * Set the sourceLanguage of this {@link SAPDocumentTranslationInputConfig} instance. + * + * @param sourceLanguage + * Language of the text to be translated. + */ + public void setSourceLanguage( @Nullable final String sourceLanguage ) + { + this.sourceLanguage = sourceLanguage; + } + + /** + * Set the applyTo of this {@link SAPDocumentTranslationInputConfig} instance and return the same instance. + * + * @param applyTo + * The applyTo of this {@link SAPDocumentTranslationInputConfig} + * @return The same instance of this {@link SAPDocumentTranslationInputConfig} class + */ + @Nonnull + public SAPDocumentTranslationInputConfig applyTo( + @Nullable final List applyTo ) + { + this.applyTo = applyTo; + return this; + } + + /** + * Add one applyTo instance to this {@link SAPDocumentTranslationInputConfig}. + * + * @param applyToItem + * The applyTo that should be added + * @return The same instance of type {@link SAPDocumentTranslationInputConfig} + */ + @Nonnull + public SAPDocumentTranslationInputConfig addApplyToItem( + @Nonnull final SAPDocumentTranslationApplyToSelector applyToItem ) + { + if( this.applyTo == null ) { + this.applyTo = new ArrayList<>(); + } + this.applyTo.add(applyToItem); + return this; + } + + /** + * Get applyTo + * + * @return applyTo The applyTo of this {@link SAPDocumentTranslationInputConfig} instance. + */ + @Nonnull + public List getApplyTo() + { + return applyTo; + } + + /** + * Set the applyTo of this {@link SAPDocumentTranslationInputConfig} instance. + * + * @param applyTo + * The applyTo of this {@link SAPDocumentTranslationInputConfig} + */ + public void setApplyTo( @Nullable final List applyTo ) + { + this.applyTo = applyTo; + } + + /** + * Set the targetLanguage of this {@link SAPDocumentTranslationInputConfig} instance and return the same instance. + * + * @param targetLanguage + * Language to which the text should be translated. + * @return The same instance of this {@link SAPDocumentTranslationInputConfig} class + */ + @Nonnull + public SAPDocumentTranslationInputConfig targetLanguage( @Nonnull final String targetLanguage ) + { + this.targetLanguage = targetLanguage; + return this; + } + + /** + * Language to which the text should be translated. + * + * @return targetLanguage The targetLanguage of this {@link SAPDocumentTranslationInputConfig} instance. + */ + @Nonnull + public String getTargetLanguage() + { + return targetLanguage; + } + + /** + * Set the targetLanguage of this {@link SAPDocumentTranslationInputConfig} instance. + * + * @param targetLanguage + * Language to which the text should be translated. + */ + public void setTargetLanguage( @Nonnull final String targetLanguage ) + { + this.targetLanguage = targetLanguage; + } + + /** + * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationInputConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationInputConfig} 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( + "SAPDocumentTranslationInputConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SAPDocumentTranslationInputConfig} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( sourceLanguage != null ) + declaredFields.put("sourceLanguage", sourceLanguage); + if( applyTo != null ) + declaredFields.put("applyTo", applyTo); + if( targetLanguage != null ) + declaredFields.put("targetLanguage", targetLanguage); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SAPDocumentTranslationInputConfig} 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 SAPDocumentTranslationInputConfig saPDocumentTranslationInputConfig = + (SAPDocumentTranslationInputConfig) o; + return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationInputConfig.cloudSdkCustomFields) + && Objects.equals(this.sourceLanguage, saPDocumentTranslationInputConfig.sourceLanguage) + && Objects.equals(this.applyTo, saPDocumentTranslationInputConfig.applyTo) + && Objects.equals(this.targetLanguage, saPDocumentTranslationInputConfig.targetLanguage); + } + + @Override + public int hashCode() + { + return Objects.hash(sourceLanguage, applyTo, targetLanguage, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SAPDocumentTranslationInputConfig {\n"); + sb.append(" sourceLanguage: ").append(toIndentedString(sourceLanguage)).append("\n"); + sb.append(" applyTo: ").append(toIndentedString(applyTo)).append("\n"); + sb.append(" targetLanguage: ").append(toIndentedString(targetLanguage)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java new file mode 100644 index 000000000..a9fbe4525 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * SAPDocumentTranslationOutput + */ + +@Beta // CHECKSTYLE:OFF +public class SAPDocumentTranslationOutput +// CHECKSTYLE:ON +{ + /** + * Configuration for `sap_document_translation` translation provider. + */ + public enum TypeEnum + { + /** + * The SAP_DOCUMENT_TRANSLATION option of this SAPDocumentTranslationOutput + */ + SAP_DOCUMENT_TRANSLATION("sap_document_translation"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this SAPDocumentTranslationOutput + */ + 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 SAPDocumentTranslationOutput + */ + @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 SAPDocumentTranslationOutputConfig config; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SAPDocumentTranslationOutput. + */ + protected SAPDocumentTranslationOutput() + { + } + + /** + * Set the type of this {@link SAPDocumentTranslationOutput} instance and return the same instance. + * + * @param type + * Configuration for `sap_document_translation` translation provider. + * @return The same instance of this {@link SAPDocumentTranslationOutput} class + */ + @Nonnull + public SAPDocumentTranslationOutput type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Configuration for `sap_document_translation` translation provider. + * + * @return type The type of this {@link SAPDocumentTranslationOutput} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link SAPDocumentTranslationOutput} instance. + * + * @param type + * Configuration for `sap_document_translation` translation provider. + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the config of this {@link SAPDocumentTranslationOutput} instance and return the same instance. + * + * @param config + * The config of this {@link SAPDocumentTranslationOutput} + * @return The same instance of this {@link SAPDocumentTranslationOutput} class + */ + @Nonnull + public SAPDocumentTranslationOutput config( @Nonnull final SAPDocumentTranslationOutputConfig config ) + { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link SAPDocumentTranslationOutput} instance. + */ + @Nonnull + public SAPDocumentTranslationOutputConfig getConfig() + { + return config; + } + + /** + * Set the config of this {@link SAPDocumentTranslationOutput} instance. + * + * @param config + * The config of this {@link SAPDocumentTranslationOutput} + */ + public void setConfig( @Nonnull final SAPDocumentTranslationOutputConfig config ) + { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationOutput}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationOutput} 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("SAPDocumentTranslationOutput has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SAPDocumentTranslationOutput} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( config != null ) + declaredFields.put("config", config); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SAPDocumentTranslationOutput} 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 SAPDocumentTranslationOutput saPDocumentTranslationOutput = (SAPDocumentTranslationOutput) o; + return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationOutput.cloudSdkCustomFields) + && Objects.equals(this.type, saPDocumentTranslationOutput.type) + && Objects.equals(this.config, saPDocumentTranslationOutput.config); + } + + @Override + public int hashCode() + { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SAPDocumentTranslationOutput {\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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java new file mode 100644 index 000000000..15d1e1891 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * SAPDocumentTranslationOutputConfig + */ + +@Beta // CHECKSTYLE:OFF +public class SAPDocumentTranslationOutputConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "source_language" ) + private String sourceLanguage; + + @JsonProperty( "target_language" ) + private SAPDocumentTranslationOutputTargetLanguage targetLanguage; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SAPDocumentTranslationOutputConfig. + */ + protected SAPDocumentTranslationOutputConfig() + { + } + + /** + * Set the sourceLanguage of this {@link SAPDocumentTranslationOutputConfig} instance and return the same instance. + * + * @param sourceLanguage + * Language of the text to be translated. + * @return The same instance of this {@link SAPDocumentTranslationOutputConfig} class + */ + @Nonnull + public SAPDocumentTranslationOutputConfig sourceLanguage( @Nullable final String sourceLanguage ) + { + this.sourceLanguage = sourceLanguage; + return this; + } + + /** + * Language of the text to be translated. + * + * @return sourceLanguage The sourceLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. + */ + @Nonnull + public String getSourceLanguage() + { + return sourceLanguage; + } + + /** + * Set the sourceLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. + * + * @param sourceLanguage + * Language of the text to be translated. + */ + public void setSourceLanguage( @Nullable final String sourceLanguage ) + { + this.sourceLanguage = sourceLanguage; + } + + /** + * Set the targetLanguage of this {@link SAPDocumentTranslationOutputConfig} instance and return the same instance. + * + * @param targetLanguage + * The targetLanguage of this {@link SAPDocumentTranslationOutputConfig} + * @return The same instance of this {@link SAPDocumentTranslationOutputConfig} class + */ + @Nonnull + public SAPDocumentTranslationOutputConfig targetLanguage( + @Nonnull final SAPDocumentTranslationOutputTargetLanguage targetLanguage ) + { + this.targetLanguage = targetLanguage; + return this; + } + + /** + * Get targetLanguage + * + * @return targetLanguage The targetLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. + */ + @Nonnull + public SAPDocumentTranslationOutputTargetLanguage getTargetLanguage() + { + return targetLanguage; + } + + /** + * Set the targetLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. + * + * @param targetLanguage + * The targetLanguage of this {@link SAPDocumentTranslationOutputConfig} + */ + public void setTargetLanguage( @Nonnull final SAPDocumentTranslationOutputTargetLanguage targetLanguage ) + { + this.targetLanguage = targetLanguage; + } + + /** + * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationOutputConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationOutputConfig} 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( + "SAPDocumentTranslationOutputConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SAPDocumentTranslationOutputConfig} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( sourceLanguage != null ) + declaredFields.put("sourceLanguage", sourceLanguage); + if( targetLanguage != null ) + declaredFields.put("targetLanguage", targetLanguage); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SAPDocumentTranslationOutputConfig} 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 SAPDocumentTranslationOutputConfig saPDocumentTranslationOutputConfig = + (SAPDocumentTranslationOutputConfig) o; + return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationOutputConfig.cloudSdkCustomFields) + && Objects.equals(this.sourceLanguage, saPDocumentTranslationOutputConfig.sourceLanguage) + && Objects.equals(this.targetLanguage, saPDocumentTranslationOutputConfig.targetLanguage); + } + + @Override + public int hashCode() + { + return Objects.hash(sourceLanguage, targetLanguage, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SAPDocumentTranslationOutputConfig {\n"); + sb.append(" sourceLanguage: ").append(toIndentedString(sourceLanguage)).append("\n"); + sb.append(" targetLanguage: ").append(toIndentedString(targetLanguage)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java new file mode 100644 index 000000000..d5996e42c --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import javax.annotation.Nonnull; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * SAPDocumentTranslationOutputTargetLanguage + */ +@Beta +public interface SAPDocumentTranslationOutputTargetLanguage +{ + /** + * Helper class to create {@code String } that implements {@link SAPDocumentTranslationOutputTargetLanguage}. + */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements SAPDocumentTranslationOutputTargetLanguage {} + + /** + * 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 SAPDocumentTranslationApplyToSelector } that implements {@link SAPDocumentTranslationOutputTargetLanguage}. + */ + record InnerSAPDocumentTranslationApplyToSelector(@com.fasterxml.jackson.annotation.JsonValue @Nonnull SAPDocumentTranslationApplyToSelector value) implements SAPDocumentTranslationOutputTargetLanguage {} + + /** + * Creator to enable deserialization of {@code SAPDocumentTranslationApplyToSelector }. + * + * @param val + * the value to use + * @return a new instance of {@link InnerSAPDocumentTranslationApplyToSelector}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerSAPDocumentTranslationApplyToSelector createInnerSAPDocumentTranslationApplyToSelector( + @Nonnull final SAPDocumentTranslationApplyToSelector val ) + { + return new InnerSAPDocumentTranslationApplyToSelector(val); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java new file mode 100644 index 000000000..889ec4c43 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * SearchDocumentKeyValueListPair + */ + +@Beta // CHECKSTYLE:OFF +public class SearchDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty( "key" ) + private String key; + + @JsonProperty( "value" ) + private List value = new ArrayList<>(); + + @JsonProperty( "select_mode" ) + private List selectMode = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SearchDocumentKeyValueListPair. + */ + protected SearchDocumentKeyValueListPair() + { + } + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same instance. + * + * @param key + * The key of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair key( @Nonnull final String key ) + { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() + { + return key; + } + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key + * The key of this {@link SearchDocumentKeyValueListPair} + */ + public void setKey( @Nonnull final String key ) + { + this.key = key; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance and return the same instance. + * + * @param value + * The value of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair value( @Nonnull final List value ) + { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param valueItem + * The value that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addValueItem( @Nonnull final String valueItem ) + { + if( this.value == null ) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() + { + return value; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value + * The value of this {@link SearchDocumentKeyValueListPair} + */ + public void setValue( @Nonnull final List value ) + { + this.value = value; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance and return the same instance. + * + * @param selectMode + * Select mode for search filters + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair selectMode( @Nullable final List selectMode ) + { + this.selectMode = selectMode; + return this; + } + + /** + * Add one selectMode instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param selectModeItem + * The selectMode that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addSelectModeItem( @Nonnull final SearchSelectOptionEnum selectModeItem ) + { + if( this.selectMode == null ) { + this.selectMode = new ArrayList<>(); + } + this.selectMode.add(selectModeItem); + return this; + } + + /** + * Select mode for search filters + * + * @return selectMode The selectMode of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getSelectMode() + { + return selectMode; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param selectMode + * Select mode for search filters + */ + public void setSelectMode( @Nullable final List selectMode ) + { + this.selectMode = selectMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. + * + * @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("SearchDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SearchDocumentKeyValueListPair} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( key != null ) + declaredFields.put("key", key); + if( value != null ) + declaredFields.put("value", value); + if( selectMode != null ) + declaredFields.put("selectMode", selectMode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = (SearchDocumentKeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, searchDocumentKeyValueListPair.key) + && Objects.equals(this.value, searchDocumentKeyValueListPair.value) + && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode); + } + + @Override + public int hashCode() + { + return Objects.hash(key, value, selectMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SearchDocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java new file mode 100644 index 000000000..32b7bbe38 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import javax.annotation.Nonnull; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Gets or Sets SearchSelectOptionEnum + */ + +@Beta +public enum SearchSelectOptionEnum +{ + + IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + SearchSelectOptionEnum( String value ) + { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() + { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() + { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value + * The input value. + * + * @return The enum representation of the given value. + */ + @JsonCreator + public static SearchSelectOptionEnum fromValue( @Nonnull final String value ) + { + for( final SearchSelectOptionEnum b : SearchSelectOptionEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java new file mode 100644 index 000000000..d8bac9d11 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * SingleChatTemplate + */ + +@Beta // CHECKSTYLE:OFF +public class SingleChatTemplate implements PromptTemplate +// CHECKSTYLE:ON +{ + @JsonProperty( "role" ) + private String role; + + @JsonProperty( "content" ) + private String content; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SingleChatTemplate. + */ + protected SingleChatTemplate() + { + } + + /** + * Set the role of this {@link SingleChatTemplate} instance and return the same instance. + * + * @param role + * The role of this {@link SingleChatTemplate} + * @return The same instance of this {@link SingleChatTemplate} class + */ + @Nonnull + public SingleChatTemplate role( @Nonnull final String role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link SingleChatTemplate} instance. + */ + @Nonnull + public String getRole() + { + return role; + } + + /** + * Set the role of this {@link SingleChatTemplate} instance. + * + * @param role + * The role of this {@link SingleChatTemplate} + */ + public void setRole( @Nonnull final String role ) + { + this.role = role; + } + + /** + * Set the content of this {@link SingleChatTemplate} instance and return the same instance. + * + * @param content + * The content of this {@link SingleChatTemplate} + * @return The same instance of this {@link SingleChatTemplate} class + */ + @Nonnull + public SingleChatTemplate content( @Nonnull final String content ) + { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link SingleChatTemplate} instance. + */ + @Nonnull + public String getContent() + { + return content; + } + + /** + * Set the content of this {@link SingleChatTemplate} instance. + * + * @param content + * The content of this {@link SingleChatTemplate} + */ + public void setContent( @Nonnull final String content ) + { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link SingleChatTemplate}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SingleChatTemplate} 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("SingleChatTemplate has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SingleChatTemplate} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( role != null ) + declaredFields.put("role", role); + if( content != null ) + declaredFields.put("content", content); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SingleChatTemplate} 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 SingleChatTemplate singleChatTemplate = (SingleChatTemplate) o; + return Objects.equals(this.cloudSdkCustomFields, singleChatTemplate.cloudSdkCustomFields) + && Objects.equals(this.role, singleChatTemplate.role) + && Objects.equals(this.content, singleChatTemplate.content); + } + + @Override + public int hashCode() + { + return Objects.hash(role, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SingleChatTemplate {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java new file mode 100644 index 000000000..5e9e203e2 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * SystemChatMessage + */ + +@Beta // CHECKSTYLE:OFF +public class SystemChatMessage implements ChatMessage +// CHECKSTYLE:ON +{ + /** + * Gets or Sets role + */ + public enum RoleEnum + { + /** + * The SYSTEM option of this SystemChatMessage + */ + SYSTEM("system"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this SystemChatMessage + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum( 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 SystemChatMessage + */ + @JsonCreator + @Nonnull + public static RoleEnum fromValue( @Nonnull final String value ) + { + for( RoleEnum b : RoleEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "role" ) + private RoleEnum role; + + @JsonProperty( "content" ) + private ChatMessageContent content; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SystemChatMessage. + */ + protected SystemChatMessage() + { + } + + /** + * Set the role of this {@link SystemChatMessage} instance and return the same instance. + * + * @param role + * The role of this {@link SystemChatMessage} + * @return The same instance of this {@link SystemChatMessage} class + */ + @Nonnull + public SystemChatMessage role( @Nonnull final RoleEnum role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link SystemChatMessage} instance. + */ + @Nonnull + public RoleEnum getRole() + { + return role; + } + + /** + * Set the role of this {@link SystemChatMessage} instance. + * + * @param role + * The role of this {@link SystemChatMessage} + */ + public void setRole( @Nonnull final RoleEnum role ) + { + this.role = role; + } + + /** + * Set the content of this {@link SystemChatMessage} instance and return the same instance. + * + * @param content + * The content of this {@link SystemChatMessage} + * @return The same instance of this {@link SystemChatMessage} class + */ + @Nonnull + public SystemChatMessage content( @Nonnull final ChatMessageContent content ) + { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link SystemChatMessage} instance. + */ + @Nonnull + public ChatMessageContent getContent() + { + return content; + } + + /** + * Set the content of this {@link SystemChatMessage} instance. + * + * @param content + * The content of this {@link SystemChatMessage} + */ + public void setContent( @Nonnull final ChatMessageContent content ) + { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link SystemChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SystemChatMessage} 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("SystemChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SystemChatMessage} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( role != null ) + declaredFields.put("role", role); + if( content != null ) + declaredFields.put("content", content); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SystemChatMessage} 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 SystemChatMessage systemChatMessage = (SystemChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, systemChatMessage.cloudSdkCustomFields) + && Objects.equals(this.role, systemChatMessage.role) + && Objects.equals(this.content, systemChatMessage.content); + } + + @Override + public int hashCode() + { + return Objects.hash(role, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SystemChatMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java new file mode 100644 index 000000000..7b39b3d5a --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java @@ -0,0 +1,389 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Template + */ + +@Beta // CHECKSTYLE:OFF +public class Template implements PromptTemplatingModuleConfigPrompt +// CHECKSTYLE:ON +{ + @JsonProperty( "template" ) + private List template; + + @JsonProperty( "defaults" ) + private Map defaults = new HashMap<>(); + + @JsonProperty( "response_format" ) + private TemplateResponseFormat responseFormat; + + @JsonProperty( "tools" ) + private List tools = new ArrayList<>(); + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for Template. + */ + protected Template() + { + } + + /** + * Set the template of this {@link Template} instance and return the same instance. + * + * @param template + * A chat message array to be formatted with values from placeholder_values. Both role and content can be + * templated. If messages_history is provided, the templated messages will be appended. + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template template( @Nonnull final List template ) + { + this.template = template; + return this; + } + + /** + * Add one template instance to this {@link Template}. + * + * @param templateItem + * The template that should be added + * @return The same instance of type {@link Template} + */ + @Nonnull + public Template addTemplateItem( @Nonnull final ChatMessage templateItem ) + { + if( this.template == null ) { + this.template = new ArrayList<>(); + } + this.template.add(templateItem); + return this; + } + + /** + * A chat message array to be formatted with values from placeholder_values. Both role and content can be templated. + * If messages_history is provided, the templated messages will be appended. + * + * @return template The template of this {@link Template} instance. + */ + @Nonnull + public List getTemplate() + { + return template; + } + + /** + * Set the template of this {@link Template} instance. + * + * @param template + * A chat message array to be formatted with values from placeholder_values. Both role and content can be + * templated. If messages_history is provided, the templated messages will be appended. + */ + public void setTemplate( @Nonnull final List template ) + { + this.template = template; + } + + /** + * Set the defaults of this {@link Template} instance and return the same instance. + * + * @param defaults + * Optional default values for the template. If a parameter has no default it is required. + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template defaults( @Nullable final Map defaults ) + { + this.defaults = defaults; + return this; + } + + /** + * Put one defaults instance to this {@link Template} instance. + * + * @param key + * The String key of this defaults instance + * @param defaultsItem + * The defaults that should be added under the given key + * @return The same instance of type {@link Template} + */ + @Nonnull + public Template putdefaultsItem( @Nonnull final String key, @Nonnull final String defaultsItem ) + { + if( this.defaults == null ) { + this.defaults = new HashMap<>(); + } + this.defaults.put(key, defaultsItem); + return this; + } + + /** + * Optional default values for the template. If a parameter has no default it is required. + * + * @return defaults The defaults of this {@link Template} instance. + */ + @Nonnull + public Map getDefaults() + { + return defaults; + } + + /** + * Set the defaults of this {@link Template} instance. + * + * @param defaults + * Optional default values for the template. If a parameter has no default it is required. + */ + public void setDefaults( @Nullable final Map defaults ) + { + this.defaults = defaults; + } + + /** + * Set the responseFormat of this {@link Template} instance and return the same instance. + * + * @param responseFormat + * The responseFormat of this {@link Template} + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template responseFormat( @Nullable final TemplateResponseFormat responseFormat ) + { + this.responseFormat = responseFormat; + return this; + } + + /** + * Get responseFormat + * + * @return responseFormat The responseFormat of this {@link Template} instance. + */ + @Nonnull + public TemplateResponseFormat getResponseFormat() + { + return responseFormat; + } + + /** + * Set the responseFormat of this {@link Template} instance. + * + * @param responseFormat + * The responseFormat of this {@link Template} + */ + public void setResponseFormat( @Nullable final TemplateResponseFormat responseFormat ) + { + this.responseFormat = responseFormat; + } + + /** + * Set the tools of this {@link Template} instance and return the same instance. + * + * @param tools + * A list of tools the model may call. Used to provide a list of functions the model may generate JSON + * inputs for. This is the same as the OpenAI definition. + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template tools( @Nullable final List tools ) + { + this.tools = tools; + return this; + } + + /** + * Add one tools instance to this {@link Template}. + * + * @param toolsItem + * The tools that should be added + * @return The same instance of type {@link Template} + */ + @Nonnull + public Template addToolsItem( @Nonnull final ChatCompletionTool toolsItem ) + { + if( this.tools == null ) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. + * This is the same as the OpenAI definition. + * + * @return tools The tools of this {@link Template} instance. + */ + @Nonnull + public List getTools() + { + return tools; + } + + /** + * Set the tools of this {@link Template} instance. + * + * @param tools + * A list of tools the model may call. Used to provide a list of functions the model may generate JSON + * inputs for. This is the same as the OpenAI definition. + */ + public void setTools( @Nullable final List tools ) + { + this.tools = tools; + } + + /** + * Get the names of the unrecognizable properties of the {@link Template}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Template} 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("Template has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link Template} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( template != null ) + declaredFields.put("template", template); + if( defaults != null ) + declaredFields.put("defaults", defaults); + if( responseFormat != null ) + declaredFields.put("responseFormat", responseFormat); + if( tools != null ) + declaredFields.put("tools", tools); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link Template} 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 Template template = (Template) o; + return Objects.equals(this.cloudSdkCustomFields, template.cloudSdkCustomFields) + && Objects.equals(this.template, template.template) + && Objects.equals(this.defaults, template.defaults) + && Objects.equals(this.responseFormat, template.responseFormat) + && Objects.equals(this.tools, template.tools); + } + + @Override + public int hashCode() + { + return Objects.hash(template, defaults, responseFormat, tools, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class Template {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); + sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java new file mode 100644 index 000000000..52cc602df --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * TemplateRef + */ + +@Beta // CHECKSTYLE:OFF +public class TemplateRef implements PromptTemplatingModuleConfigPrompt +// CHECKSTYLE:ON +{ + @JsonProperty( "template_ref" ) + private TemplateRefTemplateRef templateRef; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for TemplateRef. + */ + protected TemplateRef() + { + } + + /** + * Set the templateRef of this {@link TemplateRef} instance and return the same instance. + * + * @param templateRef + * The templateRef of this {@link TemplateRef} + * @return The same instance of this {@link TemplateRef} class + */ + @Nonnull + public TemplateRef templateRef( @Nonnull final TemplateRefTemplateRef templateRef ) + { + this.templateRef = templateRef; + return this; + } + + /** + * Get templateRef + * + * @return templateRef The templateRef of this {@link TemplateRef} instance. + */ + @Nonnull + public TemplateRefTemplateRef getTemplateRef() + { + return templateRef; + } + + /** + * Set the templateRef of this {@link TemplateRef} instance. + * + * @param templateRef + * The templateRef of this {@link TemplateRef} + */ + public void setTemplateRef( @Nonnull final TemplateRefTemplateRef templateRef ) + { + this.templateRef = templateRef; + } + + /** + * Get the names of the unrecognizable properties of the {@link TemplateRef}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRef} 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("TemplateRef has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link TemplateRef} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( templateRef != null ) + declaredFields.put("templateRef", templateRef); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link TemplateRef} 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 TemplateRef templateRef = (TemplateRef) o; + return Objects.equals(this.cloudSdkCustomFields, templateRef.cloudSdkCustomFields) + && Objects.equals(this.templateRef, templateRef.templateRef); + } + + @Override + public int hashCode() + { + return Objects.hash(templateRef, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRef {\n"); + sb.append(" templateRef: ").append(toIndentedString(templateRef)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java new file mode 100644 index 000000000..31764a273 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * TemplateRefByID + */ + +@Beta // CHECKSTYLE:OFF +public class TemplateRefByID implements TemplateRefTemplateRef +// CHECKSTYLE:ON +{ + @JsonProperty( "id" ) + private String id; + + /** + * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared + * across all resource groups within the tenant, while 'resource_group' indicates the template is only + * accessible within the specific resource group. + */ + public enum ScopeEnum + { + /** + * The RESOURCE_GROUP option of this TemplateRefByID + */ + RESOURCE_GROUP("resource_group"), + + /** + * The TENANT option of this TemplateRefByID + */ + TENANT("tenant"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this TemplateRefByID + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum( 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 TemplateRefByID + */ + @JsonCreator + @Nonnull + public static ScopeEnum fromValue( @Nonnull final String value ) + { + for( ScopeEnum b : ScopeEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "scope" ) + private ScopeEnum scope = ScopeEnum.TENANT; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for TemplateRefByID. + */ + protected TemplateRefByID() + { + } + + /** + * Set the id of this {@link TemplateRefByID} instance and return the same instance. + * + * @param id + * ID of the template in prompt registry + * @return The same instance of this {@link TemplateRefByID} class + */ + @Nonnull + public TemplateRefByID id( @Nonnull final String id ) + { + this.id = id; + return this; + } + + /** + * ID of the template in prompt registry + * + * @return id The id of this {@link TemplateRefByID} instance. + */ + @Nonnull + public String getId() + { + return id; + } + + /** + * Set the id of this {@link TemplateRefByID} instance. + * + * @param id + * ID of the template in prompt registry + */ + public void setId( @Nonnull final String id ) + { + this.id = id; + } + + /** + * Set the scope of this {@link TemplateRefByID} instance and return the same instance. + * + * @param scope + * Defines the scope that is searched for the referenced template. 'tenant' indicates the + * template is shared across all resource groups within the tenant, while 'resource_group' + * indicates the template is only accessible within the specific resource group. + * @return The same instance of this {@link TemplateRefByID} class + */ + @Nonnull + public TemplateRefByID scope( @Nullable final ScopeEnum scope ) + { + this.scope = scope; + return this; + } + + /** + * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared + * across all resource groups within the tenant, while 'resource_group' indicates the template is only + * accessible within the specific resource group. + * + * @return scope The scope of this {@link TemplateRefByID} instance. + */ + @Nonnull + public ScopeEnum getScope() + { + return scope; + } + + /** + * Set the scope of this {@link TemplateRefByID} instance. + * + * @param scope + * Defines the scope that is searched for the referenced template. 'tenant' indicates the + * template is shared across all resource groups within the tenant, while 'resource_group' + * indicates the template is only accessible within the specific resource group. + */ + public void setScope( @Nullable final ScopeEnum scope ) + { + this.scope = scope; + } + + /** + * Get the names of the unrecognizable properties of the {@link TemplateRefByID}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRefByID} 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("TemplateRefByID has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link TemplateRefByID} 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( scope != null ) + declaredFields.put("scope", scope); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link TemplateRefByID} 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 TemplateRefByID templateRefByID = (TemplateRefByID) o; + return Objects.equals(this.cloudSdkCustomFields, templateRefByID.cloudSdkCustomFields) + && Objects.equals(this.id, templateRefByID.id) + && Objects.equals(this.scope, templateRefByID.scope); + } + + @Override + public int hashCode() + { + return Objects.hash(id, scope, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRefByID {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java new file mode 100644 index 000000000..67ff64d40 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java @@ -0,0 +1,409 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * TemplateRefByScenarioNameVersion + */ + +@Beta // CHECKSTYLE:OFF +public class TemplateRefByScenarioNameVersion implements TemplateRefTemplateRef +// CHECKSTYLE:ON +{ + @JsonProperty( "scenario" ) + private String scenario; + + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "version" ) + private String version; + + /** + * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared + * across all resource groups within the tenant, while 'resource_group' indicates the template is only + * accessible within the specific resource group. + */ + public enum ScopeEnum + { + /** + * The RESOURCE_GROUP option of this TemplateRefByScenarioNameVersion + */ + RESOURCE_GROUP("resource_group"), + + /** + * The TENANT option of this TemplateRefByScenarioNameVersion + */ + TENANT("tenant"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this TemplateRefByScenarioNameVersion + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ScopeEnum( 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 TemplateRefByScenarioNameVersion + */ + @JsonCreator + @Nonnull + public static ScopeEnum fromValue( @Nonnull final String value ) + { + for( ScopeEnum b : ScopeEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "scope" ) + private ScopeEnum scope = ScopeEnum.TENANT; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for TemplateRefByScenarioNameVersion. + */ + protected TemplateRefByScenarioNameVersion() + { + } + + /** + * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. + * + * @param scenario + * Scenario name + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion scenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + return this; + } + + /** + * Scenario name + * + * @return scenario The scenario of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public String getScenario() + { + return scenario; + } + + /** + * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param scenario + * Scenario name + */ + public void setScenario( @Nonnull final String scenario ) + { + this.scenario = scenario; + } + + /** + * Set the name of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. + * + * @param name + * Name of the template + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Name of the template + * + * @return name The name of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param name + * Name of the template + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the version of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. + * + * @param version + * Version of the template + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion version( @Nonnull final String version ) + { + this.version = version; + return this; + } + + /** + * Version of the template + * + * @return version The version of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public String getVersion() + { + return version; + } + + /** + * Set the version of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param version + * Version of the template + */ + public void setVersion( @Nonnull final String version ) + { + this.version = version; + } + + /** + * Set the scope of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. + * + * @param scope + * Defines the scope that is searched for the referenced template. 'tenant' indicates the + * template is shared across all resource groups within the tenant, while 'resource_group' + * indicates the template is only accessible within the specific resource group. + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion scope( @Nullable final ScopeEnum scope ) + { + this.scope = scope; + return this; + } + + /** + * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared + * across all resource groups within the tenant, while 'resource_group' indicates the template is only + * accessible within the specific resource group. + * + * @return scope The scope of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public ScopeEnum getScope() + { + return scope; + } + + /** + * Set the scope of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param scope + * Defines the scope that is searched for the referenced template. 'tenant' indicates the + * template is shared across all resource groups within the tenant, while 'resource_group' + * indicates the template is only accessible within the specific resource group. + */ + public void setScope( @Nullable final ScopeEnum scope ) + { + this.scope = scope; + } + + /** + * Get the names of the unrecognizable properties of the {@link TemplateRefByScenarioNameVersion}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRefByScenarioNameVersion} 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("TemplateRefByScenarioNameVersion has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link TemplateRefByScenarioNameVersion} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( scenario != null ) + declaredFields.put("scenario", scenario); + if( name != null ) + declaredFields.put("name", name); + if( version != null ) + declaredFields.put("version", version); + if( scope != null ) + declaredFields.put("scope", scope); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link TemplateRefByScenarioNameVersion} 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 TemplateRefByScenarioNameVersion templateRefByScenarioNameVersion = (TemplateRefByScenarioNameVersion) o; + return Objects.equals(this.cloudSdkCustomFields, templateRefByScenarioNameVersion.cloudSdkCustomFields) + && Objects.equals(this.scenario, templateRefByScenarioNameVersion.scenario) + && Objects.equals(this.name, templateRefByScenarioNameVersion.name) + && Objects.equals(this.version, templateRefByScenarioNameVersion.version) + && Objects.equals(this.scope, templateRefByScenarioNameVersion.scope); + } + + @Override + public int hashCode() + { + return Objects.hash(scenario, name, version, scope, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRefByScenarioNameVersion {\n"); + sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java new file mode 100644 index 000000000..d9831432d --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * Reference to a template in the prompt registry by ID or by scenario, name and version + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = TemplateRefByID.class ), + @JsonSubTypes.Type( value = TemplateRefByScenarioNameVersion.class ), } ) + +public interface TemplateRefTemplateRef +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java new file mode 100644 index 000000000..205025c94 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; + +/** + * Response format that the model output should adhere to. This is the same as the OpenAI definition. + */ +@Beta +@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonSubTypes( { + @JsonSubTypes.Type( value = ResponseFormatJsonObject.class ), + @JsonSubTypes.Type( value = ResponseFormatJsonSchema.class ), + @JsonSubTypes.Type( value = ResponseFormatText.class ), } ) + +public interface TemplateResponseFormat +{ +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java new file mode 100644 index 000000000..96480f22f --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * TextContent + */ + +@Beta // CHECKSTYLE:OFF +public class TextContent implements MultiChatContent +// CHECKSTYLE:ON +{ + /** + * Gets or Sets type + */ + public enum TypeEnum + { + /** + * The TEXT option of this TextContent + */ + TEXT("text"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this TextContent + */ + 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 TextContent + */ + @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( "text" ) + private String text; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for TextContent. + */ + protected TextContent() + { + } + + /** + * Set the type of this {@link TextContent} instance and return the same instance. + * + * @param type + * The type of this {@link TextContent} + * @return The same instance of this {@link TextContent} class + */ + @Nonnull + public TextContent type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link TextContent} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link TextContent} instance. + * + * @param type + * The type of this {@link TextContent} + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the text of this {@link TextContent} instance and return the same instance. + * + * @param text + * The text of this {@link TextContent} + * @return The same instance of this {@link TextContent} class + */ + @Nonnull + public TextContent text( @Nonnull final String text ) + { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link TextContent} instance. + */ + @Nonnull + public String getText() + { + return text; + } + + /** + * Set the text of this {@link TextContent} instance. + * + * @param text + * The text of this {@link TextContent} + */ + public void setText( @Nonnull final String text ) + { + this.text = text; + } + + /** + * Get the names of the unrecognizable properties of the {@link TextContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TextContent} 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("TextContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link TextContent} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( text != null ) + declaredFields.put("text", text); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link TextContent} 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 TextContent textContent = (TextContent) o; + return Objects.equals(this.cloudSdkCustomFields, textContent.cloudSdkCustomFields) + && Objects.equals(this.type, textContent.type) + && Objects.equals(this.text, textContent.text); + } + + @Override + public int hashCode() + { + return Objects.hash(type, text, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class TextContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java new file mode 100644 index 000000000..585e72ad4 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * ToolChatMessage + */ + +@Beta // CHECKSTYLE:OFF +public class ToolChatMessage implements ChatMessage +// CHECKSTYLE:ON +{ + /** + * Gets or Sets role + */ + public enum RoleEnum + { + /** + * The TOOL option of this ToolChatMessage + */ + TOOL("tool"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this ToolChatMessage + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum( 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 ToolChatMessage + */ + @JsonCreator + @Nonnull + public static RoleEnum fromValue( @Nonnull final String value ) + { + for( RoleEnum b : RoleEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "role" ) + private RoleEnum role; + + @JsonProperty( "tool_call_id" ) + private String toolCallId; + + @JsonProperty( "content" ) + private ChatMessageContent content; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for ToolChatMessage. + */ + protected ToolChatMessage() + { + } + + /** + * Set the role of this {@link ToolChatMessage} instance and return the same instance. + * + * @param role + * The role of this {@link ToolChatMessage} + * @return The same instance of this {@link ToolChatMessage} class + */ + @Nonnull + public ToolChatMessage role( @Nonnull final RoleEnum role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link ToolChatMessage} instance. + */ + @Nonnull + public RoleEnum getRole() + { + return role; + } + + /** + * Set the role of this {@link ToolChatMessage} instance. + * + * @param role + * The role of this {@link ToolChatMessage} + */ + public void setRole( @Nonnull final RoleEnum role ) + { + this.role = role; + } + + /** + * Set the toolCallId of this {@link ToolChatMessage} instance and return the same instance. + * + * @param toolCallId + * The toolCallId of this {@link ToolChatMessage} + * @return The same instance of this {@link ToolChatMessage} class + */ + @Nonnull + public ToolChatMessage toolCallId( @Nonnull final String toolCallId ) + { + this.toolCallId = toolCallId; + return this; + } + + /** + * Get toolCallId + * + * @return toolCallId The toolCallId of this {@link ToolChatMessage} instance. + */ + @Nonnull + public String getToolCallId() + { + return toolCallId; + } + + /** + * Set the toolCallId of this {@link ToolChatMessage} instance. + * + * @param toolCallId + * The toolCallId of this {@link ToolChatMessage} + */ + public void setToolCallId( @Nonnull final String toolCallId ) + { + this.toolCallId = toolCallId; + } + + /** + * Set the content of this {@link ToolChatMessage} instance and return the same instance. + * + * @param content + * The content of this {@link ToolChatMessage} + * @return The same instance of this {@link ToolChatMessage} class + */ + @Nonnull + public ToolChatMessage content( @Nonnull final ChatMessageContent content ) + { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link ToolChatMessage} instance. + */ + @Nonnull + public ChatMessageContent getContent() + { + return content; + } + + /** + * Set the content of this {@link ToolChatMessage} instance. + * + * @param content + * The content of this {@link ToolChatMessage} + */ + public void setContent( @Nonnull final ChatMessageContent content ) + { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link ToolChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ToolChatMessage} 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("ToolChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ToolChatMessage} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( role != null ) + declaredFields.put("role", role); + if( toolCallId != null ) + declaredFields.put("toolCallId", toolCallId); + if( content != null ) + declaredFields.put("content", content); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ToolChatMessage} 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 ToolChatMessage toolChatMessage = (ToolChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, toolChatMessage.cloudSdkCustomFields) + && Objects.equals(this.role, toolChatMessage.role) + && Objects.equals(this.toolCallId, toolChatMessage.toolCallId) + && Objects.equals(this.content, toolChatMessage.content); + } + + @Override + public int hashCode() + { + return Objects.hash(role, toolCallId, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class ToolChatMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java new file mode 100644 index 000000000..4c0723b27 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Configuration for translation module + */ + +@Beta // CHECKSTYLE:OFF +public class TranslationModuleConfig +// CHECKSTYLE:ON +{ + @JsonProperty( "input" ) + private SAPDocumentTranslationInput input; + + @JsonProperty( "output" ) + private SAPDocumentTranslationOutput output; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for TranslationModuleConfig. + */ + protected TranslationModuleConfig() + { + } + + /** + * Set the input of this {@link TranslationModuleConfig} instance and return the same instance. + * + * @param input + * The input of this {@link TranslationModuleConfig} + * @return The same instance of this {@link TranslationModuleConfig} class + */ + @Nonnull + public TranslationModuleConfig input( @Nullable final SAPDocumentTranslationInput input ) + { + this.input = input; + return this; + } + + /** + * Get input + * + * @return input The input of this {@link TranslationModuleConfig} instance. + */ + @Nonnull + public SAPDocumentTranslationInput getInput() + { + return input; + } + + /** + * Set the input of this {@link TranslationModuleConfig} instance. + * + * @param input + * The input of this {@link TranslationModuleConfig} + */ + public void setInput( @Nullable final SAPDocumentTranslationInput input ) + { + this.input = input; + } + + /** + * Set the output of this {@link TranslationModuleConfig} instance and return the same instance. + * + * @param output + * The output of this {@link TranslationModuleConfig} + * @return The same instance of this {@link TranslationModuleConfig} class + */ + @Nonnull + public TranslationModuleConfig output( @Nullable final SAPDocumentTranslationOutput output ) + { + this.output = output; + return this; + } + + /** + * Get output + * + * @return output The output of this {@link TranslationModuleConfig} instance. + */ + @Nonnull + public SAPDocumentTranslationOutput getOutput() + { + return output; + } + + /** + * Set the output of this {@link TranslationModuleConfig} instance. + * + * @param output + * The output of this {@link TranslationModuleConfig} + */ + public void setOutput( @Nullable final SAPDocumentTranslationOutput output ) + { + this.output = output; + } + + /** + * Get the names of the unrecognizable properties of the {@link TranslationModuleConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TranslationModuleConfig} 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("TranslationModuleConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link TranslationModuleConfig} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( input != null ) + declaredFields.put("input", input); + if( output != null ) + declaredFields.put("output", output); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link TranslationModuleConfig} 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 TranslationModuleConfig translationModuleConfig = (TranslationModuleConfig) o; + return Objects.equals(this.cloudSdkCustomFields, translationModuleConfig.cloudSdkCustomFields) + && Objects.equals(this.input, translationModuleConfig.input) + && Objects.equals(this.output, translationModuleConfig.output); + } + + @Override + public int hashCode() + { + return Objects.hash(input, output, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class TranslationModuleConfig {\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java new file mode 100644 index 000000000..3d99d01a6 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * UserChatMessage + */ + +@Beta // CHECKSTYLE:OFF +public class UserChatMessage implements ChatMessage +// CHECKSTYLE:ON +{ + @JsonProperty( "content" ) + private UserChatMessageContent content; + + /** + * Gets or Sets role + */ + public enum RoleEnum + { + /** + * The USER option of this UserChatMessage + */ + USER("user"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this UserChatMessage + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + RoleEnum( 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 UserChatMessage + */ + @JsonCreator + @Nonnull + public static RoleEnum fromValue( @Nonnull final String value ) + { + for( RoleEnum b : RoleEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "role" ) + private RoleEnum role; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for UserChatMessage. + */ + protected UserChatMessage() + { + } + + /** + * Set the content of this {@link UserChatMessage} instance and return the same instance. + * + * @param content + * The content of this {@link UserChatMessage} + * @return The same instance of this {@link UserChatMessage} class + */ + @Nonnull + public UserChatMessage content( @Nonnull final UserChatMessageContent content ) + { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link UserChatMessage} instance. + */ + @Nonnull + public UserChatMessageContent getContent() + { + return content; + } + + /** + * Set the content of this {@link UserChatMessage} instance. + * + * @param content + * The content of this {@link UserChatMessage} + */ + public void setContent( @Nonnull final UserChatMessageContent content ) + { + this.content = content; + } + + /** + * Set the role of this {@link UserChatMessage} instance and return the same instance. + * + * @param role + * The role of this {@link UserChatMessage} + * @return The same instance of this {@link UserChatMessage} class + */ + @Nonnull + public UserChatMessage role( @Nonnull final RoleEnum role ) + { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link UserChatMessage} instance. + */ + @Nonnull + public RoleEnum getRole() + { + return role; + } + + /** + * Set the role of this {@link UserChatMessage} instance. + * + * @param role + * The role of this {@link UserChatMessage} + */ + public void setRole( @Nonnull final RoleEnum role ) + { + this.role = role; + } + + /** + * Get the names of the unrecognizable properties of the {@link UserChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link UserChatMessage} 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("UserChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link UserChatMessage} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( content != null ) + declaredFields.put("content", content); + if( role != null ) + declaredFields.put("role", role); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link UserChatMessage} 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 UserChatMessage userChatMessage = (UserChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, userChatMessage.cloudSdkCustomFields) + && Objects.equals(this.content, userChatMessage.content) + && Objects.equals(this.role, userChatMessage.role); + } + + @Override + public int hashCode() + { + return Objects.hash(content, role, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class UserChatMessage {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java new file mode 100644 index 000000000..8ebd2fb23 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.List; + +import javax.annotation.Nonnull; + +import com.google.common.annotations.Beta; + +/** + * UserChatMessageContent + */ +@Beta +public interface UserChatMessageContent +{ + /** + * Helper class to create {@code List } that implements {@link UserChatMessageContent}. + */ + record ListOfUserChatMessageContentItems(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements UserChatMessageContent {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val + * the value to use + * @return a new instance of {@link ListOfUserChatMessageContentItems}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfUserChatMessageContentItems createListOfUserChatMessageContentItems( + @Nonnull final List val ) + { + return new ListOfUserChatMessageContentItems(val); + } + + /** + * Helper class to create {@code String } that implements {@link UserChatMessageContent}. + */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements UserChatMessageContent {} + + /** + * 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); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java new file mode 100644 index 000000000..d9730e468 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * UserChatMessageContentItem + */ + +@Beta // CHECKSTYLE:OFF +public class UserChatMessageContentItem +// CHECKSTYLE:ON +{ + /** + * Gets or Sets type + */ + public enum TypeEnum + { + /** + * The TEXT option of this UserChatMessageContentItem + */ + TEXT("text"), + + /** + * The IMAGE_URL option of this UserChatMessageContentItem + */ + IMAGE_URL("image_url"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this UserChatMessageContentItem + */ + 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 UserChatMessageContentItem + */ + @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( "text" ) + private String text; + + @JsonProperty( "image_url" ) + private ImageContentUrl imageUrl; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for UserChatMessageContentItem. + */ + protected UserChatMessageContentItem() + { + } + + /** + * Set the type of this {@link UserChatMessageContentItem} instance and return the same instance. + * + * @param type + * The type of this {@link UserChatMessageContentItem} + * @return The same instance of this {@link UserChatMessageContentItem} class + */ + @Nonnull + public UserChatMessageContentItem type( @Nonnull final TypeEnum type ) + { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link UserChatMessageContentItem} instance. + */ + @Nonnull + public TypeEnum getType() + { + return type; + } + + /** + * Set the type of this {@link UserChatMessageContentItem} instance. + * + * @param type + * The type of this {@link UserChatMessageContentItem} + */ + public void setType( @Nonnull final TypeEnum type ) + { + this.type = type; + } + + /** + * Set the text of this {@link UserChatMessageContentItem} instance and return the same instance. + * + * @param text + * The text of this {@link UserChatMessageContentItem} + * @return The same instance of this {@link UserChatMessageContentItem} class + */ + @Nonnull + public UserChatMessageContentItem text( @Nullable final String text ) + { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link UserChatMessageContentItem} instance. + */ + @Nonnull + public String getText() + { + return text; + } + + /** + * Set the text of this {@link UserChatMessageContentItem} instance. + * + * @param text + * The text of this {@link UserChatMessageContentItem} + */ + public void setText( @Nullable final String text ) + { + this.text = text; + } + + /** + * Set the imageUrl of this {@link UserChatMessageContentItem} instance and return the same instance. + * + * @param imageUrl + * The imageUrl of this {@link UserChatMessageContentItem} + * @return The same instance of this {@link UserChatMessageContentItem} class + */ + @Nonnull + public UserChatMessageContentItem imageUrl( @Nullable final ImageContentUrl imageUrl ) + { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * + * @return imageUrl The imageUrl of this {@link UserChatMessageContentItem} instance. + */ + @Nonnull + public ImageContentUrl getImageUrl() + { + return imageUrl; + } + + /** + * Set the imageUrl of this {@link UserChatMessageContentItem} instance. + * + * @param imageUrl + * The imageUrl of this {@link UserChatMessageContentItem} + */ + public void setImageUrl( @Nullable final ImageContentUrl imageUrl ) + { + this.imageUrl = imageUrl; + } + + /** + * Get the names of the unrecognizable properties of the {@link UserChatMessageContentItem}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link UserChatMessageContentItem} 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("UserChatMessageContentItem has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link UserChatMessageContentItem} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( type != null ) + declaredFields.put("type", type); + if( text != null ) + declaredFields.put("text", text); + if( imageUrl != null ) + declaredFields.put("imageUrl", imageUrl); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link UserChatMessageContentItem} 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 UserChatMessageContentItem userChatMessageContentItem = (UserChatMessageContentItem) o; + return Objects.equals(this.cloudSdkCustomFields, userChatMessageContentItem.cloudSdkCustomFields) + && Objects.equals(this.type, userChatMessageContentItem.type) + && Objects.equals(this.text, userChatMessageContentItem.text) + && Objects.equals(this.imageUrl, userChatMessageContentItem.imageUrl); + } + + @Override + public int hashCode() + { + return Objects.hash(type, text, imageUrl, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class UserChatMessageContentItem {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).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 "); + } + +} From 03933a07218a5d788ea52786ec53dbe1daba642d Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 16 Dec 2025 15:36:53 +0100 Subject: [PATCH 03/25] Remove ServerVariable.java and ServerConfiguration.java files --- .../services/openapi/apache/ApiClient.java | 78 +----------------- .../openapi/apache/ServerConfiguration.java | 80 ------------------- .../openapi/apache/ServerVariable.java | 40 ---------- 3 files changed, 1 insertion(+), 197 deletions(-) delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerConfiguration.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerVariable.java diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index e8669d7bb..6d88add6e 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -74,12 +74,6 @@ public class ApiClient protected Map defaultHeaderMap = new HashMap(); protected Map defaultCookieMap = new HashMap(); protected String basePath = "http://localhost"; - protected List servers = - new ArrayList( - Arrays - .asList(new ServerConfiguration("", "No description provided", new HashMap()))); - protected Integer serverIndex = 0; - protected Map serverVariables = null; protected boolean debugging = false; protected int connectionTimeout = 0; @@ -193,61 +187,6 @@ public String getBasePath() public ApiClient setBasePath( String basePath ) { this.basePath = basePath; - this.serverIndex = null; - return this; - } - - public List getServers() - { - return servers; - } - - /** - * Sets the server. - * - * @param servers - * a list of server configuration - * @return API client - */ - public ApiClient setServers( List servers ) - { - this.servers = servers; - return this; - } - - public Integer getServerIndex() - { - return serverIndex; - } - - /** - * Sets the server index. - * - * @param serverIndex - * server index - * @return API client - */ - public ApiClient setServerIndex( Integer serverIndex ) - { - this.serverIndex = serverIndex; - return this; - } - - public Map getServerVariables() - { - return serverVariables; - } - - /** - * Sets the server variables. - * - * @param serverVariables - * server variables - * @return API client - */ - public ApiClient setServerVariables( Map serverVariables ) - { - this.serverVariables = serverVariables; return this; } @@ -868,22 +807,7 @@ protected File prepareDownloadFile( String contentDisposition ) */ public String getBaseURL() { - String baseURL; - if( serverIndex != null ) { - if( serverIndex < 0 || serverIndex >= servers.size() ) { - throw new ArrayIndexOutOfBoundsException( - String - .format( - Locale.ROOT, - "Invalid index %d when selecting the host settings. Must be less than %d", - serverIndex, - servers.size())); - } - baseURL = servers.get(serverIndex).URL(serverVariables); - } else { - baseURL = basePath; - } - return baseURL; + return basePath; } /** diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerConfiguration.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerConfiguration.java deleted file mode 100644 index 3c91ed3b8..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerConfiguration.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.util.Map; - -/** - * Representing a Server configuration. - */ -public class ServerConfiguration -{ - public String URL; - public String description; - public Map variables; - - /** - * @param URL - * A URL to the target host. - * @param description - * A description of the host designated by the URL. - * @param variables - * A map between a variable name and its value. The value is used for substitution in the server's URL - * template. - */ - public ServerConfiguration( String URL, String description, Map variables ) - { - this.URL = URL; - this.description = description; - this.variables = variables; - } - - /** - * Format URL template using given variables. - * - * @param variables - * A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL( Map variables ) - { - String url = this.URL; - - // go through variables and replace placeholders - for( Map.Entry variable : this.variables.entrySet() ) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; - - if( variables != null && variables.containsKey(name) ) { - value = variables.get(name); - if( serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value) ) { - throw new IllegalArgumentException( - "The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replace("{" + name + "}", value); - } - return url; - } - - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() - { - return URL(null); - } -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerVariable.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerVariable.java deleted file mode 100644 index e2e4a3d06..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ServerVariable.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.util.HashSet; - -/** - * Representing a Server Variable for server URL template substitution. - */ -public class ServerVariable -{ - public String description; - public String defaultValue; - public HashSet enumValues = null; - - /** - * @param description - * A description for the server variable. - * @param defaultValue - * The default value to use for substitution. - * @param enumValues - * An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable( String description, String defaultValue, HashSet enumValues ) - { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } -} From 27cc01569ab5b5d49723ac5adb1972021cef04e6 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 16 Dec 2025 15:51:55 +0100 Subject: [PATCH 04/25] NoArgs ctor preserved but remove Configuration - no more shared client in *Api.java instances --- .../sample/api/OrchestrationConfigsApi.java | 3 +- .../apache/sample/api/PromptTemplatesApi.java | 3 +- .../services/openapi/apache/ApiClient.java | 1 - .../sdk/services/openapi/apache/BaseApi.java | 2 +- .../openapi/apache/Configuration.java | 67 ------------------- .../libraries/apache-httpclient/api.mustache | 3 +- 6 files changed, 4 insertions(+), 75 deletions(-) delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Configuration.java diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index a18aada96..1f3821ac3 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -29,7 +29,6 @@ import com.sap.cloud.sdk.services.openapi.apache.ApiClient; import com.sap.cloud.sdk.services.openapi.apache.ApiException; import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Configuration; import com.sap.cloud.sdk.services.openapi.apache.Pair; public class OrchestrationConfigsApi extends BaseApi @@ -37,7 +36,7 @@ public class OrchestrationConfigsApi extends BaseApi public OrchestrationConfigsApi() { - super(Configuration.getDefaultApiClient()); + super(new ApiClient()); } public OrchestrationConfigsApi( ApiClient apiClient ) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 4fb3e9f73..7c900c005 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -31,7 +31,6 @@ import com.sap.cloud.sdk.services.openapi.apache.ApiClient; import com.sap.cloud.sdk.services.openapi.apache.ApiException; import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Configuration; import com.sap.cloud.sdk.services.openapi.apache.Pair; public class PromptTemplatesApi extends BaseApi @@ -39,7 +38,7 @@ public class PromptTemplatesApi extends BaseApi public PromptTemplatesApi() { - super(Configuration.getDefaultApiClient()); + super(new ApiClient()); } public PromptTemplatesApi( ApiClient apiClient ) diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 6d88add6e..7100e2f81 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -32,7 +32,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.regex.Matcher; diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java index 7203f9e7f..c7d71c121 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java @@ -24,7 +24,7 @@ public abstract class BaseApi public BaseApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public BaseApi( ApiClient apiClient ) diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Configuration.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Configuration.java deleted file mode 100644 index 8978044d7..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Configuration.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Supplier; - -public class Configuration -{ - public static final String VERSION = "0.0.1"; - - private static final AtomicReference defaultApiClient = new AtomicReference<>(); - private static volatile Supplier apiClientFactory = ApiClient::new; - - /** - * Get the default API client, which would be used when creating API instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() - { - ApiClient client = defaultApiClient.get(); - if( client == null ) { - client = defaultApiClient.updateAndGet(val -> { - if( val != null ) { // changed by another thread - return val; - } - return apiClientFactory.get(); - }); - } - return client; - } - - /** - * Set the default API client, which would be used when creating API instances without providing an API client. - * - * @param apiClient - * API client - */ - public static void setDefaultApiClient( ApiClient apiClient ) - { - defaultApiClient.set(apiClient); - } - - /** - * set the callback used to create new ApiClient objects - */ - public static void setApiClientFactory( Supplier factory ) - { - apiClientFactory = Objects.requireNonNull(factory); - } - - private Configuration() - { - } -} diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index becb08a14..675ec08c3 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.BaseApi; -import {{invokerPackage}}.Configuration; {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -35,7 +34,7 @@ import java.util.StringJoiner; public class {{classname}} extends BaseApi { public {{classname}}() { - super(Configuration.getDefaultApiClient()); + super(new ApiClient()); } public {{classname}}(ApiClient apiClient) { From 112360dba4c0780d7c3652471210c1b4f920fd6b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 16 Dec 2025 17:09:07 +0100 Subject: [PATCH 05/25] Remove apache specific date classes addition. Reuse existing class in apiclient package --- .../services/openapi/apache/ApiClient.java | 4 +- .../openapi/apache/RFC3339DateFormat.java | 61 ---------- .../apache/RFC3339InstantDeserializer.java | 108 ------------------ .../openapi/apache/RFC3339JavaTimeModule.java | 40 ------- .../services/openapi/apache/StringUtil.java | 91 --------------- 5 files changed, 2 insertions(+), 302 deletions(-) delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339DateFormat.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339InstantDeserializer.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339JavaTimeModule.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/StringUtil.java diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 7100e2f81..d94e12cf6 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -67,6 +67,7 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.sap.cloud.sdk.services.openapi.apache.auth.Authentication; +import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; public class ApiClient { @@ -100,7 +101,6 @@ public ApiClient( CloseableHttpClient httpClient ) objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); objectMapper.registerModule(new JavaTimeModule()); - objectMapper.registerModule(new RFC3339JavaTimeModule()); objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -540,7 +540,7 @@ public String selectHeaderAccept( String[] accepts ) return accept; } } - return StringUtil.join(accepts, ","); + return String.join(",", accepts); } /** diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339DateFormat.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339DateFormat.java deleted file mode 100644 index 8d841d0bd..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339DateFormat.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -public class RFC3339DateFormat extends DateFormat -{ - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); - - public RFC3339DateFormat() - { - this.calendar = new GregorianCalendar(); - this.numberFormat = new DecimalFormat(); - } - - @Override - public Date parse( String source ) - { - return parse(source, new ParsePosition(0)); - } - - @Override - public Date parse( String source, ParsePosition pos ) - { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format( Date date, StringBuffer toAppendTo, FieldPosition fieldPosition ) - { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() - { - return super.clone(); - } -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339InstantDeserializer.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339InstantDeserializer.java deleted file mode 100644 index ae5560a88..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339InstantDeserializer.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.io.IOException; -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.Temporal; -import java.time.temporal.TemporalAccessor; -import java.util.function.BiFunction; -import java.util.function.Function; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; -import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; - -public class RFC3339InstantDeserializer extends InstantDeserializer -{ - private static final long serialVersionUID = 1L; - private final static boolean DEFAULT_NORMALIZE_ZONE_ID = - JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); - private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS = - JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); - - public static final RFC3339InstantDeserializer INSTANT = - new RFC3339InstantDeserializer<>( - Instant.class, - DateTimeFormatter.ISO_INSTANT, - Instant::from, - a -> Instant.ofEpochMilli(a.value), - a -> Instant.ofEpochSecond(a.integer, a.fraction), - null, - true, // yes, replace zero offset with Z - DEFAULT_NORMALIZE_ZONE_ID, - DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); - - public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = - new RFC3339InstantDeserializer<>( - OffsetDateTime.class, - DateTimeFormatter.ISO_OFFSET_DATE_TIME, - OffsetDateTime::from, - a -> OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId), - a -> OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId), - ( - d, - z ) -> (d.isEqual(OffsetDateTime.MIN) || d.isEqual(OffsetDateTime.MAX) - ? d - : d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()))), - true, // yes, replace zero offset with Z - DEFAULT_NORMALIZE_ZONE_ID, - DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); - - public static final RFC3339InstantDeserializer ZONED_DATE_TIME = - new RFC3339InstantDeserializer<>( - ZonedDateTime.class, - DateTimeFormatter.ISO_ZONED_DATE_TIME, - ZonedDateTime::from, - a -> ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId), - a -> ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId), - ZonedDateTime::withZoneSameInstant, - false, // keep zero offset and Z separate since zones explicitly supported - DEFAULT_NORMALIZE_ZONE_ID, - DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); - - protected RFC3339InstantDeserializer( - Class supportedType, - DateTimeFormatter formatter, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust, - boolean replaceZeroOffsetAsZ, - boolean normalizeZoneId, - boolean readNumericStringsAsTimestamp ) - { - super( - supportedType, - formatter, - parsedToValue, - fromMilliseconds, - fromNanoseconds, - adjust, - replaceZeroOffsetAsZ, - normalizeZoneId, - readNumericStringsAsTimestamp); - } - - @Override - protected T _fromString( JsonParser p, DeserializationContext ctxt, String string0 ) - throws IOException - { - return super._fromString(p, ctxt, string0.replace(' ', 'T')); - } -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339JavaTimeModule.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339JavaTimeModule.java deleted file mode 100644 index ce882de8c..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/RFC3339JavaTimeModule.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZonedDateTime; - -import com.fasterxml.jackson.databind.module.SimpleModule; - -public class RFC3339JavaTimeModule extends SimpleModule -{ - private static final long serialVersionUID = 1L; - - public RFC3339JavaTimeModule() - { - super("RFC3339JavaTimeModule"); - } - - @Override - public void setupModule( SetupContext context ) - { - super.setupModule(context); - - addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); - addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); - addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); - } - -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/StringUtil.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/StringUtil.java deleted file mode 100644 index 8fe49ac89..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/StringUtil.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.util.Collection; -import java.util.Iterator; - -public class StringUtil -{ - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array - * The array - * @param value - * The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase( String[] array, String value ) - { - for( String str : array ) { - if( value == null && str == null ) { - return true; - } - if( value != null && value.equalsIgnoreCase(str) ) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday if one of those libraries is - * added as dependency. - *

- * - * @param array - * The array of strings - * @param separator - * The separator - * @return the resulting string - */ - public static String join( String[] array, String separator ) - { - int len = array.length; - if( len == 0 ) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for( int i = 1; i < len; i++ ) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list - * The list of strings - * @param separator - * The separator - * @return the resulting string - */ - public static String join( Collection list, String separator ) - { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if( iterator.hasNext() ) { - out.append(iterator.next()); - } - while( iterator.hasNext() ) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} From a9e609bd1988ca2b6764df0801ed0d6dad75d5cb Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 16 Dec 2025 17:48:03 +0100 Subject: [PATCH 06/25] Pair - Simplify and improve code quality --- .../sdk/services/openapi/apache/Pair.java | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java index c7e9a9711..1ab38e5f7 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java @@ -12,29 +12,15 @@ package com.sap.cloud.sdk.services.openapi.apache; -public class Pair -{ - private final String name; - private final String value; - - public Pair( String name, String value ) - { - this.name = isValidString(name) ? name : ""; - this.value = isValidString(value) ? value : ""; - } +import javax.annotation.Nonnull; - public String getName() - { - return this.name; - } +import lombok.Value; - public String getValue() - { - return this.value; - } - - private static boolean isValidString( String arg ) - { - return arg != null; - } +@Value +public class Pair +{ + @Nonnull + String name; + @Nonnull + String value; } From 2f684c6ede6e28e2accb9a29e9f62762f2416724 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Wed, 17 Dec 2025 13:14:52 +0100 Subject: [PATCH 07/25] Remove `Authentication` classes and `authNames` from `ApiClient.invokeAPI` --- .../sample/api/OrchestrationConfigsApi.java | 24 ------ .../apache/sample/api/PromptTemplatesApi.java | 30 ------- .../services/openapi/apache/ApiClient.java | 62 +------------ .../openapi/apache/auth/ApiKeyAuth.java | 86 ------------------- .../openapi/apache/auth/Authentication.java | 33 ------- .../openapi/apache/auth/HttpBasicAuth.java | 59 ------------- .../openapi/apache/auth/HttpBearerAuth.java | 80 ----------------- .../libraries/apache-httpclient/api.mustache | 6 -- 8 files changed, 1 insertion(+), 379 deletions(-) delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/ApiKeyAuth.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/Authentication.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBasicAuth.java delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBearerAuth.java diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 1f3821ac3..ed8719b9d 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -116,8 +116,6 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -135,7 +133,6 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -216,8 +213,6 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -235,7 +230,6 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -316,8 +310,6 @@ public File exportOrchestrationConfig( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -334,7 +326,6 @@ public File exportOrchestrationConfig( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -427,8 +418,6 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -446,7 +435,6 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -517,8 +505,6 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( final String[] localVarContentTypes = { "multipart/form-data" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -536,7 +522,6 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -665,8 +650,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -684,7 +667,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -799,8 +781,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -818,7 +798,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -849,8 +828,6 @@ public T invokeAPI( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - return apiClient .invokeAPI( localVarPath, @@ -864,7 +841,6 @@ public T invokeAPI( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, returnType); } } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 7c900c005..b46743945 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -130,8 +130,6 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -148,7 +146,6 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -238,8 +235,6 @@ public PromptTemplateDeleteResponse deletePromptTemplate( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -257,7 +252,6 @@ public PromptTemplateDeleteResponse deletePromptTemplate( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -347,8 +341,6 @@ public File exportPromptTemplate( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -365,7 +357,6 @@ public File exportPromptTemplate( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -455,8 +446,6 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -473,7 +462,6 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -552,8 +540,6 @@ public PromptTemplatePostResponse importPromptTemplate( final String[] localVarContentTypes = { "multipart/form-data" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -570,7 +556,6 @@ public PromptTemplatePostResponse importPromptTemplate( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -690,8 +675,6 @@ public PromptTemplateListResponse listPromptTemplateHistory( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -708,7 +691,6 @@ public PromptTemplateListResponse listPromptTemplateHistory( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -824,8 +806,6 @@ public PromptTemplateListResponse listPromptTemplates( }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { }; @@ -842,7 +822,6 @@ public PromptTemplateListResponse listPromptTemplates( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -949,8 +928,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -968,7 +945,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -1103,8 +1079,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() { @@ -1122,7 +1096,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType); } @@ -1151,8 +1124,6 @@ public T invokeAPI( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] {}; - return apiClient .invokeAPI( localVarPath, @@ -1166,7 +1137,6 @@ public T invokeAPI( localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, returnType); } } diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index d94e12cf6..3b3152621 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -66,7 +65,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.sap.cloud.sdk.services.openapi.apache.auth.Authentication; import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; public class ApiClient @@ -81,8 +79,6 @@ public class ApiClient protected ObjectMapper objectMapper; protected String tempFolderPath = null; - protected Map authentications; - protected ThreadLocal lastStatusCode = new ThreadLocal<>(); protected ThreadLocal>> lastResponseHeaders = new ThreadLocal<>(); @@ -108,11 +104,6 @@ public ApiClient( CloseableHttpClient httpClient ) // Set default User-Agent. setUserAgent("OpenAPI-Generator/0.0.1/java"); - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - this.httpClient = httpClient; } @@ -211,28 +202,6 @@ public Map> getResponseHeaders() return lastResponseHeaders.get(); } - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication - */ - public Map getAuthentications() - { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName - * The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication( String authName ) - { - return authentications.get(authName); - } - /** * The path of temporary folder used to store downloaded files from endpoints with file response. The default value * is null, i.e. using the system's default temporary folder. @@ -964,8 +933,6 @@ protected T processResponse( ClassicHttpResponse response, TypeReference * The request's Accept header * @param contentType * The request's Content-Type header - * @param authNames - * The authentications to apply * @param returnType * Return type * @return The response body in type of string @@ -984,7 +951,6 @@ public T invokeAPI( Map formParams, String accept, String contentType, - String[] authNames, TypeReference returnType ) throws ApiException { @@ -992,7 +958,7 @@ public T invokeAPI( throw new ApiException("Cannot have body and form params"); } - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + // updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); @@ -1044,30 +1010,4 @@ public T invokeAPI( throw new ApiException(e); } } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames - * The authentications to apply - * @param queryParams - * Query parameters - * @param headerParams - * Header parameters - * @param cookieParams - * Cookie parameters - */ - protected void updateParamsForAuth( - String[] authNames, - List queryParams, - Map headerParams, - Map cookieParams ) - { - for( String authName : authNames ) { - Authentication auth = authentications.get(authName); - if( auth == null ) - throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams, cookieParams); - } - } } diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/ApiKeyAuth.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/ApiKeyAuth.java deleted file mode 100644 index 87f4fe832..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/ApiKeyAuth.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache.auth; - -import java.util.List; -import java.util.Map; - -import com.sap.cloud.sdk.services.openapi.apache.Pair; - -public class ApiKeyAuth implements Authentication -{ - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth( String location, String paramName ) - { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() - { - return location; - } - - public String getParamName() - { - return paramName; - } - - public String getApiKey() - { - return apiKey; - } - - public void setApiKey( String apiKey ) - { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() - { - return apiKeyPrefix; - } - - public void setApiKeyPrefix( String apiKeyPrefix ) - { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public - void - applyToParams( List queryParams, Map headerParams, Map cookieParams ) - { - if( apiKey == null ) { - return; - } - String value; - if( apiKeyPrefix != null ) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if( "query".equals(location) ) { - queryParams.add(new Pair(paramName, value)); - } else if( "header".equals(location) ) { - headerParams.put(paramName, value); - } else if( "cookie".equals(location) ) { - cookieParams.put(paramName, value); - } - } -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/Authentication.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/Authentication.java deleted file mode 100644 index 92d1e48b2..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/Authentication.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache.auth; - -import java.util.List; -import java.util.Map; - -import com.sap.cloud.sdk.services.openapi.apache.Pair; - -public interface Authentication -{ - /** - * Apply authentication settings to header and query params. - * - * @param queryParams - * List of query parameters - * @param headerParams - * Map of header parameters - * @param cookieParams - * Map of cookie parameters - */ - void applyToParams( List queryParams, Map headerParams, Map cookieParams ); -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBasicAuth.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBasicAuth.java deleted file mode 100644 index fc48507f6..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBasicAuth.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache.auth; - -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.List; -import java.util.Map; - -import com.sap.cloud.sdk.services.openapi.apache.Pair; - -public class HttpBasicAuth implements Authentication -{ - private String username; - private String password; - - public String getUsername() - { - return username; - } - - public void setUsername( String username ) - { - this.username = username; - } - - public String getPassword() - { - return password; - } - - public void setPassword( String password ) - { - this.password = password; - } - - @Override - public - void - applyToParams( List queryParams, Map headerParams, Map cookieParams ) - { - if( username == null && password == null ) { - return; - } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams - .put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); - } -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBearerAuth.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBearerAuth.java deleted file mode 100644 index 886915d6e..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/auth/HttpBearerAuth.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache.auth; - -import java.util.List; -import java.util.Map; -import java.util.function.Supplier; - -import com.sap.cloud.sdk.services.openapi.apache.Pair; - -public class HttpBearerAuth implements Authentication -{ - private final String scheme; - private Supplier tokenSupplier; - - public HttpBearerAuth( String scheme ) - { - this.scheme = upperCaseBearer(scheme); - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() - { - return tokenSupplier.get(); - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken - * The bearer token to send in the Authorization header - */ - public void setBearerToken( String bearerToken ) - { - this.tokenSupplier = () -> bearerToken; - } - - /** - * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization - * header. - * - * @param tokenSupplier - * The supplier of bearer tokens to send in the Authorization header - */ - public void setBearerToken( Supplier tokenSupplier ) - { - this.tokenSupplier = tokenSupplier; - } - - @Override - public - void - applyToParams( List queryParams, Map headerParams, Map cookieParams ) - { - String bearerToken = tokenSupplier != null ? tokenSupplier.get() : null; - if( bearerToken == null ) { - return; - } - headerParams.put("Authorization", (scheme != null ? scheme + " " : "") + bearerToken); - } - - private static String upperCaseBearer( String scheme ) - { - return "bearer".equalsIgnoreCase(scheme) ? "Bearer" : scheme; - } -} diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 675ec08c3..a11140385 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -172,8 +172,6 @@ import java.util.StringJoiner; }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}} TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; return apiClient.invokeAPI( @@ -192,7 +190,6 @@ import java.util.StringJoiner; localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} ); } @@ -220,8 +217,6 @@ import java.util.StringJoiner; }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - return apiClient.invokeAPI( localVarPath, method, @@ -234,7 +229,6 @@ import java.util.StringJoiner; localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, returnType ); } From aa60080391d9f8ac1b68b2cd6b3cfb41f911959b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Wed, 17 Dec 2025 16:38:52 +0100 Subject: [PATCH 08/25] make unimported methods private and use ApacheHttpClient5Accessor --- .../services/openapi/apache/ApiClient.java | 87 ++++++++++--------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 3b3152621..9eb552c9e 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -36,6 +36,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import org.apache.hc.client5.http.cookie.BasicCookieStore; import org.apache.hc.client5.http.cookie.Cookie; import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; @@ -107,12 +109,18 @@ public ApiClient( CloseableHttpClient httpClient ) this.httpClient = httpClient; } + public ApiClient(Destination destination) { + this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient(destination)); + setBasePath(destination.asHttp().getUri().toString()); + } + public ApiClient() { - this(HttpClients.createDefault()); + this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient()); + // TODO: What about base path? } - public static DateFormat buildDefaultDateFormat() + private static DateFormat buildDefaultDateFormat() { return new RFC3339DateFormat(); } @@ -126,7 +134,7 @@ public static DateFormat buildDefaultDateFormat() * * @return Object mapper */ - public ObjectMapper getObjectMapper() + private ObjectMapper getObjectMapper() { return objectMapper; } @@ -138,13 +146,13 @@ public ObjectMapper getObjectMapper() * object mapper * @return API client */ - public ApiClient setObjectMapper( ObjectMapper objectMapper ) + private ApiClient setObjectMapper( ObjectMapper objectMapper ) { this.objectMapper = objectMapper; return this; } - public CloseableHttpClient getHttpClient() + private CloseableHttpClient getHttpClient() { return httpClient; } @@ -156,13 +164,13 @@ public CloseableHttpClient getHttpClient() * HTTP client * @return API client */ - public ApiClient setHttpClient( CloseableHttpClient httpClient ) + private ApiClient setHttpClient( CloseableHttpClient httpClient ) { this.httpClient = httpClient; return this; } - public String getBasePath() + private String getBasePath() { return basePath; } @@ -174,7 +182,7 @@ public String getBasePath() * base path * @return API client */ - public ApiClient setBasePath( String basePath ) + private ApiClient setBasePath( String basePath ) { this.basePath = basePath; return this; @@ -185,8 +193,8 @@ public ApiClient setBasePath( String basePath ) * * @return Status code */ - @Deprecated - public int getStatusCode() + @Deprecated // TODO: Do we keep deprecated methods? + private int getStatusCode() { return lastStatusCode.get(); } @@ -197,7 +205,7 @@ public int getStatusCode() * @return Response headers */ @Deprecated - public Map> getResponseHeaders() + private Map> getResponseHeaders() { return lastResponseHeaders.get(); } @@ -208,7 +216,7 @@ public Map> getResponseHeaders() * * @return Temp folder path */ - public String getTempFolderPath() + private String getTempFolderPath() { return tempFolderPath; } @@ -220,7 +228,7 @@ public String getTempFolderPath() * User agent * @return API client */ - public final ApiClient setUserAgent( String userAgent ) + private final ApiClient setUserAgent(String userAgent) { addDefaultHeader("User-Agent", userAgent); return this; @@ -233,7 +241,7 @@ public final ApiClient setUserAgent( String userAgent ) * Temp folder path * @return API client */ - public ApiClient setTempFolderPath( String tempFolderPath ) + private ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; return this; @@ -248,7 +256,7 @@ public ApiClient setTempFolderPath( String tempFolderPath ) * The header's value * @return API client */ - public final ApiClient addDefaultHeader( String key, String value ) + private final ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); return this; @@ -263,7 +271,7 @@ public final ApiClient addDefaultHeader( String key, String value ) * The cookie's value * @return API client */ - public ApiClient addDefaultCookie( String key, String value ) + private ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); return this; @@ -274,7 +282,7 @@ public ApiClient addDefaultCookie( String key, String value ) * * @return True if debugging is on */ - public boolean isDebugging() + private boolean isDebugging() { return debugging; } @@ -286,7 +294,7 @@ public boolean isDebugging() * To enable (true) or disable (false) debugging * @return API client */ - public ApiClient setDebugging( boolean debugging ) + private ApiClient setDebugging( boolean debugging ) { // TODO: implement debugging mode this.debugging = debugging; @@ -298,7 +306,7 @@ public ApiClient setDebugging( boolean debugging ) * * @return Connection timeout */ - public int getConnectTimeout() + private int getConnectTimeout() { return connectionTimeout; } @@ -311,7 +319,7 @@ public int getConnectTimeout() * Connection timeout in milliseconds * @return API client */ - public ApiClient setConnectTimeout( int connectionTimeout ) + private ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; return this; @@ -322,7 +330,7 @@ public ApiClient setConnectTimeout( int connectionTimeout ) * * @return Date format */ - public DateFormat getDateFormat() + private DateFormat getDateFormat() { return dateFormat; } @@ -334,7 +342,7 @@ public DateFormat getDateFormat() * Date format * @return API client */ - public ApiClient setDateFormat( DateFormat dateFormat ) + private ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; // Also set the date format for model (de)serialization with Date properties. @@ -349,7 +357,7 @@ public ApiClient setDateFormat( DateFormat dateFormat ) * String * @return Date */ - public Date parseDate( String str ) + private Date parseDate(String str) { try { return dateFormat.parse(str); @@ -366,7 +374,7 @@ public Date parseDate( String str ) * Date * @return Date in string format */ - public String formatDate( Date date ) + private String formatDate( Date date ) { return dateFormat.format(date); } @@ -435,7 +443,7 @@ public List parameterToPair( String name, Object value ) * The value of the parameter. * @return A list of {@code Pair} objects. */ - public List parameterToPairs( String collectionFormat, String name, Collection value ) + private List parameterToPairs( String collectionFormat, String name, Collection value ) { List params = new ArrayList(); @@ -484,7 +492,7 @@ public List parameterToPairs( String collectionFormat, String name, Collec * MIME * @return True if MIME type is boolean */ - public boolean isJsonMime( String mime ) + private boolean isJsonMime( String mime ) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); @@ -557,7 +565,7 @@ public String escapeString( String str ) * HTTP headers * @return a map of string array */ - protected Map> transformResponseHeaders( Header[] headers ) + private Map> transformResponseHeaders( Header[] headers ) { Map> headersMap = new HashMap<>(); for( Header header : headers ) { @@ -576,7 +584,7 @@ protected Map> transformResponseHeaders( Header[] headers ) /** * Parse content type object from header value */ - protected ContentType getContentType( String headerValue ) + private ContentType getContentType( String headerValue ) throws ApiException { try { @@ -590,7 +598,7 @@ protected ContentType getContentType( String headerValue ) /** * Get content type of a response or null if one was not provided */ - protected String getResponseMimeType( HttpResponse response ) + private String getResponseMimeType( HttpResponse response ) throws ApiException { Header contentTypeHeader = response.getFirstHeader("Content-Type"); @@ -613,7 +621,7 @@ protected String getResponseMimeType( HttpResponse response ) * @throws ApiException * API exception */ - public HttpEntity serialize( Object obj, Map formParams, ContentType contentType ) + private HttpEntity serialize( Object obj, Map formParams, ContentType contentType ) throws ApiException { String mimeType = contentType.getMimeType(); @@ -683,7 +691,7 @@ public HttpEntity serialize( Object obj, Map formParams, Content * IO exception */ @SuppressWarnings( "unchecked" ) - public T deserialize( ClassicHttpResponse response, TypeReference valueType ) + private T deserialize( ClassicHttpResponse response, TypeReference valueType ) throws ApiException, IOException, ParseException @@ -722,7 +730,7 @@ public T deserialize( ClassicHttpResponse response, TypeReference valueTy } } - protected File downloadFileFromResponse( ClassicHttpResponse response ) + private File downloadFileFromResponse( ClassicHttpResponse response ) throws IOException { Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); @@ -732,7 +740,7 @@ protected File downloadFileFromResponse( ClassicHttpResponse response ) return file; } - protected File prepareDownloadFile( String contentDisposition ) + private File prepareDownloadFile( String contentDisposition ) throws IOException { String filename = null; @@ -791,7 +799,7 @@ public String getBaseURL() * URL query string of the deep object parameters * @return The full URL */ - protected + private String buildUrl( String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject ) { @@ -843,17 +851,17 @@ public String getBaseURL() return url.toString(); } - protected boolean isSuccessfulStatus( int statusCode ) + private boolean isSuccessfulStatus( int statusCode ) { return statusCode >= 200 && statusCode < 300; } - protected boolean isBodyAllowed( String method ) + private boolean isBodyAllowed( String method ) { return bodyMethods.contains(method); } - protected Cookie buildCookie( String key, String value, URI uri ) + private Cookie buildCookie( String key, String value, URI uri ) { BasicClientCookie cookie = new BasicClientCookie(key, value); cookie.setDomain(uri.getHost()); @@ -871,7 +879,7 @@ protected Cookie buildCookie( String key, String value, URI uri ) * Return type * @return HttpClientResponseHandler instance */ - protected HttpClientResponseHandler createResponseHandler( TypeReference returnType ) + private HttpClientResponseHandler createResponseHandler( TypeReference returnType ) { return response -> { try { @@ -884,7 +892,7 @@ protected HttpClientResponseHandler createResponseHandler( TypeReference< }; } - protected T processResponse( ClassicHttpResponse response, TypeReference returnType ) + private T processResponse( ClassicHttpResponse response, TypeReference returnType ) throws ApiException, IOException, ParseException @@ -958,7 +966,6 @@ public T invokeAPI( throw new ApiException("Cannot have body and form params"); } - // updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); From 73ffecc0ed86b2cf73b35c8a6ac1f455bc31adda Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 18 Dec 2025 14:24:54 +0100 Subject: [PATCH 09/25] Remove invokeAPI methods in BaseApi and *Api.java - *Api.invoke method bugged and unused --- .../sample/api/OrchestrationConfigsApi.java | 43 ------ .../apache/sample/api/PromptTemplatesApi.java | 41 ----- .../services/openapi/apache/ApiClient.java | 22 +-- .../sdk/services/openapi/apache/BaseApi.java | 142 ------------------ .../libraries/apache-httpclient/api.mustache | 40 ----- 5 files changed, 11 insertions(+), 277 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index ed8719b9d..5c17a418b 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -800,47 +800,4 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( localVarContentType, localVarReturnType); } - - @Override - public T invokeAPI( - String url, - String method, - Object request, - TypeReference returnType, - Map additionalHeaders ) - throws ApiException - { - String localVarPath = url.replace(apiClient.getBaseURL(), ""); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - return apiClient - .invokeAPI( - localVarPath, - method, - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - request, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - returnType); - } } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index b46743945..7087f2fd7 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -1098,45 +1098,4 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( localVarContentType, localVarReturnType); } - - @Override - public T invokeAPI( - String url, - String method, - Object request, - TypeReference returnType, - Map additionalHeaders ) - throws ApiException - { - String localVarPath = url.replace(apiClient.getBaseURL(), ""); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - return apiClient - .invokeAPI( - localVarPath, - method, - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - request, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - returnType); - } } diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 9eb552c9e..b930b080c 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -36,14 +36,11 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import org.apache.hc.client5.http.cookie.BasicCookieStore; import org.apache.hc.client5.http.cookie.Cookie; import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; -import org.apache.hc.client5.http.impl.classic.HttpClients; import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.core5.http.ClassicHttpResponse; @@ -67,6 +64,8 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; public class ApiClient @@ -109,7 +108,8 @@ public ApiClient( CloseableHttpClient httpClient ) this.httpClient = httpClient; } - public ApiClient(Destination destination) { + public ApiClient( Destination destination ) + { this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient(destination)); setBasePath(destination.asHttp().getUri().toString()); } @@ -228,7 +228,7 @@ private String getTempFolderPath() * User agent * @return API client */ - private final ApiClient setUserAgent(String userAgent) + private final ApiClient setUserAgent( String userAgent ) { addDefaultHeader("User-Agent", userAgent); return this; @@ -241,7 +241,7 @@ private final ApiClient setUserAgent(String userAgent) * Temp folder path * @return API client */ - private ApiClient setTempFolderPath(String tempFolderPath) + private ApiClient setTempFolderPath( String tempFolderPath ) { this.tempFolderPath = tempFolderPath; return this; @@ -256,7 +256,7 @@ private ApiClient setTempFolderPath(String tempFolderPath) * The header's value * @return API client */ - private final ApiClient addDefaultHeader(String key, String value) + private final ApiClient addDefaultHeader( String key, String value ) { defaultHeaderMap.put(key, value); return this; @@ -271,7 +271,7 @@ private final ApiClient addDefaultHeader(String key, String value) * The cookie's value * @return API client */ - private ApiClient addDefaultCookie(String key, String value) + private ApiClient addDefaultCookie( String key, String value ) { defaultCookieMap.put(key, value); return this; @@ -319,7 +319,7 @@ private int getConnectTimeout() * Connection timeout in milliseconds * @return API client */ - private ApiClient setConnectTimeout(int connectionTimeout) + private ApiClient setConnectTimeout( int connectionTimeout ) { this.connectionTimeout = connectionTimeout; return this; @@ -342,7 +342,7 @@ private DateFormat getDateFormat() * Date format * @return API client */ - private ApiClient setDateFormat(DateFormat dateFormat) + private ApiClient setDateFormat( DateFormat dateFormat ) { this.dateFormat = dateFormat; // Also set the date format for model (de)serialization with Date properties. @@ -357,7 +357,7 @@ private ApiClient setDateFormat(DateFormat dateFormat) * String * @return Date */ - private Date parseDate(String str) + private Date parseDate( String str ) { try { return dateFormat.parse(str); diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java index c7d71c121..a215241da 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java @@ -12,11 +12,6 @@ package com.sap.cloud.sdk.services.openapi.apache; -import java.util.Collections; -import java.util.Map; - -import com.fasterxml.jackson.core.type.TypeReference; - public abstract class BaseApi { @@ -41,141 +36,4 @@ public void setApiClient( ApiClient apiClient ) { this.apiClient = apiClient; } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @throws ApiException - * if fails to make API call. - */ - public void invokeAPI( String url, String method ) - throws ApiException - { - invokeAPI(url, method, null, null, Collections.emptyMap()); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @param additionalHeaders - * Additional headers for the request. - * @throws ApiException - * if fails to make API call. - */ - public void invokeAPI( String url, String method, Map additionalHeaders ) - throws ApiException - { - invokeAPI(url, method, null, null, additionalHeaders); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @param request - * The request object. - * @throws ApiException - * if fails to make API call. - */ - public void invokeAPI( String url, String method, Object request ) - throws ApiException - { - invokeAPI(url, method, request, null, Collections.emptyMap()); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @param request - * The request object. - * @param additionalHeaders - * Additional headers for the request. - * @throws ApiException - * if fails to make API call. - */ - public void invokeAPI( String url, String method, Object request, Map additionalHeaders ) - throws ApiException - { - invokeAPI(url, method, request, null, additionalHeaders); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @param returnType - * The return type. - * @return The API response in the specified type. - * @throws ApiException - * if fails to make API call. - */ - public T invokeAPI( String url, String method, TypeReference returnType ) - throws ApiException - { - return invokeAPI(url, method, null, returnType, Collections.emptyMap()); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @param request - * The request object. - * @param returnType - * The return type. - * @return The API response in the specified type. - * @throws ApiException - * if fails to make API call. - */ - public T invokeAPI( String url, String method, Object request, TypeReference returnType ) - throws ApiException - { - return invokeAPI(url, method, request, returnType, Collections.emptyMap()); - } - - /** - * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. - * - * @param url - * The URL for the request, either full URL or only the path. - * @param method - * The HTTP method for the request. - * @param request - * The request object. - * @param returnType - * The return type. - * @param additionalHeaders - * Additional headers for the request. - * @return The API response in the specified type. - * @throws ApiException - * if fails to make API call. - */ - public abstract T invokeAPI( - String url, - String method, - Object request, - TypeReference returnType, - Map additionalHeaders ) - throws ApiException; } diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index a11140385..4bdb2d5cb 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -193,46 +193,6 @@ import java.util.StringJoiner; {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} ); } - - {{#-last}} - @Override - public T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException { - String localVarPath = url.replace(apiClient.getBaseURL(), ""); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - return apiClient.invokeAPI( - localVarPath, - method, - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - request, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - returnType - ); - } - {{/-last}} {{/operation}} } {{/operations}} \ No newline at end of file From f4358bc7de6bfbfec97aa0da4473bbeec3f3d874 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 22 Dec 2025 11:52:52 +0100 Subject: [PATCH 10/25] Refactoring ApiClient - Remove debugging, connectionTimeout, defaultHeaderMap, defaultCookieMap - add TODOs - public setBasePath - Remove addDefaultHeader, setUserAgent, --- .../sample/api/OrchestrationConfigsApi.java | 14 -- .../apache/sample/api/PromptTemplatesApi.java | 18 -- .../services/openapi/apache/ApiClient.java | 174 ++---------------- .../services/openapi/apache/ApiException.java | 1 + .../sdk/services/openapi/apache/Pair.java | 1 + .../libraries/apache-httpclient/api.mustache | 6 - 6 files changed, 16 insertions(+), 198 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 5c17a418b..22340bf5e 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -102,7 +102,6 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -129,7 +128,6 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -197,7 +195,6 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -226,7 +223,6 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -294,7 +290,6 @@ public File exportOrchestrationConfig( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -322,7 +317,6 @@ public File exportOrchestrationConfig( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -401,7 +395,6 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); @@ -431,7 +424,6 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -488,7 +480,6 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -518,7 +509,6 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -632,7 +622,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPair("include_spec", includeSpec)); @@ -663,7 +652,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -759,7 +747,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPair("scenario", scenario)); @@ -794,7 +781,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 7087f2fd7..c7cf63e9a 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -114,7 +114,6 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -142,7 +141,6 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -217,7 +215,6 @@ public PromptTemplateDeleteResponse deletePromptTemplate( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -248,7 +245,6 @@ public PromptTemplateDeleteResponse deletePromptTemplate( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -323,7 +319,6 @@ public File exportPromptTemplate( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -353,7 +348,6 @@ public File exportPromptTemplate( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -428,7 +422,6 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -458,7 +451,6 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -521,7 +513,6 @@ public PromptTemplatePostResponse importPromptTemplate( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -552,7 +543,6 @@ public PromptTemplatePostResponse importPromptTemplate( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -657,7 +647,6 @@ public PromptTemplateListResponse listPromptTemplateHistory( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) @@ -687,7 +676,6 @@ public PromptTemplateListResponse listPromptTemplateHistory( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -783,7 +771,6 @@ public PromptTemplateListResponse listPromptTemplates( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPair("scenario", scenario)); @@ -818,7 +805,6 @@ public PromptTemplateListResponse listPromptTemplates( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -911,7 +897,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPair("metadata", metadata)); @@ -941,7 +926,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, @@ -1062,7 +1046,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(apiClient.parameterToPair("metadata", metadata)); @@ -1092,7 +1075,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index b930b080c..f1d9190c1 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -16,7 +16,6 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; -import java.net.URI; import java.net.URLEncoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -36,12 +35,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.hc.client5.http.cookie.BasicCookieStore; -import org.apache.hc.client5.http.cookie.Cookie; import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; -import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.ContentType; @@ -70,13 +66,9 @@ public class ApiClient { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); protected String basePath = "http://localhost"; - protected boolean debugging = false; - protected int connectionTimeout = 0; - protected CloseableHttpClient httpClient; + protected final CloseableHttpClient httpClient; protected ObjectMapper objectMapper; protected String tempFolderPath = null; @@ -86,8 +78,9 @@ public class ApiClient protected DateFormat dateFormat; // Methods that can have a request body - protected static List bodyMethods = Arrays.asList("POST", "PUT", "DELETE", "PATCH"); + protected static final List BODY_METHODS = Arrays.asList("POST", "PUT", "DELETE", "PATCH"); + // TODO: static factory or public? public ApiClient( CloseableHttpClient httpClient ) { objectMapper = new ObjectMapper(); @@ -102,9 +95,6 @@ public ApiClient( CloseableHttpClient httpClient ) dateFormat = ApiClient.buildDefaultDateFormat(); - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/0.0.1/java"); - this.httpClient = httpClient; } @@ -117,7 +107,6 @@ public ApiClient( Destination destination ) public ApiClient() { this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient()); - // TODO: What about base path? } private static DateFormat buildDefaultDateFormat() @@ -134,7 +123,8 @@ private static DateFormat buildDefaultDateFormat() * * @return Object mapper */ - private ObjectMapper getObjectMapper() + // TODO: couples with Jackson if public + public ObjectMapper getObjectMapper() { return objectMapper; } @@ -146,7 +136,7 @@ private ObjectMapper getObjectMapper() * object mapper * @return API client */ - private ApiClient setObjectMapper( ObjectMapper objectMapper ) + public ApiClient setObjectMapper( ObjectMapper objectMapper ) { this.objectMapper = objectMapper; return this; @@ -157,19 +147,6 @@ private CloseableHttpClient getHttpClient() return httpClient; } - /** - * Sets the HTTP client. - * - * @param httpClient - * HTTP client - * @return API client - */ - private ApiClient setHttpClient( CloseableHttpClient httpClient ) - { - this.httpClient = httpClient; - return this; - } - private String getBasePath() { return basePath; @@ -182,7 +159,7 @@ private String getBasePath() * base path * @return API client */ - private ApiClient setBasePath( String basePath ) + public ApiClient setBasePath( String basePath ) { this.basePath = basePath; return this; @@ -193,6 +170,8 @@ private ApiClient setBasePath( String basePath ) * * @return Status code */ + // TODO: Find a better way to expose last response info + // TODO: custom response handler by user? @Deprecated // TODO: Do we keep deprecated methods? private int getStatusCode() { @@ -221,19 +200,6 @@ private String getTempFolderPath() return tempFolderPath; } - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent - * User agent - * @return API client - */ - private final ApiClient setUserAgent( String userAgent ) - { - addDefaultHeader("User-Agent", userAgent); - return this; - } - /** * Set temp folder path * @@ -247,84 +213,6 @@ private ApiClient setTempFolderPath( String tempFolderPath ) return this; } - /** - * Add a default header. - * - * @param key - * The header's key - * @param value - * The header's value - * @return API client - */ - private final ApiClient addDefaultHeader( String key, String value ) - { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key - * The cookie's key - * @param value - * The cookie's value - * @return API client - */ - private ApiClient addDefaultCookie( String key, String value ) - { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is on - */ - private boolean isDebugging() - { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging - * To enable (true) or disable (false) debugging - * @return API client - */ - private ApiClient setDebugging( boolean debugging ) - { - // TODO: implement debugging mode - this.debugging = debugging; - return this; - } - - /** - * Connect timeout (in milliseconds). - * - * @return Connection timeout - */ - private int getConnectTimeout() - { - return connectionTimeout; - } - - /** - * Set the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param connectionTimeout - * Connection timeout in milliseconds - * @return API client - */ - private ApiClient setConnectTimeout( int connectionTimeout ) - { - this.connectionTimeout = connectionTimeout; - return this; - } - /** * Get the date format used to parse/format date parameters. * @@ -335,6 +223,7 @@ private DateFormat getDateFormat() return dateFormat; } + // TODO: remove accessor or even get rid of the field /** * Set the date format used to parse/format date parameters. * @@ -443,6 +332,7 @@ public List parameterToPair( String name, Object value ) * The value of the parameter. * @return A list of {@code Pair} objects. */ + // TODO: check if this will even be used in api.mustache? private List parameterToPairs( String collectionFormat, String name, Collection value ) { List params = new ArrayList(); @@ -507,6 +397,7 @@ private boolean isJsonMime( String mime ) * @return The Accept header to use. If the given array is empty, null will be returned (not to set the Accept * header explicitly). */ + // TODO: have it static? public String selectHeaderAccept( String[] accepts ) { if( accepts.length == 0 ) { @@ -776,16 +667,6 @@ private File prepareDownloadFile( String contentDisposition ) return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } - /** - * Returns the URL of the client as defined by the server (if exists) or the base path. - * - * @return The URL for the client. - */ - public String getBaseURL() - { - return basePath; - } - /** * Build full URL by concatenating base URL, the given sub path and query parameters. * @@ -803,7 +684,7 @@ public String getBaseURL() String buildUrl( String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject ) { - String baseURL = getBaseURL(); + String baseURL = getBasePath(); final StringBuilder url = new StringBuilder(); url.append(baseURL).append(path); @@ -858,15 +739,7 @@ private boolean isSuccessfulStatus( int statusCode ) private boolean isBodyAllowed( String method ) { - return bodyMethods.contains(method); - } - - private Cookie buildCookie( String key, String value, URI uri ) - { - BasicClientCookie cookie = new BasicClientCookie(key, value); - cookie.setDomain(uri.getHost()); - cookie.setPath("/"); - return cookie; + return BODY_METHODS.contains(method); } /** @@ -933,8 +806,6 @@ private T processResponse( ClassicHttpResponse response, TypeReference re * The request body object - if it is not binary, otherwise null * @param headerParams * The header parameters - * @param cookieParams - * The cookie parameters * @param formParams * The form parameters * @param accept @@ -955,7 +826,6 @@ public T invokeAPI( String urlQueryDeepObject, Object body, Map headerParams, - Map cookieParams, Map formParams, String accept, String contentType, @@ -977,24 +847,8 @@ public T invokeAPI( for( Entry keyValue : headerParams.entrySet() ) { builder.addHeader(keyValue.getKey(), keyValue.getValue()); } - for( Map.Entry keyValue : defaultHeaderMap.entrySet() ) { - if( !headerParams.containsKey(keyValue.getKey()) ) { - builder.addHeader(keyValue.getKey(), keyValue.getValue()); - } - } - - BasicCookieStore store = new BasicCookieStore(); - for( Entry keyValue : cookieParams.entrySet() ) { - store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri())); - } - for( Entry keyValue : defaultCookieMap.entrySet() ) { - if( !cookieParams.containsKey(keyValue.getKey()) ) { - store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri())); - } - } HttpClientContext context = HttpClientContext.create(); - context.setCookieStore(store); ContentType contentTypeObj = getContentType(contentType); if( body != null || !formParams.isEmpty() ) { diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java index b8ab4534c..adfb0efc9 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; +// TODO: Swap with OpenApiRequestException public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java index 1ab38e5f7..c09df3b59 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java @@ -16,6 +16,7 @@ import lombok.Value; +//TODO: COnsider Map but comes with api.mustache changes @Value public class Pair { diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 4bdb2d5cb..1a1da4b3e 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -107,7 +107,6 @@ import java.util.StringJoiner; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); {{#queryParams}} @@ -154,10 +153,6 @@ import java.util.StringJoiner; localVarHeaderParams.putAll(additionalHeaders); - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); - {{/cookieParams}} - {{#formParams}}if ({{paramName}} != null) localVarFormParams.put("{{baseName}}", {{paramName}}); {{/formParams}} @@ -186,7 +181,6 @@ import java.util.StringJoiner; localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, - localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, From 3ce5400f241efc4f75fe44fc2ba4c0c95402b498 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 22 Dec 2025 17:14:43 +0100 Subject: [PATCH 11/25] Refactoring ApiClient - Make as manny methods static - Remove deprecated getStatusCode and getResponseHeaders - public parameterToPairs --- .../sample/api/OrchestrationConfigsApi.java | 40 +++++----- .../apache/sample/api/PromptTemplatesApi.java | 56 ++++++------- .../services/openapi/apache/ApiClient.java | 78 ++++--------------- .../libraries/apache-httpclient/api.mustache | 6 +- 4 files changed, 64 insertions(+), 116 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 22340bf5e..3ce8bfa59 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -110,10 +110,10 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -188,7 +188,7 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + ApiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -203,12 +203,12 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -283,7 +283,7 @@ public File exportOrchestrationConfig( "/registry/v2/orchestrationConfigs/{orchestrationConfigId}/export" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + ApiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -298,12 +298,12 @@ public File exportOrchestrationConfig( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/octet-stream", "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -388,7 +388,7 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + ApiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -404,12 +404,12 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -491,10 +491,10 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( localVarFormParams.put("file", _file); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "multipart/form-data" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -613,9 +613,9 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( // create path and map variables String localVarPath = "/registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history" - .replaceAll("\\{" + "scenario" + "\\}", apiClient.escapeString(apiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(apiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(apiClient.parameterToString(name))); + .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(apiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(apiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(apiClient.parameterToString(name))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -632,12 +632,12 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -761,12 +761,12 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index c7cf63e9a..864f71f3c 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -124,10 +124,10 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -208,7 +208,7 @@ public PromptTemplateDeleteResponse deletePromptTemplate( "/lm/promptTemplates/{promptTemplateId}" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -225,12 +225,12 @@ public PromptTemplateDeleteResponse deletePromptTemplate( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -312,7 +312,7 @@ public File exportPromptTemplate( "/lm/promptTemplates/{promptTemplateId}/export" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -329,12 +329,12 @@ public File exportPromptTemplate( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/octet-stream", "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -415,7 +415,7 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( "/lm/promptTemplates/{promptTemplateId}" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -432,12 +432,12 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -526,10 +526,10 @@ public PromptTemplatePostResponse importPromptTemplate( localVarFormParams.put("file", _file); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "multipart/form-data" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -638,9 +638,9 @@ public PromptTemplateListResponse listPromptTemplateHistory( // create path and map variables String localVarPath = "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history" - .replaceAll("\\{" + "scenario" + "\\}", apiClient.escapeString(apiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(apiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(apiClient.parameterToString(name))); + .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(apiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(apiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(apiClient.parameterToString(name))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -657,12 +657,12 @@ public PromptTemplateListResponse listPromptTemplateHistory( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -786,12 +786,12 @@ public PromptTemplateListResponse listPromptTemplates( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() { @@ -890,7 +890,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( "/lm/promptTemplates/{promptTemplateId}/substitution" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - apiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -908,10 +908,10 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() @@ -1037,9 +1037,9 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( // create path and map variables String localVarPath = "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution" - .replaceAll("\\{" + "scenario" + "\\}", apiClient.escapeString(apiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(apiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(apiClient.parameterToString(name))); + .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(apiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(apiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(apiClient.parameterToString(name))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -1057,10 +1057,10 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( localVarHeaderParams.putAll(additionalHeaders); final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); TypeReference localVarReturnType = new TypeReference() diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index f1d9190c1..4a8e80ba8 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -25,13 +25,13 @@ import java.nio.file.StandardCopyOption; import java.text.DateFormat; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -44,7 +44,6 @@ import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpEntity; import org.apache.hc.core5.http.HttpResponse; -import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.NameValuePair; import org.apache.hc.core5.http.ParseException; import org.apache.hc.core5.http.io.HttpClientResponseHandler; @@ -60,6 +59,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.google.common.annotations.Beta; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; @@ -72,13 +72,10 @@ public class ApiClient protected ObjectMapper objectMapper; protected String tempFolderPath = null; - protected ThreadLocal lastStatusCode = new ThreadLocal<>(); - protected ThreadLocal>> lastResponseHeaders = new ThreadLocal<>(); - protected DateFormat dateFormat; // Methods that can have a request body - protected static final List BODY_METHODS = Arrays.asList("POST", "PUT", "DELETE", "PATCH"); + protected static final Set BODY_METHODS = Set.of("POST", "PUT", "DELETE", "PATCH"); // TODO: static factory or public? public ApiClient( CloseableHttpClient httpClient ) @@ -114,21 +111,6 @@ private static DateFormat buildDefaultDateFormat() return new RFC3339DateFormat(); } - /** - * Returns the current object mapper used for JSON serialization/deserialization. - *

- * Note: If you make changes to the object mapper, remember to set it back via setObjectMapper in order - * to trigger HTTP client rebuilding. - *

- * - * @return Object mapper - */ - // TODO: couples with Jackson if public - public ObjectMapper getObjectMapper() - { - return objectMapper; - } - /** * Sets the object mapper. * @@ -136,17 +118,13 @@ public ObjectMapper getObjectMapper() * object mapper * @return API client */ + @Beta public ApiClient setObjectMapper( ObjectMapper objectMapper ) { this.objectMapper = objectMapper; return this; } - private CloseableHttpClient getHttpClient() - { - return httpClient; - } - private String getBasePath() { return basePath; @@ -165,30 +143,6 @@ public ApiClient setBasePath( String basePath ) return this; } - /** - * Gets the status code of the previous request - * - * @return Status code - */ - // TODO: Find a better way to expose last response info - // TODO: custom response handler by user? - @Deprecated // TODO: Do we keep deprecated methods? - private int getStatusCode() - { - return lastStatusCode.get(); - } - - /** - * Gets the response headers of the previous request - * - * @return Response headers - */ - @Deprecated - private Map> getResponseHeaders() - { - return lastResponseHeaders.get(); - } - /** * The path of temporary folder used to store downloaded files from endpoints with file response. The default value * is null, i.e. using the system's default temporary folder. @@ -332,8 +286,7 @@ public List parameterToPair( String name, Object value ) * The value of the parameter. * @return A list of {@code Pair} objects. */ - // TODO: check if this will even be used in api.mustache? - private List parameterToPairs( String collectionFormat, String name, Collection value ) + public List parameterToPairs( String collectionFormat, String name, Collection value ) { List params = new ArrayList(); @@ -382,7 +335,7 @@ private List parameterToPairs( String collectionFormat, String name, Colle * MIME * @return True if MIME type is boolean */ - private boolean isJsonMime( String mime ) + private static boolean isJsonMime( String mime ) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); @@ -398,7 +351,7 @@ private boolean isJsonMime( String mime ) * header explicitly). */ // TODO: have it static? - public String selectHeaderAccept( String[] accepts ) + public static String selectHeaderAccept( String[] accepts ) { if( accepts.length == 0 ) { return null; @@ -419,7 +372,7 @@ public String selectHeaderAccept( String[] accepts ) * The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, or matches "any", JSON will be used. */ - public String selectHeaderContentType( String[] contentTypes ) + public static String selectHeaderContentType( String[] contentTypes ) { if( contentTypes.length == 0 || contentTypes[0].equals("*/*") ) { return "application/json"; @@ -439,7 +392,7 @@ public String selectHeaderContentType( String[] contentTypes ) * String * @return Escaped string */ - public String escapeString( String str ) + public static String escapeString( String str ) { try { return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); @@ -456,7 +409,7 @@ public String escapeString( String str ) * HTTP headers * @return a map of string array */ - private Map> transformResponseHeaders( Header[] headers ) + private static Map> transformResponseHeaders( Header[] headers ) { Map> headersMap = new HashMap<>(); for( Header header : headers ) { @@ -732,12 +685,12 @@ private File prepareDownloadFile( String contentDisposition ) return url.toString(); } - private boolean isSuccessfulStatus( int statusCode ) + private static boolean isSuccessfulStatus( int statusCode ) { return statusCode >= 200 && statusCode < 300; } - private boolean isBodyAllowed( String method ) + private static boolean isBodyAllowed( String method ) { return BODY_METHODS.contains(method); } @@ -771,13 +724,7 @@ private T processResponse( ClassicHttpResponse response, TypeReference re ParseException { int statusCode = response.getCode(); - lastStatusCode.set(statusCode); - if( statusCode == HttpStatus.SC_NO_CONTENT ) { - return null; - } - Map> responseHeaders = transformResponseHeaders(response.getHeaders()); - lastResponseHeaders.set(responseHeaders); if( isSuccessfulStatus(statusCode) ) { return this.deserialize(response, returnType); @@ -818,6 +765,7 @@ private T processResponse( ClassicHttpResponse response, TypeReference re * @throws ApiException * API exception */ + @Beta public T invokeAPI( String path, String method, diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 1a1da4b3e..c402b20e8 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -100,7 +100,7 @@ import java.util.StringJoiner; {{/required}}{{/allParams}} // create path and map variables String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString(apiClient.parameterToString({{{paramName}}}))){{/pathParams}}; + .replaceAll("\\{" + "{{baseName}}" + "\\}", ApiClient.escapeString(apiClient.parameterToString({{{paramName}}}))){{/pathParams}}; StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -160,12 +160,12 @@ import java.util.StringJoiner; final String[] localVarAccepts = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); {{#returnType}} TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; From ad8a738edafb94d7004f1fea7d9a47eeec42bf85 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 22 Dec 2025 17:38:29 +0100 Subject: [PATCH 12/25] Fix dependency and warning --- datamodel/openapi/openapi-core/pom.xml | 4 ++++ .../sap/cloud/sdk/services/openapi/apache/ApiClient.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/datamodel/openapi/openapi-core/pom.xml b/datamodel/openapi/openapi-core/pom.xml index 46cacdeab..ce7787da4 100644 --- a/datamodel/openapi/openapi-core/pom.xml +++ b/datamodel/openapi/openapi-core/pom.xml @@ -70,6 +70,10 @@ com.fasterxml.jackson.core jackson-core + + com.google.guava + guava + org.projectlombok diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 4a8e80ba8..3fd5a372e 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -44,6 +44,7 @@ import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpEntity; import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.NameValuePair; import org.apache.hc.core5.http.ParseException; import org.apache.hc.core5.http.io.HttpClientResponseHandler; @@ -98,7 +99,7 @@ public ApiClient( CloseableHttpClient httpClient ) public ApiClient( Destination destination ) { this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient(destination)); - setBasePath(destination.asHttp().getUri().toString()); + this.basePath = destination.asHttp().getUri().toString(); } public ApiClient() @@ -724,6 +725,10 @@ private T processResponse( ClassicHttpResponse response, TypeReference re ParseException { int statusCode = response.getCode(); + if( statusCode == HttpStatus.SC_NO_CONTENT ) { + return null; + } + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); if( isSuccessfulStatus(statusCode) ) { From d8add74b90e0106f1a1cde5aadb34dc4da122f6c Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 22 Dec 2025 17:48:39 +0100 Subject: [PATCH 13/25] Remove method overloading per operation with additionalHeaders --- .../sample/api/OrchestrationConfigsApi.java | 229 ------------ .../apache/sample/api/PromptTemplatesApi.java | 329 ------------------ .../libraries/apache-httpclient/api.mustache | 29 -- 3 files changed, 587 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 3ce8bfa59..2782c4a9a 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -13,7 +13,6 @@ import java.io.File; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -60,30 +59,6 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( @javax.annotation.Nonnull OrchestrationConfigPostRequest orchestrationConfigPostRequest, @javax.annotation.Nullable String aiResourceGroup ) throws ApiException - { - return this - .createUpdateOrchestrationConfig(orchestrationConfigPostRequest, aiResourceGroup, Collections.emptyMap()); - } - - /** - * - * Create or update an orchestration config - * - * @param orchestrationConfigPostRequest - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return OrchestrationConfigPostResponse - * @throws ApiException - * if fails to make API call - */ - public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( - @javax.annotation.Nonnull OrchestrationConfigPostRequest orchestrationConfigPostRequest, - @javax.annotation.Nullable String aiResourceGroup, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = orchestrationConfigPostRequest; @@ -107,8 +82,6 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -150,29 +123,6 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @javax.annotation.Nonnull UUID orchestrationConfigId, @javax.annotation.Nullable String aiResourceGroup ) throws ApiException - { - return this.deleteOrchestrationConfig(orchestrationConfigId, aiResourceGroup, Collections.emptyMap()); - } - - /** - * - * Delete orchestration config - * - * @param orchestrationConfigId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return OrchestrationConfigDeleteResponse - * @throws ApiException - * if fails to make API call - */ - public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( - @javax.annotation.Nonnull UUID orchestrationConfigId, - @javax.annotation.Nullable String aiResourceGroup, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -200,8 +150,6 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -245,29 +193,6 @@ public File exportOrchestrationConfig( @javax.annotation.Nonnull UUID orchestrationConfigId, @javax.annotation.Nullable String aiResourceGroup ) throws ApiException - { - return this.exportOrchestrationConfig(orchestrationConfigId, aiResourceGroup, Collections.emptyMap()); - } - - /** - * - * Export orchestration config - * - * @param orchestrationConfigId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return File - * @throws ApiException - * if fails to make API call - */ - public File exportOrchestrationConfig( - @javax.annotation.Nonnull UUID orchestrationConfigId, - @javax.annotation.Nullable String aiResourceGroup, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -295,8 +220,6 @@ public File exportOrchestrationConfig( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/octet-stream", "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -342,37 +265,6 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable Boolean resolveTemplateRef ) throws ApiException - { - return this - .getOrchestrationConfigByUuid( - orchestrationConfigId, - aiResourceGroup, - resolveTemplateRef, - Collections.emptyMap()); - } - - /** - * - * Get orchestration config by UUID - * - * @param orchestrationConfigId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param resolveTemplateRef - * (optional, default to false) - * @param additionalHeaders - * additionalHeaders for this call - * @return OrchestrationConfigGetResponse - * @throws ApiException - * if fails to make API call - */ - public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( - @javax.annotation.Nonnull UUID orchestrationConfigId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable Boolean resolveTemplateRef, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -401,8 +293,6 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -446,29 +336,6 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable File _file ) throws ApiException - { - return this.importOrchestrationConfig(aiResourceGroup, _file, Collections.emptyMap()); - } - - /** - * - * Import orchestration config - * - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param _file - * (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return OrchestrationConfigPostResponse - * @throws ApiException - * if fails to make API call - */ - public OrchestrationConfigPostResponse importOrchestrationConfig( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable File _file, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -485,8 +352,6 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - if( _file != null ) localVarFormParams.put("file", _file); @@ -543,49 +408,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( @javax.annotation.Nullable Boolean includeSpec, @javax.annotation.Nullable Boolean resolveTemplateRef ) throws ApiException - { - return this - .listOrchestrationConfigHistory( - scenario, - version, - name, - aiResourceGroup, - includeSpec, - resolveTemplateRef, - Collections.emptyMap()); - } - - /** - * - * List orchestration config history - * - * @param scenario - * (required) - * @param version - * (required) - * @param name - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param includeSpec - * (optional, default to false) - * @param resolveTemplateRef - * (optional, default to false) - * @param additionalHeaders - * additionalHeaders for this call - * @return OrchestrationConfigListResponse - * @throws ApiException - * if fails to make API call - */ - public OrchestrationConfigListResponse listOrchestrationConfigHistory( - @javax.annotation.Nonnull String scenario, - @javax.annotation.Nonnull String version, - @javax.annotation.Nonnull String name, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable Boolean includeSpec, - @javax.annotation.Nullable Boolean resolveTemplateRef, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -629,8 +451,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -689,53 +509,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( @javax.annotation.Nullable Boolean includeSpec, @javax.annotation.Nullable Boolean resolveTemplateRef ) throws ApiException - { - return this - .listOrchestrationConfigs( - aiResourceGroup, - scenario, - name, - version, - retrieve, - includeSpec, - resolveTemplateRef, - Collections.emptyMap()); - } - - /** - * - * List orchestration configs - * - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param scenario - * (optional) - * @param name - * (optional) - * @param version - * (optional) - * @param retrieve - * (optional, default to both) - * @param includeSpec - * (optional, default to false) - * @param resolveTemplateRef - * (optional, default to false) - * @param additionalHeaders - * additionalHeaders for this call - * @return OrchestrationConfigListResponse - * @throws ApiException - * if fails to make API call - */ - public OrchestrationConfigListResponse listOrchestrationConfigs( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String scenario, - @javax.annotation.Nullable String name, - @javax.annotation.Nullable String version, - @javax.annotation.Nullable String retrieve, - @javax.annotation.Nullable Boolean includeSpec, - @javax.annotation.Nullable Boolean resolveTemplateRef, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -758,8 +531,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 864f71f3c..352844864 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -13,7 +13,6 @@ import java.io.File; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,37 +64,6 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) throws ApiException - { - return this - .createUpdatePromptTemplate( - promptTemplatePostRequest, - aiResourceGroup, - aiResourceGroupScope, - Collections.emptyMap()); - } - - /** - * - * Create or update a prompt template - * - * @param promptTemplatePostRequest - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplatePostResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplatePostResponse createUpdatePromptTemplate( - @javax.annotation.Nonnull PromptTemplatePostRequest promptTemplatePostRequest, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = promptTemplatePostRequest; @@ -121,8 +89,6 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -166,33 +132,6 @@ public PromptTemplateDeleteResponse deletePromptTemplate( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) throws ApiException - { - return this - .deletePromptTemplate(promptTemplateId, aiResourceGroup, aiResourceGroupScope, Collections.emptyMap()); - } - - /** - * - * Delete prompt template - * - * @param promptTemplateId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplateDeleteResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplateDeleteResponse deletePromptTemplate( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -222,8 +161,6 @@ public PromptTemplateDeleteResponse deletePromptTemplate( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -270,33 +207,6 @@ public File exportPromptTemplate( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) throws ApiException - { - return this - .exportPromptTemplate(promptTemplateId, aiResourceGroup, aiResourceGroupScope, Collections.emptyMap()); - } - - /** - * - * Export prompt template - * - * @param promptTemplateId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return File - * @throws ApiException - * if fails to make API call - */ - public File exportPromptTemplate( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -326,8 +236,6 @@ public File exportPromptTemplate( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/octet-stream", "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -373,33 +281,6 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) throws ApiException - { - return this - .getPromptTemplateByUuid(promptTemplateId, aiResourceGroup, aiResourceGroupScope, Collections.emptyMap()); - } - - /** - * - * Get prompt template by UUID - * - * @param promptTemplateId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplateGetResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplateGetResponse getPromptTemplateByUuid( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -429,8 +310,6 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -476,32 +355,6 @@ public PromptTemplatePostResponse importPromptTemplate( @javax.annotation.Nullable String aiResourceGroupScope, @javax.annotation.Nullable File _file ) throws ApiException - { - return this.importPromptTemplate(aiResourceGroup, aiResourceGroupScope, _file, Collections.emptyMap()); - } - - /** - * - * Import prompt template - * - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param _file - * (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplatePostResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplatePostResponse importPromptTemplate( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable File _file, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -520,8 +373,6 @@ public PromptTemplatePostResponse importPromptTemplate( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - if( _file != null ) localVarFormParams.put("file", _file); @@ -574,45 +425,6 @@ public PromptTemplateListResponse listPromptTemplateHistory( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) throws ApiException - { - return this - .listPromptTemplateHistory( - scenario, - version, - name, - aiResourceGroup, - aiResourceGroupScope, - Collections.emptyMap()); - } - - /** - * - * List prompt template history - * - * @param scenario - * (required) - * @param version - * (required) - * @param name - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplateListResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplateListResponse listPromptTemplateHistory( - @javax.annotation.Nonnull String scenario, - @javax.annotation.Nonnull String version, - @javax.annotation.Nonnull String name, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -654,8 +466,6 @@ public PromptTemplateListResponse listPromptTemplateHistory( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -713,53 +523,6 @@ public PromptTemplateListResponse listPromptTemplates( @javax.annotation.Nullable String retrieve, @javax.annotation.Nullable Boolean includeSpec ) throws ApiException - { - return this - .listPromptTemplates( - aiResourceGroup, - aiResourceGroupScope, - scenario, - name, - version, - retrieve, - includeSpec, - Collections.emptyMap()); - } - - /** - * - * List prompt templates - * - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param scenario - * (optional) - * @param name - * (optional) - * @param version - * (optional) - * @param retrieve - * (optional, default to both) - * @param includeSpec - * (optional, default to false) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplateListResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplateListResponse listPromptTemplates( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable String scenario, - @javax.annotation.Nullable String name, - @javax.annotation.Nullable String version, - @javax.annotation.Nullable String retrieve, - @javax.annotation.Nullable Boolean includeSpec, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = null; @@ -783,8 +546,6 @@ public PromptTemplateListResponse listPromptTemplates( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -836,45 +597,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( @javax.annotation.Nullable Boolean metadata, @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) throws ApiException - { - return this - .parsePromptTemplateById( - promptTemplateId, - aiResourceGroup, - aiResourceGroupScope, - metadata, - promptTemplateSubstitutionRequest, - Collections.emptyMap()); - } - - /** - * - * Parse prompt template by ID - * - * @param promptTemplateId - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param metadata - * (optional, default to false) - * @param promptTemplateSubstitutionRequest - * (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplateSubstitutionResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplateSubstitutionResponse parsePromptTemplateById( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable Boolean metadata, - @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = promptTemplateSubstitutionRequest; @@ -905,8 +627,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -963,53 +683,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( @javax.annotation.Nullable Boolean metadata, @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) throws ApiException - { - return this - .parsePromptTemplateByNameVersion( - scenario, - version, - name, - aiResourceGroup, - aiResourceGroupScope, - metadata, - promptTemplateSubstitutionRequest, - Collections.emptyMap()); - } - - /** - * - * Parse prompt template by name and version - * - * @param scenario - * (required) - * @param version - * (required) - * @param name - * (required) - * @param aiResourceGroup - * Specify a resource group id to use (optional) - * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) - * @param metadata - * (optional, default to false) - * @param promptTemplateSubstitutionRequest - * (optional) - * @param additionalHeaders - * additionalHeaders for this call - * @return PromptTemplateSubstitutionResponse - * @throws ApiException - * if fails to make API call - */ - public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( - @javax.annotation.Nonnull String scenario, - @javax.annotation.Nonnull String version, - @javax.annotation.Nonnull String name, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable Boolean metadata, - @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest, - Map additionalHeaders ) - throws ApiException { Object localVarPostBody = promptTemplateSubstitutionRequest; @@ -1054,8 +727,6 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( if( aiResourceGroupScope != null ) localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); - localVarHeaderParams.putAll(additionalHeaders); - final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index c402b20e8..0d439895c 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -64,33 +64,6 @@ import java.util.StringJoiner; @Deprecated {{/isDeprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}return {{/returnType}}this.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}Collections.emptyMap()); - } - - - /** - * {{summary}} - * {{notes}} - {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} - {{/allParams}} - * @param additionalHeaders additionalHeaders for this call - {{#returnType}} - * @return {{returnType}} - {{/returnType}} - * @throws ApiException if fails to make API call - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}, {{/allParams}}Map additionalHeaders) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -151,8 +124,6 @@ import java.util.StringJoiner; localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/headerParams}} - localVarHeaderParams.putAll(additionalHeaders); - {{#formParams}}if ({{paramName}} != null) localVarFormParams.put("{{baseName}}", {{paramName}}); {{/formParams}} From 0c0176ce5137861eeb5fe66f3f56ad6e4b4e7b50 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 22 Dec 2025 18:34:44 +0100 Subject: [PATCH 14/25] Extract response handling out of ApiClient into ApiClientResponseHandler --- .../services/openapi/apache/ApiClient.java | 224 +----------- .../apache/ApiClientResponseHandler.java | 318 ++++++++++++++++++ 2 files changed, 326 insertions(+), 216 deletions(-) create mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 3fd5a372e..76cfe924a 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -15,56 +15,47 @@ import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; import java.net.URLEncoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; import java.text.DateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; import org.apache.hc.client5.http.protocol.HttpClientContext; -import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.ContentType; -import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpEntity; -import org.apache.hc.core5.http.HttpResponse; -import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.NameValuePair; -import org.apache.hc.core5.http.ParseException; import org.apache.hc.core5.http.io.HttpClientResponseHandler; import org.apache.hc.core5.http.io.entity.ByteArrayEntity; -import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.io.entity.FileEntity; import org.apache.hc.core5.http.io.entity.StringEntity; import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; import org.apache.hc.core5.http.message.BasicNameValuePair; -import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.common.annotations.Beta; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; +import static com.sap.cloud.sdk.services.openapi.apache.ApiClientResponseHandler.isJsonMime; + public class ApiClient { protected String basePath = "http://localhost"; @@ -328,20 +319,6 @@ public List parameterToPairs( String collectionFormat, String name, Collec return params; } - /** - * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 - * APPLICATION/JSON application/vnd.company+json - * - * @param mime - * MIME - * @return True if MIME type is boolean - */ - private static boolean isJsonMime( String mime ) - { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - /** * Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; * otherwise use all of them (joining into a string) @@ -351,7 +328,6 @@ private static boolean isJsonMime( String mime ) * @return The Accept header to use. If the given array is empty, null will be returned (not to set the Accept * header explicitly). */ - // TODO: have it static? public static String selectHeaderAccept( String[] accepts ) { if( accepts.length == 0 ) { @@ -403,29 +379,6 @@ public static String escapeString( String str ) } } - /** - * Transforms response headers into map. - * - * @param headers - * HTTP headers - * @return a map of string array - */ - private static Map> transformResponseHeaders( Header[] headers ) - { - Map> headersMap = new HashMap<>(); - for( Header header : headers ) { - List valuesList = headersMap.get(header.getName()); - if( valuesList != null ) { - valuesList.add(header.getValue()); - } else { - valuesList = new ArrayList<>(); - valuesList.add(header.getValue()); - headersMap.put(header.getName(), valuesList); - } - } - return headersMap; - } - /** * Parse content type object from header value */ @@ -440,19 +393,6 @@ private ContentType getContentType( String headerValue ) } } - /** - * Get content type of a response or null if one was not provided - */ - private String getResponseMimeType( HttpResponse response ) - throws ApiException - { - Header contentTypeHeader = response.getFirstHeader("Content-Type"); - if( contentTypeHeader != null ) { - return getContentType(contentTypeHeader.getValue()).getMimeType(); - } - return null; - } - /** * Serialize the given Java object into string according the given Content-Type (only JSON is supported for now). * @@ -520,107 +460,6 @@ private HttpEntity serialize( Object obj, Map formParams, Conten } } - /** - * Deserialize response body to Java object according to the Content-Type. - * - * @param - * Type - * @param response - * Response - * @param valueType - * Return type - * @return Deserialized object - * @throws ApiException - * API exception - * @throws IOException - * IO exception - */ - @SuppressWarnings( "unchecked" ) - private T deserialize( ClassicHttpResponse response, TypeReference valueType ) - throws ApiException, - IOException, - ParseException - { - if( valueType == null ) { - return null; - } - HttpEntity entity = response.getEntity(); - Type valueRawType = valueType.getType(); - if( valueRawType.equals(byte[].class) ) { - return (T) EntityUtils.toByteArray(entity); - } else if( valueRawType.equals(File.class) ) { - return (T) downloadFileFromResponse(response); - } - String mimeType = getResponseMimeType(response); - if( mimeType == null || isJsonMime(mimeType) ) { - // Assume json if no mime type - // convert input stream to string - String content = EntityUtils.toString(entity); - - if( "".equals(content) ) { // returns null for empty body - return null; - } - - return objectMapper.readValue(content, valueType); - } else if( mimeType.toLowerCase().startsWith("text/") ) { - // convert input stream to string - return (T) EntityUtils.toString(entity); - } else { - Map> responseHeaders = transformResponseHeaders(response.getHeaders()); - throw new ApiException( - "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", - response.getCode(), - responseHeaders, - EntityUtils.toString(entity)); - } - } - - private File downloadFileFromResponse( ClassicHttpResponse response ) - throws IOException - { - Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); - String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); - File file = prepareDownloadFile(contentDisposition); - Files.copy(response.getEntity().getContent(), file.toPath(), StandardCopyOption.REPLACE_EXISTING); - return file; - } - - private File prepareDownloadFile( String contentDisposition ) - throws IOException - { - String filename = null; - if( contentDisposition != null && !"".equals(contentDisposition) ) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if( matcher.find() ) - filename = matcher.group(1); - } - - String prefix; - String suffix = null; - if( filename == null ) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf('.'); - if( pos == -1 ) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if( prefix.length() < 3 ) - prefix = "download-"; - } - - if( tempFolderPath == null ) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - /** * Build full URL by concatenating base URL, the given sub path and query parameters. * @@ -686,59 +525,11 @@ private File prepareDownloadFile( String contentDisposition ) return url.toString(); } - private static boolean isSuccessfulStatus( int statusCode ) - { - return statusCode >= 200 && statusCode < 300; - } - private static boolean isBodyAllowed( String method ) { return BODY_METHODS.contains(method); } - /** - * Creates an HttpClientResponseHandler for processing HTTP responses. Wraps checked exceptions (ParseException, - * ApiException) as IOException since the handler interface only allows IOException to be thrown. - * - * @param - * Type - * @param returnType - * Return type - * @return HttpClientResponseHandler instance - */ - private HttpClientResponseHandler createResponseHandler( TypeReference returnType ) - { - return response -> { - try { - return processResponse(response, returnType); - } - catch( ParseException | ApiException e ) { - // Wrap exceptions as IOException since handler can only throw IOException - throw new IOException("Failed to process response: " + e.getMessage(), e); - } - }; - } - - private T processResponse( ClassicHttpResponse response, TypeReference returnType ) - throws ApiException, - IOException, - ParseException - { - int statusCode = response.getCode(); - if( statusCode == HttpStatus.SC_NO_CONTENT ) { - return null; - } - - Map> responseHeaders = transformResponseHeaders(response.getHeaders()); - - if( isSuccessfulStatus(statusCode) ) { - return this.deserialize(response, returnType); - } else { - String message = EntityUtils.toString(response.getEntity()); - throw new ApiException(message, statusCode, responseHeaders, message); - } - } - /** * Invoke API by sending HTTP request with the given options. * @@ -817,7 +608,8 @@ public T invokeAPI( } try { - HttpClientResponseHandler responseHandler = createResponseHandler(returnType); + HttpClientResponseHandler responseHandler = + new ApiClientResponseHandler<>(objectMapper, tempFolderPath, returnType); return httpClient.execute(builder.build(), context, responseHandler); } catch( IOException e ) { diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java new file mode 100644 index 000000000..d66b8d9f6 --- /dev/null +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java @@ -0,0 +1,318 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * The version of the OpenAPI document: 0.0.1 + * + * + * 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.cloud.sdk.services.openapi.apache; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.charset.UnsupportedCharsetException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.hc.core5.http.ClassicHttpResponse; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.HttpException; +import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.HttpClientResponseHandler; +import org.apache.hc.core5.http.io.entity.EntityUtils; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * Handles HTTP response processing for API client operations. This class encapsulates response deserialization, error + * handling, and file download functionality. + * + * @param + * The type of object to deserialize the response into + */ +class ApiClientResponseHandler implements HttpClientResponseHandler +{ + private final ObjectMapper objectMapper; + private final String tempFolderPath; + private final TypeReference returnType; + + /** + * Creates a new response handler with the specified configuration. + * + * @param objectMapper + * The Jackson ObjectMapper for JSON deserialization + * @param tempFolderPath + * The temporary folder path for file downloads (null for system default) + * @param returnType + * The type reference for response deserialization + */ + ApiClientResponseHandler( ObjectMapper objectMapper, String tempFolderPath, TypeReference returnType ) + { + this.objectMapper = objectMapper; + this.tempFolderPath = tempFolderPath; + this.returnType = returnType; + } + + @Override + public T handleResponse( ClassicHttpResponse response ) + throws HttpException, + IOException + { + try { + return processResponse(response); + } + catch( ParseException | ApiException e ) { + // Wrap exceptions as IOException since handler can only throw IOException + throw new IOException("Failed to process response: " + e.getMessage(), e); + } + } + + /** + * Processes the HTTP response and returns the deserialized result. + * + * @param response + * The HTTP response to process + * @return The deserialized response object + * @throws ApiException + * if the response indicates an error + * @throws IOException + * if an I/O error occurs + * @throws ParseException + * if response parsing fails + */ + private T processResponse( ClassicHttpResponse response ) + throws ApiException, + IOException, + ParseException + { + int statusCode = response.getCode(); + if( statusCode == HttpStatus.SC_NO_CONTENT ) { + return null; + } + + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + + if( isSuccessfulStatus(statusCode) ) { + return deserialize(response); + } else { + String message = EntityUtils.toString(response.getEntity()); + throw new ApiException(message, statusCode, responseHeaders, message); + } + } + + /** + * Deserializes the response body to a Java object according to the Content-Type. + * + * @param response + * The HTTP response to deserialize + * @return The deserialized object + * @throws ApiException + * if deserialization fails + * @throws IOException + * if an I/O error occurs + * @throws ParseException + * if response parsing fails + */ + @SuppressWarnings( "unchecked" ) + private T deserialize( ClassicHttpResponse response ) + throws ApiException, + IOException, + ParseException + { + if( returnType == null ) { + return null; + } + HttpEntity entity = response.getEntity(); + Type valueRawType = returnType.getType(); + if( valueRawType.equals(byte[].class) ) { + return (T) EntityUtils.toByteArray(entity); + } else if( valueRawType.equals(File.class) ) { + return (T) downloadFileFromResponse(response); + } + String mimeType = getResponseMimeType(response); + if( mimeType == null || isJsonMime(mimeType) ) { + // Assume json if no mime type + // convert input stream to string + String content = EntityUtils.toString(entity); + + if( "".equals(content) ) { // returns null for empty body + return null; + } + + return objectMapper.readValue(content, returnType); + } else if( mimeType.toLowerCase().startsWith("text/") ) { + // convert input stream to string + return (T) EntityUtils.toString(entity); + } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + throw new ApiException( + "Deserialization for content type '" + mimeType + "' not supported for type '" + returnType + "'", + response.getCode(), + responseHeaders, + EntityUtils.toString(entity)); + } + } + + /** + * Downloads a file from the HTTP response. + * + * @param response + * The HTTP response containing the file + * @return The downloaded file + * @throws IOException + * if an I/O error occurs during download + */ + private File downloadFileFromResponse( ClassicHttpResponse response ) + throws IOException + { + Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); + String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); + File file = prepareDownloadFile(contentDisposition); + Files.copy(response.getEntity().getContent(), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } + + /** + * Prepares a temporary file for downloading response content. + * + * @param contentDisposition + * The Content-Disposition header value (may be null) + * @return A temporary file for storing the download + * @throws IOException + * if the temporary file cannot be created + */ + private File prepareDownloadFile( String contentDisposition ) + throws IOException + { + String filename = null; + if( contentDisposition != null && !"".equals(contentDisposition) ) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if( matcher.find() ) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if( filename == null ) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if( pos == -1 ) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if( prefix.length() < 3 ) + prefix = "download-"; + } + + if( tempFolderPath == null ) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * Gets the MIME type from the response Content-Type header. + * + * @param response + * The HTTP response + * @return The MIME type, or null if not present + * @throws ApiException + * if the content type cannot be parsed + */ + private String getResponseMimeType( HttpResponse response ) + throws ApiException + { + Header contentTypeHeader = response.getFirstHeader("Content-Type"); + if( contentTypeHeader != null ) { + return parseContentType(contentTypeHeader.getValue()).getMimeType(); + } + return null; + } + + /** + * Parses a Content-Type header value into a ContentType object. + * + * @param headerValue + * The Content-Type header value + * @return The parsed ContentType object + * @throws ApiException + * if the content type cannot be parsed + */ + private static ContentType parseContentType( String headerValue ) + throws ApiException + { + try { + return ContentType.parse(headerValue); + } + catch( UnsupportedCharsetException e ) { + throw new ApiException("Could not parse content type " + headerValue); + } + } + + /** + * Transforms response headers into map. + * + * @param headers + * HTTP headers + * @return a map of string array + */ + private static Map> transformResponseHeaders( Header[] headers ) + { + Map> headersMap = new HashMap<>(); + for( Header header : headers ) { + List valuesList = headersMap.get(header.getName()); + if( valuesList != null ) { + valuesList.add(header.getValue()); + } else { + valuesList = new ArrayList<>(); + valuesList.add(header.getValue()); + headersMap.put(header.getName(), valuesList); + } + } + return headersMap; + } + + private static boolean isSuccessfulStatus( int statusCode ) + { + return statusCode >= 200 && statusCode < 300; + } + + /** + * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 + * APPLICATION/JSON application/vnd.company+json + * + * @param mime + * MIME + * @return True if MIME type is boolean + */ + static boolean isJsonMime( String mime ) + { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + +} From db04109da69315680f1cf614ed3ba9962964130c Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 23 Dec 2025 16:40:21 +0100 Subject: [PATCH 15/25] Make static ApiClient ctors - Make as many methods static - rename ApiClientResponseHandler to DefaultApiResponseHandler - finish up ApiClient todos --- .../sample/api/OrchestrationConfigsApi.java | 45 ++-- .../apache/sample/api/PromptTemplatesApi.java | 71 ++++--- .../services/openapi/apache/ApiClient.java | 193 +++++------------- .../sdk/services/openapi/apache/BaseApi.java | 25 +-- ...er.java => DefaultApiResponseHandler.java} | 4 +- .../libraries/apache-httpclient/api.mustache | 13 +- 6 files changed, 126 insertions(+), 225 deletions(-) rename datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/{ApiClientResponseHandler.java => DefaultApiResponseHandler.java} (98%) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 2782c4a9a..979568f88 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -35,7 +35,6 @@ public class OrchestrationConfigsApi extends BaseApi public OrchestrationConfigsApi() { - super(new ApiClient()); } public OrchestrationConfigsApi( ApiClient apiClient ) @@ -80,7 +79,7 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -138,7 +137,7 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -148,7 +147,7 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -208,7 +207,7 @@ public File exportOrchestrationConfig( "/registry/v2/orchestrationConfigs/{orchestrationConfigId}/export" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -218,7 +217,7 @@ public File exportOrchestrationConfig( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); final String[] localVarAccepts = { "application/octet-stream", "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -280,7 +279,7 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(orchestrationConfigId))); + ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -289,9 +288,9 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); + localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -350,7 +349,7 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( _file != null ) localVarFormParams.put("file", _file); @@ -435,9 +434,9 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( // create path and map variables String localVarPath = "/registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history" - .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(apiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(apiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(apiClient.parameterToString(name))); + .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -446,10 +445,10 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPair("include_spec", includeSpec)); - localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); + localVarQueryParams.addAll(ApiClient.parameterToPair("include_spec", includeSpec)); + localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -522,14 +521,14 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPair("scenario", scenario)); - localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); - localVarQueryParams.addAll(apiClient.parameterToPair("version", version)); - localVarQueryParams.addAll(apiClient.parameterToPair("retrieve", retrieve)); - localVarQueryParams.addAll(apiClient.parameterToPair("include_spec", includeSpec)); - localVarQueryParams.addAll(apiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); + localVarQueryParams.addAll(ApiClient.parameterToPair("scenario", scenario)); + localVarQueryParams.addAll(ApiClient.parameterToPair("name", name)); + localVarQueryParams.addAll(ApiClient.parameterToPair("version", version)); + localVarQueryParams.addAll(ApiClient.parameterToPair("retrieve", retrieve)); + localVarQueryParams.addAll(ApiClient.parameterToPair("include_spec", includeSpec)); + localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 352844864..384434f49 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -37,7 +37,6 @@ public class PromptTemplatesApi extends BaseApi public PromptTemplatesApi() { - super(new ApiClient()); } public PromptTemplatesApi( ApiClient apiClient ) @@ -85,9 +84,9 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -147,7 +146,7 @@ public PromptTemplateDeleteResponse deletePromptTemplate( "/lm/promptTemplates/{promptTemplateId}" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -157,9 +156,9 @@ public PromptTemplateDeleteResponse deletePromptTemplate( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -222,7 +221,7 @@ public File exportPromptTemplate( "/lm/promptTemplates/{promptTemplateId}/export" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -232,9 +231,9 @@ public File exportPromptTemplate( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/octet-stream", "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -296,7 +295,7 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( "/lm/promptTemplates/{promptTemplateId}" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -306,9 +305,9 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -369,9 +368,9 @@ public PromptTemplatePostResponse importPromptTemplate( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); if( _file != null ) localVarFormParams.put("file", _file); @@ -450,9 +449,9 @@ public PromptTemplateListResponse listPromptTemplateHistory( // create path and map variables String localVarPath = "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history" - .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(apiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(apiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(apiClient.parameterToString(name))); + .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -462,9 +461,9 @@ public PromptTemplateListResponse listPromptTemplateHistory( Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -536,15 +535,15 @@ public PromptTemplateListResponse listPromptTemplates( Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPair("scenario", scenario)); - localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); - localVarQueryParams.addAll(apiClient.parameterToPair("version", version)); - localVarQueryParams.addAll(apiClient.parameterToPair("retrieve", retrieve)); - localVarQueryParams.addAll(apiClient.parameterToPair("includeSpec", includeSpec)); + localVarQueryParams.addAll(ApiClient.parameterToPair("scenario", scenario)); + localVarQueryParams.addAll(ApiClient.parameterToPair("name", name)); + localVarQueryParams.addAll(ApiClient.parameterToPair("version", version)); + localVarQueryParams.addAll(ApiClient.parameterToPair("retrieve", retrieve)); + localVarQueryParams.addAll(ApiClient.parameterToPair("includeSpec", includeSpec)); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -612,7 +611,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( "/lm/promptTemplates/{promptTemplateId}/substitution" .replaceAll( "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(apiClient.parameterToString(promptTemplateId))); + ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -621,11 +620,11 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPair("metadata", metadata)); + localVarQueryParams.addAll(ApiClient.parameterToPair("metadata", metadata)); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); @@ -710,9 +709,9 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( // create path and map variables String localVarPath = "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution" - .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(apiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(apiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(apiClient.parameterToString(name))); + .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) + .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) + .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -721,11 +720,11 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPair("metadata", metadata)); + localVarQueryParams.addAll(ApiClient.parameterToPair("metadata", metadata)); if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", apiClient.parameterToString(aiResourceGroupScope)); + localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 76cfe924a..e4e053afb 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -12,6 +12,10 @@ package com.sap.cloud.sdk.services.openapi.apache; +import static com.sap.cloud.sdk.services.openapi.apache.DefaultApiResponseHandler.isJsonMime; +import static lombok.AccessLevel.NONE; +import static lombok.AccessLevel.PRIVATE; + import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -28,6 +32,9 @@ import java.util.Map.Entry; import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; @@ -54,152 +61,64 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; -import static com.sap.cloud.sdk.services.openapi.apache.ApiClientResponseHandler.isJsonMime; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Value; +import lombok.With; +@Value +@Getter( NONE ) +@AllArgsConstructor( access = PRIVATE ) public class ApiClient { - protected String basePath = "http://localhost"; - - protected final CloseableHttpClient httpClient; - protected ObjectMapper objectMapper; - protected String tempFolderPath = null; - - protected DateFormat dateFormat; - - // Methods that can have a request body - protected static final Set BODY_METHODS = Set.of("POST", "PUT", "DELETE", "PATCH"); - - // TODO: static factory or public? - public ApiClient( CloseableHttpClient httpClient ) - { - objectMapper = new ObjectMapper(); - objectMapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - objectMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); - objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - objectMapper.registerModule(new JavaTimeModule()); - objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); - - dateFormat = ApiClient.buildDefaultDateFormat(); - - this.httpClient = httpClient; - } - - public ApiClient( Destination destination ) - { - this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient(destination)); - this.basePath = destination.asHttp().getUri().toString(); - } - - public ApiClient() - { - this((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient()); - } + @Nonnull + CloseableHttpClient httpClient; - private static DateFormat buildDefaultDateFormat() - { - return new RFC3339DateFormat(); - } + @With + @Nonnull + String basePath; - /** - * Sets the object mapper. - * - * @param objectMapper - * object mapper - * @return API client - */ - @Beta - public ApiClient setObjectMapper( ObjectMapper objectMapper ) - { - this.objectMapper = objectMapper; - return this; - } + @With( onMethod_ = @Beta ) + @Nonnull + ObjectMapper objectMapper; - private String getBasePath() - { - return basePath; - } + @With + @Nullable + String tempFolderPath; - /** - * Sets the base path. - * - * @param basePath - * base path - * @return API client - */ - public ApiClient setBasePath( String basePath ) - { - this.basePath = basePath; - return this; - } + // Methods that can have a request body + private static final Set BODY_METHODS = Set.of("POST", "PUT", "DELETE", "PATCH"); + private static final String DEFAULT_BASE_PATH = "http://localhost"; - /** - * The path of temporary folder used to store downloaded files from endpoints with file response. The default value - * is null, i.e. using the system's default temporary folder. - * - * @return Temp folder path - */ - private String getTempFolderPath() + public static ApiClient fromHttpClient( @Nonnull final CloseableHttpClient httpClient ) { - return tempFolderPath; + return new ApiClient(httpClient, DEFAULT_BASE_PATH, createDefaultObjectMapper(), null); } - /** - * Set temp folder path - * - * @param tempFolderPath - * Temp folder path - * @return API client - */ - private ApiClient setTempFolderPath( String tempFolderPath ) + public static ApiClient create( @Nonnull final Destination destination ) { - this.tempFolderPath = tempFolderPath; - return this; - } + return fromHttpClient((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient(destination)) + .withBasePath(destination.asHttp().getUri().toString()); - /** - * Get the date format used to parse/format date parameters. - * - * @return Date format - */ - private DateFormat getDateFormat() - { - return dateFormat; } - // TODO: remove accessor or even get rid of the field - /** - * Set the date format used to parse/format date parameters. - * - * @param dateFormat - * Date format - * @return API client - */ - private ApiClient setDateFormat( DateFormat dateFormat ) + public static ApiClient create() { - this.dateFormat = dateFormat; - // Also set the date format for model (de)serialization with Date properties. - this.objectMapper.setDateFormat((DateFormat) dateFormat.clone()); - return this; + return fromHttpClient((CloseableHttpClient) ApacheHttpClient5Accessor.getHttpClient()); } - /** - * Parse the given string into Date object. - * - * @param str - * String - * @return Date - */ - private Date parseDate( String str ) + private static ObjectMapper createDefaultObjectMapper() { - try { - return dateFormat.parse(str); - } - catch( java.text.ParseException e ) { - throw new RuntimeException(e); - } + var jackson = new ObjectMapper(); + jackson.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); + jackson.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + jackson.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + jackson.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + jackson.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + jackson.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + jackson.registerModule(new JavaTimeModule()); + jackson.setDateFormat(new RFC3339DateFormat()); + return jackson; } /** @@ -209,9 +128,9 @@ private Date parseDate( String str ) * Date * @return Date in string format */ - private String formatDate( Date date ) + private static String formatDate( Date date ) { - return dateFormat.format(date); + return new RFC3339DateFormat().format(date); } /** @@ -221,7 +140,7 @@ private String formatDate( Date date ) * Object * @return Object in string format */ - public String parameterToString( Object param ) + public static String parameterToString( Object param ) { if( param == null ) { return ""; @@ -243,7 +162,7 @@ public String parameterToString( Object param ) /** * Formats the specified query parameter to a list containing a single {@code Pair} object. - * + *

* Note that {@code value} must not be a collection. * * @param name @@ -252,7 +171,7 @@ public String parameterToString( Object param ) * The value of the parameter. * @return A list containing a single {@code Pair} object. */ - public List parameterToPair( String name, Object value ) + public static List parameterToPair( String name, Object value ) { List params = new ArrayList(); @@ -267,7 +186,7 @@ public List parameterToPair( String name, Object value ) /** * Formats the specified collection query parameters to a list of {@code Pair} objects. - * + *

* Note that the values of each of the returned Pair objects are percent-encoded. * * @param collectionFormat @@ -278,7 +197,7 @@ public List parameterToPair( String name, Object value ) * The value of the parameter. * @return A list of {@code Pair} objects. */ - public List parameterToPairs( String collectionFormat, String name, Collection value ) + public static List parameterToPairs( String collectionFormat, String name, Collection value ) { List params = new ArrayList(); @@ -477,10 +396,8 @@ private HttpEntity serialize( Object obj, Map formParams, Conten String buildUrl( String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject ) { - String baseURL = getBasePath(); - final StringBuilder url = new StringBuilder(); - url.append(baseURL).append(path); + url.append(basePath).append(path); if( queryParams != null && !queryParams.isEmpty() ) { // support (constant) query string in `path`, e.g. "/posts?draft=1" @@ -609,7 +526,7 @@ public T invokeAPI( try { HttpClientResponseHandler responseHandler = - new ApiClientResponseHandler<>(objectMapper, tempFolderPath, returnType); + new DefaultApiResponseHandler<>(objectMapper, tempFolderPath, returnType); return httpClient.execute(builder.build(), context, responseHandler); } catch( IOException e ) { diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java index a215241da..88c5df397 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java @@ -12,28 +12,15 @@ package com.sap.cloud.sdk.services.openapi.apache; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor public abstract class BaseApi { + protected final ApiClient apiClient; - protected ApiClient apiClient; - - public BaseApi() - { - this(new ApiClient()); - } - - public BaseApi( ApiClient apiClient ) - { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() - { - return apiClient; - } - - public void setApiClient( ApiClient apiClient ) + protected BaseApi() { - this.apiClient = apiClient; + this(ApiClient.create()); } } diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java similarity index 98% rename from datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java rename to datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java index d66b8d9f6..9507ccca5 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClientResponseHandler.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java @@ -47,7 +47,7 @@ * @param * The type of object to deserialize the response into */ -class ApiClientResponseHandler implements HttpClientResponseHandler +class DefaultApiResponseHandler implements HttpClientResponseHandler { private final ObjectMapper objectMapper; private final String tempFolderPath; @@ -63,7 +63,7 @@ class ApiClientResponseHandler implements HttpClientResponseHandler * @param returnType * The type reference for response deserialization */ - ApiClientResponseHandler( ObjectMapper objectMapper, String tempFolderPath, TypeReference returnType ) + DefaultApiResponseHandler( ObjectMapper objectMapper, String tempFolderPath, TypeReference returnType ) { this.objectMapper = objectMapper; this.tempFolderPath = tempFolderPath; diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 0d439895c..9c4593f29 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -34,7 +34,6 @@ import java.util.StringJoiner; public class {{classname}} extends BaseApi { public {{classname}}() { - super(new ApiClient()); } public {{classname}}(ApiClient apiClient) { @@ -73,7 +72,7 @@ import java.util.StringJoiner; {{/required}}{{/allParams}} // create path and map variables String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", ApiClient.escapeString(apiClient.parameterToString({{{paramName}}}))){{/pathParams}}; + .replaceAll("\\{" + "{{baseName}}" + "\\}", ApiClient.escapeString(ApiClient.parameterToString({{{paramName}}}))){{/pathParams}}; StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -99,10 +98,10 @@ import java.util.StringJoiner; {{#hasVars}} {{#vars}} {{#isArray}} - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); {{/isArray}} {{^isArray}} - localVarQueryParams.addAll(apiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); + localVarQueryParams.addAll(ApiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); {{/isArray}} {{/vars}} {{/hasVars}} @@ -111,17 +110,17 @@ import java.util.StringJoiner; localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); {{/isModel}} {{^isModel}} - {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#collectionFormat}}localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(ApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); {{/isModel}} {{/hasVars}} {{/isExplode}} {{^isExplode}} - {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#collectionFormat}}localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(ApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); {{/isExplode}} {{/isDeepObject}} {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + localVarHeaderParams.put("{{baseName}}", ApiClient.parameterToString({{paramName}})); {{/headerParams}} {{#formParams}}if ({{paramName}} != null) From ffada46e03badcac50b2e3e82442b5de0cd574aa Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 23 Dec 2025 18:14:50 +0100 Subject: [PATCH 16/25] Remove ApiException and use enhanced OpenApiRequestException --- .../sample/api/OrchestrationConfigsApi.java | 70 +++++----- .../apache/sample/api/PromptTemplatesApi.java | 96 +++++++------ .../services/openapi/apache/ApiClient.java | 24 ++-- .../services/openapi/apache/ApiException.java | 130 ------------------ .../apache/DefaultApiResponseHandler.java | 33 ++--- .../sdk/services/openapi/apache/Pair.java | 1 - .../openapi/core/OpenApiRequestException.java | 18 +++ .../libraries/apache-httpclient/api.mustache | 9 +- 8 files changed, 132 insertions(+), 249 deletions(-) delete mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 979568f88..626af2bf3 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -26,9 +26,9 @@ import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigPostRequest; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigPostResponse; import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.ApiException; import com.sap.cloud.sdk.services.openapi.apache.BaseApi; import com.sap.cloud.sdk.services.openapi.apache.Pair; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; public class OrchestrationConfigsApi extends BaseApi { @@ -51,21 +51,21 @@ public OrchestrationConfigsApi( ApiClient apiClient ) * @param aiResourceGroup * Specify a resource group id to use (optional) * @return OrchestrationConfigPostResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( @javax.annotation.Nonnull OrchestrationConfigPostRequest orchestrationConfigPostRequest, @javax.annotation.Nullable String aiResourceGroup ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = orchestrationConfigPostRequest; // verify the required parameter 'orchestrationConfigPostRequest' is set if( orchestrationConfigPostRequest == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'orchestrationConfigPostRequest' when calling createUpdateOrchestrationConfig"); + throw new OpenApiRequestException( + "Missing the required parameter 'orchestrationConfigPostRequest' when calling createUpdateOrchestrationConfig") + .statusCode(400); } // create path and map variables @@ -115,21 +115,21 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( * @param aiResourceGroup * Specify a resource group id to use (optional) * @return OrchestrationConfigDeleteResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @javax.annotation.Nonnull UUID orchestrationConfigId, @javax.annotation.Nullable String aiResourceGroup ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'orchestrationConfigId' is set if( orchestrationConfigId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'orchestrationConfigId' when calling deleteOrchestrationConfig"); + throw new OpenApiRequestException( + "Missing the required parameter 'orchestrationConfigId' when calling deleteOrchestrationConfig") + .statusCode(400); } // create path and map variables @@ -185,21 +185,21 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( * @param aiResourceGroup * Specify a resource group id to use (optional) * @return File - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public File exportOrchestrationConfig( @javax.annotation.Nonnull UUID orchestrationConfigId, @javax.annotation.Nullable String aiResourceGroup ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'orchestrationConfigId' is set if( orchestrationConfigId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'orchestrationConfigId' when calling exportOrchestrationConfig"); + throw new OpenApiRequestException( + "Missing the required parameter 'orchestrationConfigId' when calling exportOrchestrationConfig") + .statusCode(400); } // create path and map variables @@ -256,22 +256,22 @@ public File exportOrchestrationConfig( * @param resolveTemplateRef * (optional, default to false) * @return OrchestrationConfigGetResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @javax.annotation.Nonnull UUID orchestrationConfigId, @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable Boolean resolveTemplateRef ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'orchestrationConfigId' is set if( orchestrationConfigId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'orchestrationConfigId' when calling getOrchestrationConfigByUuid"); + throw new OpenApiRequestException( + "Missing the required parameter 'orchestrationConfigId' when calling getOrchestrationConfigByUuid") + .statusCode(400); } // create path and map variables @@ -328,13 +328,13 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( * @param _file * (optional) * @return OrchestrationConfigPostResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public OrchestrationConfigPostResponse importOrchestrationConfig( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable File _file ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; @@ -396,7 +396,7 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( * @param resolveTemplateRef * (optional, default to false) * @return OrchestrationConfigListResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public OrchestrationConfigListResponse listOrchestrationConfigHistory( @@ -406,29 +406,27 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable Boolean includeSpec, @javax.annotation.Nullable Boolean resolveTemplateRef ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'scenario' is set if( scenario == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'scenario' when calling listOrchestrationConfigHistory"); + throw new OpenApiRequestException( + "Missing the required parameter 'scenario' when calling listOrchestrationConfigHistory") + .statusCode(400); } // verify the required parameter 'version' is set if( version == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'version' when calling listOrchestrationConfigHistory"); + throw new OpenApiRequestException( + "Missing the required parameter 'version' when calling listOrchestrationConfigHistory").statusCode(400); } // verify the required parameter 'name' is set if( name == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'name' when calling listOrchestrationConfigHistory"); + throw new OpenApiRequestException( + "Missing the required parameter 'name' when calling listOrchestrationConfigHistory").statusCode(400); } // create path and map variables @@ -496,7 +494,7 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( * @param resolveTemplateRef * (optional, default to false) * @return OrchestrationConfigListResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public OrchestrationConfigListResponse listOrchestrationConfigs( @@ -507,7 +505,7 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( @javax.annotation.Nullable String retrieve, @javax.annotation.Nullable Boolean includeSpec, @javax.annotation.Nullable Boolean resolveTemplateRef ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 384434f49..7001ee124 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -28,9 +28,9 @@ import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateSubstitutionRequest; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateSubstitutionResponse; import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.ApiException; import com.sap.cloud.sdk.services.openapi.apache.BaseApi; import com.sap.cloud.sdk.services.openapi.apache.Pair; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; public class PromptTemplatesApi extends BaseApi { @@ -55,22 +55,22 @@ public PromptTemplatesApi( ApiClient apiClient ) * @param aiResourceGroupScope * Specify whether the resource group scope is to be used (optional) * @return PromptTemplatePostResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplatePostResponse createUpdatePromptTemplate( @javax.annotation.Nonnull PromptTemplatePostRequest promptTemplatePostRequest, @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = promptTemplatePostRequest; // verify the required parameter 'promptTemplatePostRequest' is set if( promptTemplatePostRequest == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'promptTemplatePostRequest' when calling createUpdatePromptTemplate"); + throw new OpenApiRequestException( + "Missing the required parameter 'promptTemplatePostRequest' when calling createUpdatePromptTemplate") + .statusCode(400); } // create path and map variables @@ -123,22 +123,21 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( * @param aiResourceGroupScope * Specify whether the resource group scope is to be used (optional) * @return PromptTemplateDeleteResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplateDeleteResponse deletePromptTemplate( @javax.annotation.Nonnull UUID promptTemplateId, @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'promptTemplateId' when calling deletePromptTemplate"); + throw new OpenApiRequestException( + "Missing the required parameter 'promptTemplateId' when calling deletePromptTemplate").statusCode(400); } // create path and map variables @@ -198,22 +197,21 @@ public PromptTemplateDeleteResponse deletePromptTemplate( * @param aiResourceGroupScope * Specify whether the resource group scope is to be used (optional) * @return File - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public File exportPromptTemplate( @javax.annotation.Nonnull UUID promptTemplateId, @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'promptTemplateId' when calling exportPromptTemplate"); + throw new OpenApiRequestException( + "Missing the required parameter 'promptTemplateId' when calling exportPromptTemplate").statusCode(400); } // create path and map variables @@ -272,22 +270,22 @@ public File exportPromptTemplate( * @param aiResourceGroupScope * Specify whether the resource group scope is to be used (optional) * @return PromptTemplateGetResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplateGetResponse getPromptTemplateByUuid( @javax.annotation.Nonnull UUID promptTemplateId, @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'promptTemplateId' when calling getPromptTemplateByUuid"); + throw new OpenApiRequestException( + "Missing the required parameter 'promptTemplateId' when calling getPromptTemplateByUuid") + .statusCode(400); } // create path and map variables @@ -346,14 +344,14 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( * @param _file * (optional) * @return PromptTemplatePostResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplatePostResponse importPromptTemplate( @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope, @javax.annotation.Nullable File _file ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; @@ -414,7 +412,7 @@ public PromptTemplatePostResponse importPromptTemplate( * @param aiResourceGroupScope * Specify whether the resource group scope is to be used (optional) * @return PromptTemplateListResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplateListResponse listPromptTemplateHistory( @@ -423,27 +421,26 @@ public PromptTemplateListResponse listPromptTemplateHistory( @javax.annotation.Nonnull String name, @javax.annotation.Nullable String aiResourceGroup, @javax.annotation.Nullable String aiResourceGroupScope ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; // verify the required parameter 'scenario' is set if( scenario == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'scenario' when calling listPromptTemplateHistory"); + throw new OpenApiRequestException( + "Missing the required parameter 'scenario' when calling listPromptTemplateHistory").statusCode(400); } // verify the required parameter 'version' is set if( version == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'version' when calling listPromptTemplateHistory"); + throw new OpenApiRequestException( + "Missing the required parameter 'version' when calling listPromptTemplateHistory").statusCode(400); } // verify the required parameter 'name' is set if( name == null ) { - throw new ApiException(400, "Missing the required parameter 'name' when calling listPromptTemplateHistory"); + throw new OpenApiRequestException( + "Missing the required parameter 'name' when calling listPromptTemplateHistory").statusCode(400); } // create path and map variables @@ -510,7 +507,7 @@ public PromptTemplateListResponse listPromptTemplateHistory( * @param includeSpec * (optional, default to false) * @return PromptTemplateListResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplateListResponse listPromptTemplates( @@ -521,7 +518,7 @@ public PromptTemplateListResponse listPromptTemplates( @javax.annotation.Nullable String version, @javax.annotation.Nullable String retrieve, @javax.annotation.Nullable Boolean includeSpec ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = null; @@ -586,7 +583,7 @@ public PromptTemplateListResponse listPromptTemplates( * @param promptTemplateSubstitutionRequest * (optional) * @return PromptTemplateSubstitutionResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplateSubstitutionResponse parsePromptTemplateById( @@ -595,15 +592,15 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( @javax.annotation.Nullable String aiResourceGroupScope, @javax.annotation.Nullable Boolean metadata, @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = promptTemplateSubstitutionRequest; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'promptTemplateId' when calling parsePromptTemplateById"); + throw new OpenApiRequestException( + "Missing the required parameter 'promptTemplateId' when calling parsePromptTemplateById") + .statusCode(400); } // create path and map variables @@ -670,7 +667,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( * @param promptTemplateSubstitutionRequest * (optional) * @return PromptTemplateSubstitutionResponse - * @throws ApiException + * @throws OpenApiRequestException * if fails to make API call */ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( @@ -681,29 +678,28 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( @javax.annotation.Nullable String aiResourceGroupScope, @javax.annotation.Nullable Boolean metadata, @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) - throws ApiException + throws OpenApiRequestException { Object localVarPostBody = promptTemplateSubstitutionRequest; // verify the required parameter 'scenario' is set if( scenario == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'scenario' when calling parsePromptTemplateByNameVersion"); + throw new OpenApiRequestException( + "Missing the required parameter 'scenario' when calling parsePromptTemplateByNameVersion") + .statusCode(400); } // verify the required parameter 'version' is set if( version == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'version' when calling parsePromptTemplateByNameVersion"); + throw new OpenApiRequestException( + "Missing the required parameter 'version' when calling parsePromptTemplateByNameVersion") + .statusCode(400); } // verify the required parameter 'name' is set if( name == null ) { - throw new ApiException( - 400, - "Missing the required parameter 'name' when calling parsePromptTemplateByNameVersion"); + throw new OpenApiRequestException( + "Missing the required parameter 'name' when calling parsePromptTemplateByNameVersion").statusCode(400); } // create path and map variables diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index e4e053afb..40b64df8f 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -23,7 +23,6 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; -import java.text.DateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -60,6 +59,7 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; import lombok.AllArgsConstructor; import lombok.Getter; @@ -302,13 +302,13 @@ public static String escapeString( String str ) * Parse content type object from header value */ private ContentType getContentType( String headerValue ) - throws ApiException + throws OpenApiRequestException { try { return ContentType.parse(headerValue); } catch( UnsupportedCharsetException e ) { - throw new ApiException("Could not parse content type " + headerValue); + throw new OpenApiRequestException("Could not parse content type " + headerValue); } } @@ -322,11 +322,11 @@ private ContentType getContentType( String headerValue ) * @param formParams * Form parameters * @return Object - * @throws ApiException + * @throws OpenApiRequestException * API exception */ private HttpEntity serialize( Object obj, Map formParams, ContentType contentType ) - throws ApiException + throws OpenApiRequestException { String mimeType = contentType.getMimeType(); if( isJsonMime(mimeType) ) { @@ -336,7 +336,7 @@ private HttpEntity serialize( Object obj, Map formParams, Conten contentType.withCharset(StandardCharsets.UTF_8)); } catch( JsonProcessingException e ) { - throw new ApiException(e); + throw new OpenApiRequestException(e); } } else if( mimeType.equals(ContentType.MULTIPART_FORM_DATA.getMimeType()) ) { MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); @@ -375,7 +375,7 @@ private HttpEntity serialize( Object obj, Map formParams, Conten } else if( obj instanceof byte[] ) { return new ByteArrayEntity((byte[]) obj, contentType); } - throw new ApiException("Serialization for content type '" + contentType + "' not supported"); + throw new OpenApiRequestException("Serialization for content type '" + contentType + "' not supported"); } } @@ -475,7 +475,7 @@ private static boolean isBodyAllowed( String method ) * @param returnType * Return type * @return The response body in type of string - * @throws ApiException + * @throws OpenApiRequestException * API exception */ @Beta @@ -491,10 +491,10 @@ public T invokeAPI( String accept, String contentType, TypeReference returnType ) - throws ApiException + throws OpenApiRequestException { if( body != null && !formParams.isEmpty() ) { - throw new ApiException("Cannot have body and form params"); + throw new OpenApiRequestException("Cannot have body and form params"); } final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); @@ -517,7 +517,7 @@ public T invokeAPI( // Add entity if we have content and a valid method builder.setEntity(serialize(body, formParams, contentTypeObj)); } else { - throw new ApiException("method " + method + " does not support a request body"); + throw new OpenApiRequestException("method " + method + " does not support a request body"); } } else { // for empty body @@ -530,7 +530,7 @@ public T invokeAPI( return httpClient.execute(builder.build(), context, responseHandler); } catch( IOException e ) { - throw new ApiException(e); + throw new OpenApiRequestException(e); } } } diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java deleted file mode 100644 index adfb0efc9..000000000 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiException.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * The version of the OpenAPI document: 0.0.1 - * - * - * 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.cloud.sdk.services.openapi.apache; - -import java.util.List; -import java.util.Map; - -// TODO: Swap with OpenApiRequestException -public class ApiException extends Exception -{ - private static final long serialVersionUID = 1L; - - private int code = 0; - private transient Map> responseHeaders = null; - private String responseBody = null; - - public ApiException() - { - } - - public ApiException( Throwable throwable ) - { - super(throwable); - } - - public ApiException( String message ) - { - super(message); - } - - public ApiException( - String message, - Throwable throwable, - int code, - Map> responseHeaders, - String responseBody ) - { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - public ApiException( String message, int code, Map> responseHeaders, String responseBody ) - { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException( String message, Throwable throwable, int code, Map> responseHeaders ) - { - this(message, throwable, code, responseHeaders, null); - } - - public ApiException( int code, Map> responseHeaders, String responseBody ) - { - this( - "Response Code: " + code + " Response Body: " + responseBody, - (Throwable) null, - code, - responseHeaders, - responseBody); - } - - public ApiException( int code, String message ) - { - super(message); - this.code = code; - } - - public ApiException( int code, String message, Map> responseHeaders, String responseBody ) - { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() - { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() - { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() - { - return responseBody; - } - - @Override - public String toString() - { - return "ApiException{" - + "code=" - + code - + ", responseHeaders=" - + responseHeaders - + ", responseBody='" - + responseBody - + '\'' - + '}'; - } -} diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java index 9507ccca5..a274d3961 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java @@ -39,6 +39,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; /** * Handles HTTP response processing for API client operations. This class encapsulates response deserialization, error @@ -78,7 +79,7 @@ public T handleResponse( ClassicHttpResponse response ) try { return processResponse(response); } - catch( ParseException | ApiException e ) { + catch( ParseException | OpenApiRequestException e ) { // Wrap exceptions as IOException since handler can only throw IOException throw new IOException("Failed to process response: " + e.getMessage(), e); } @@ -90,7 +91,7 @@ public T handleResponse( ClassicHttpResponse response ) * @param response * The HTTP response to process * @return The deserialized response object - * @throws ApiException + * @throws OpenApiRequestException * if the response indicates an error * @throws IOException * if an I/O error occurs @@ -98,7 +99,7 @@ public T handleResponse( ClassicHttpResponse response ) * if response parsing fails */ private T processResponse( ClassicHttpResponse response ) - throws ApiException, + throws OpenApiRequestException, IOException, ParseException { @@ -113,7 +114,7 @@ private T processResponse( ClassicHttpResponse response ) return deserialize(response); } else { String message = EntityUtils.toString(response.getEntity()); - throw new ApiException(message, statusCode, responseHeaders, message); + throw new OpenApiRequestException(message).statusCode(statusCode).responseHeaders(responseHeaders); } } @@ -123,7 +124,7 @@ private T processResponse( ClassicHttpResponse response ) * @param response * The HTTP response to deserialize * @return The deserialized object - * @throws ApiException + * @throws OpenApiRequestException * if deserialization fails * @throws IOException * if an I/O error occurs @@ -132,7 +133,7 @@ private T processResponse( ClassicHttpResponse response ) */ @SuppressWarnings( "unchecked" ) private T deserialize( ClassicHttpResponse response ) - throws ApiException, + throws OpenApiRequestException, IOException, ParseException { @@ -162,11 +163,11 @@ private T deserialize( ClassicHttpResponse response ) return (T) EntityUtils.toString(entity); } else { Map> responseHeaders = transformResponseHeaders(response.getHeaders()); - throw new ApiException( - "Deserialization for content type '" + mimeType + "' not supported for type '" + returnType + "'", - response.getCode(), - responseHeaders, - EntityUtils.toString(entity)); + throw new OpenApiRequestException( + "Deserialization for content type '" + mimeType + "' not supported for type '" + returnType + "'") + .statusCode(response.getCode()) + .responseHeaders(responseHeaders) + .responseBody(EntityUtils.toString(entity)); } } @@ -240,11 +241,11 @@ private File prepareDownloadFile( String contentDisposition ) * @param response * The HTTP response * @return The MIME type, or null if not present - * @throws ApiException + * @throws OpenApiRequestException * if the content type cannot be parsed */ private String getResponseMimeType( HttpResponse response ) - throws ApiException + throws OpenApiRequestException { Header contentTypeHeader = response.getFirstHeader("Content-Type"); if( contentTypeHeader != null ) { @@ -259,17 +260,17 @@ private String getResponseMimeType( HttpResponse response ) * @param headerValue * The Content-Type header value * @return The parsed ContentType object - * @throws ApiException + * @throws OpenApiRequestException * if the content type cannot be parsed */ private static ContentType parseContentType( String headerValue ) - throws ApiException + throws OpenApiRequestException { try { return ContentType.parse(headerValue); } catch( UnsupportedCharsetException e ) { - throw new ApiException("Could not parse content type " + headerValue); + throw new OpenApiRequestException("Could not parse content type " + headerValue); } } diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java index c09df3b59..1ab38e5f7 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/Pair.java @@ -16,7 +16,6 @@ import lombok.Value; -//TODO: COnsider Map but comes with api.mustache changes @Value public class Pair { diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/core/OpenApiRequestException.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/core/OpenApiRequestException.java index c22e6a505..6237641e1 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/core/OpenApiRequestException.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/core/OpenApiRequestException.java @@ -1,14 +1,32 @@ package com.sap.cloud.sdk.services.openapi.core; +import java.util.List; +import java.util.Map; + import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; /** * Thrown if an error occurs during the invocation of a OpenAPI service. */ +@Accessors( fluent = true ) +@Getter +@Setter public class OpenApiRequestException extends RuntimeException { private static final long serialVersionUID = -8248392392632616674L; + @Nullable + private Integer statusCode; + @Nullable + private transient Map> responseHeaders; + @Nullable + private transient String responseBody; + /** * Thrown if an error occurs during the invocation of a OpenAPI service. * diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 9c4593f29..85ad0b9a2 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -3,7 +3,7 @@ package {{package}}; import com.fasterxml.jackson.core.type.TypeReference; -import {{invokerPackage}}.ApiException; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.BaseApi; {{#models.0}} @@ -50,7 +50,7 @@ import java.util.StringJoiner; {{#returnType}} * @return {{returnType}} {{/returnType}} - * @throws ApiException if fails to make API call + * @throws OpenApiRequestException if fails to make API call {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -62,12 +62,13 @@ import java.util.StringJoiner; {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { - throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); + throw new OpenApiRequestException("Missing the required parameter '{{paramName}}' when calling {{operationId}}") + .statusCode(400); } {{/required}}{{/allParams}} // create path and map variables From cd26cf8f4a81dd4ec8fb7196a4e75e24ec7b617d Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 29 Dec 2025 14:10:40 +0100 Subject: [PATCH 17/25] Borrow sample module handling --- .../openapi/openapi-api-apache-sample/pom.xml | 4 + .../sample/api/OrchestrationConfigsApi.java | 94 ++++++++++----- .../apache/sample/api/PromptTemplatesApi.java | 112 +++++++++++------- .../sdk/services/openapi/apache/BaseApi.java | 15 ++- .../libraries/apache-httpclient/api.mustache | 65 +++++++++- .../nullable_var_annotations.mustache | 1 + 6 files changed, 214 insertions(+), 77 deletions(-) create mode 100644 datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/nullable_var_annotations.mustache diff --git a/datamodel/openapi/openapi-api-apache-sample/pom.xml b/datamodel/openapi/openapi-api-apache-sample/pom.xml index 588f6cbc5..a58123553 100644 --- a/datamodel/openapi/openapi-api-apache-sample/pom.xml +++ b/datamodel/openapi/openapi-api-apache-sample/pom.xml @@ -22,6 +22,10 @@ com.sap.cloud.sdk.datamodel openapi-core + + com.sap.cloud.sdk.cloudplatform + cloudplatform-connectivity + com.google.guava guava diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 626af2bf3..d89b70448 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -19,7 +19,12 @@ import java.util.StringJoiner; import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import com.fasterxml.jackson.core.type.TypeReference; +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigDeleteResponse; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigGetResponse; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigListResponse; @@ -30,14 +35,41 @@ import com.sap.cloud.sdk.services.openapi.apache.Pair; import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +/** + * Prompt Registry API in version 0.0.1. + * + * Prompt Storage service for Design time & Runtime prompt templates. + */ +@Beta public class OrchestrationConfigsApi extends BaseApi { + /** + * Instantiates this API class to invoke operations on the Prompt Registry API + */ public OrchestrationConfigsApi() { } - public OrchestrationConfigsApi( ApiClient apiClient ) + /** + * Instantiates this API class to invoke operations on the Prompt Registry API. + * + * @param httpDestination + * The destination that API should be used with + */ + public OrchestrationConfigsApi( @Nonnull final Destination httpDestination ) + { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Prompt Registry API based on a given {@link ApiClient}. + * + * @param apiClient + * ApiClient to invoke the API on + */ + @Beta + public OrchestrationConfigsApi( @Nonnull final ApiClient apiClient ) { super(apiClient); } @@ -55,8 +87,8 @@ public OrchestrationConfigsApi( ApiClient apiClient ) * if fails to make API call */ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( - @javax.annotation.Nonnull OrchestrationConfigPostRequest orchestrationConfigPostRequest, - @javax.annotation.Nullable String aiResourceGroup ) + @Nonnull final OrchestrationConfigPostRequest orchestrationConfigPostRequest, + @Nullable final String aiResourceGroup ) throws OpenApiRequestException { Object localVarPostBody = orchestrationConfigPostRequest; @@ -118,10 +150,10 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( * @throws OpenApiRequestException * if fails to make API call */ - public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( - @javax.annotation.Nonnull UUID orchestrationConfigId, - @javax.annotation.Nullable String aiResourceGroup ) - throws OpenApiRequestException + public + OrchestrationConfigDeleteResponse + deleteOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) + throws OpenApiRequestException { Object localVarPostBody = null; @@ -188,10 +220,10 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( * @throws OpenApiRequestException * if fails to make API call */ - public File exportOrchestrationConfig( - @javax.annotation.Nonnull UUID orchestrationConfigId, - @javax.annotation.Nullable String aiResourceGroup ) - throws OpenApiRequestException + public + File + exportOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) + throws OpenApiRequestException { Object localVarPostBody = null; @@ -260,9 +292,9 @@ public File exportOrchestrationConfig( * if fails to make API call */ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( - @javax.annotation.Nonnull UUID orchestrationConfigId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable Boolean resolveTemplateRef ) + @Nonnull final UUID orchestrationConfigId, + @Nullable final String aiResourceGroup, + @Nullable final Boolean resolveTemplateRef ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -331,10 +363,10 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( * @throws OpenApiRequestException * if fails to make API call */ - public OrchestrationConfigPostResponse importOrchestrationConfig( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable File _file ) - throws OpenApiRequestException + public + OrchestrationConfigPostResponse + importOrchestrationConfig( @Nullable final String aiResourceGroup, @Nullable final File _file ) + throws OpenApiRequestException { Object localVarPostBody = null; @@ -400,12 +432,12 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( * if fails to make API call */ public OrchestrationConfigListResponse listOrchestrationConfigHistory( - @javax.annotation.Nonnull String scenario, - @javax.annotation.Nonnull String version, - @javax.annotation.Nonnull String name, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable Boolean includeSpec, - @javax.annotation.Nullable Boolean resolveTemplateRef ) + @Nonnull final String scenario, + @Nonnull final String version, + @Nonnull final String name, + @Nullable final String aiResourceGroup, + @Nullable final Boolean includeSpec, + @Nullable final Boolean resolveTemplateRef ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -498,13 +530,13 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( * if fails to make API call */ public OrchestrationConfigListResponse listOrchestrationConfigs( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String scenario, - @javax.annotation.Nullable String name, - @javax.annotation.Nullable String version, - @javax.annotation.Nullable String retrieve, - @javax.annotation.Nullable Boolean includeSpec, - @javax.annotation.Nullable Boolean resolveTemplateRef ) + @Nullable final String aiResourceGroup, + @Nullable final String scenario, + @Nullable final String name, + @Nullable final String version, + @Nullable final String retrieve, + @Nullable final Boolean includeSpec, + @Nullable final Boolean resolveTemplateRef ) throws OpenApiRequestException { Object localVarPostBody = null; diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 7001ee124..83d7d51c9 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -19,7 +19,12 @@ import java.util.StringJoiner; import java.util.UUID; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import com.fasterxml.jackson.core.type.TypeReference; +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateDeleteResponse; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateGetResponse; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateListResponse; @@ -32,14 +37,41 @@ import com.sap.cloud.sdk.services.openapi.apache.Pair; import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +/** + * Prompt Registry API in version 0.0.1. + * + * Prompt Storage service for Design time & Runtime prompt templates. + */ +@Beta public class PromptTemplatesApi extends BaseApi { + /** + * Instantiates this API class to invoke operations on the Prompt Registry API + */ public PromptTemplatesApi() { } - public PromptTemplatesApi( ApiClient apiClient ) + /** + * Instantiates this API class to invoke operations on the Prompt Registry API. + * + * @param httpDestination + * The destination that API should be used with + */ + public PromptTemplatesApi( @Nonnull final Destination httpDestination ) + { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Prompt Registry API based on a given {@link ApiClient}. + * + * @param apiClient + * ApiClient to invoke the API on + */ + @Beta + public PromptTemplatesApi( @Nonnull final ApiClient apiClient ) { super(apiClient); } @@ -59,9 +91,9 @@ public PromptTemplatesApi( ApiClient apiClient ) * if fails to make API call */ public PromptTemplatePostResponse createUpdatePromptTemplate( - @javax.annotation.Nonnull PromptTemplatePostRequest promptTemplatePostRequest, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope ) + @Nonnull final PromptTemplatePostRequest promptTemplatePostRequest, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { Object localVarPostBody = promptTemplatePostRequest; @@ -127,9 +159,9 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( * if fails to make API call */ public PromptTemplateDeleteResponse deletePromptTemplate( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope ) + @Nonnull final UUID promptTemplateId, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -201,9 +233,9 @@ public PromptTemplateDeleteResponse deletePromptTemplate( * if fails to make API call */ public File exportPromptTemplate( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope ) + @Nonnull final UUID promptTemplateId, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -274,9 +306,9 @@ public File exportPromptTemplate( * if fails to make API call */ public PromptTemplateGetResponse getPromptTemplateByUuid( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope ) + @Nonnull final UUID promptTemplateId, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -348,9 +380,9 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( * if fails to make API call */ public PromptTemplatePostResponse importPromptTemplate( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable File _file ) + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope, + @Nullable final File _file ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -416,11 +448,11 @@ public PromptTemplatePostResponse importPromptTemplate( * if fails to make API call */ public PromptTemplateListResponse listPromptTemplateHistory( - @javax.annotation.Nonnull String scenario, - @javax.annotation.Nonnull String version, - @javax.annotation.Nonnull String name, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope ) + @Nonnull final String scenario, + @Nonnull final String version, + @Nonnull final String name, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -511,13 +543,13 @@ public PromptTemplateListResponse listPromptTemplateHistory( * if fails to make API call */ public PromptTemplateListResponse listPromptTemplates( - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable String scenario, - @javax.annotation.Nullable String name, - @javax.annotation.Nullable String version, - @javax.annotation.Nullable String retrieve, - @javax.annotation.Nullable Boolean includeSpec ) + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope, + @Nullable final String scenario, + @Nullable final String name, + @Nullable final String version, + @Nullable final String retrieve, + @Nullable final Boolean includeSpec ) throws OpenApiRequestException { Object localVarPostBody = null; @@ -587,11 +619,11 @@ public PromptTemplateListResponse listPromptTemplates( * if fails to make API call */ public PromptTemplateSubstitutionResponse parsePromptTemplateById( - @javax.annotation.Nonnull UUID promptTemplateId, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable Boolean metadata, - @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) + @Nonnull final UUID promptTemplateId, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope, + @Nullable final Boolean metadata, + @Nullable final PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) throws OpenApiRequestException { Object localVarPostBody = promptTemplateSubstitutionRequest; @@ -671,13 +703,13 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( * if fails to make API call */ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( - @javax.annotation.Nonnull String scenario, - @javax.annotation.Nonnull String version, - @javax.annotation.Nonnull String name, - @javax.annotation.Nullable String aiResourceGroup, - @javax.annotation.Nullable String aiResourceGroupScope, - @javax.annotation.Nullable Boolean metadata, - @javax.annotation.Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) + @Nonnull final String scenario, + @Nonnull final String version, + @Nonnull final String name, + @Nullable final String aiResourceGroup, + @Nullable final String aiResourceGroupScope, + @Nullable final Boolean metadata, + @Nullable final PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) throws OpenApiRequestException { Object localVarPostBody = promptTemplateSubstitutionRequest; diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java index 88c5df397..45a4cbb23 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/BaseApi.java @@ -12,9 +12,10 @@ package com.sap.cloud.sdk.services.openapi.apache; -import lombok.RequiredArgsConstructor; +import javax.annotation.Nonnull; + +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -@RequiredArgsConstructor public abstract class BaseApi { protected final ApiClient apiClient; @@ -23,4 +24,14 @@ protected BaseApi() { this(ApiClient.create()); } + + protected BaseApi( @Nonnull final Destination destination ) + { + this(ApiClient.create(destination)); + } + + protected BaseApi( @Nonnull final ApiClient apiClient ) + { + this.apiClient = apiClient; + } } diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 85ad0b9a2..e0e375e17 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -23,22 +23,78 @@ import java.util.Locale; import java.util.Map; import java.util.StringJoiner; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import com.google.common.annotations.Beta; + +{{^aiSdkConstructor}}import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +{{/aiSdkConstructor}} +{{#aiSdkConstructor}}import com.sap.ai.sdk.core.AiCoreService; +{{/aiSdkConstructor}} + {{#useBeanValidation}} import {{javaxPackage}}.validation.constraints.*; import {{javaxPackage}}.validation.Valid; {{/useBeanValidation}} -{{!>generatedAnnotation}} +/** +* {{appName}} in version {{version}}. +* +* {{#appDescription}}{{{appDescription}}}{{/appDescription}}{{^appDescription}}No description provided.{{/appDescription}} +*/ +{{!>generatedAnnotation}} +{{^isReleased}}@Beta{{/isReleased}} {{#operations}} - public class {{classname}} extends BaseApi { +public class {{classname}} extends BaseApi { + {{^aiSdkConstructor}} + /** + * Instantiates this API class to invoke operations on the {{appName}} + */ public {{classname}}() { } - public {{classname}}(ApiClient apiClient) { + /** + * Instantiates this API class to invoke operations on the {{appName}}. + * + * @param httpDestination The destination that API should be used with + */ + public {{classname}}( @Nonnull final Destination httpDestination ) + { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the {{appName}} based on a given {@link ApiClient}. + * + * @param apiClient + * ApiClient to invoke the API on + */ + @Beta + public {{classname}}(@Nonnull final ApiClient apiClient) { super(apiClient); } + {{/aiSdkConstructor}} + {{#aiSdkConstructor}} + /** + * Instantiates this API class to invoke operations on the {{appName}} + */ + public {{classname}}() + { + super(new AiCoreService().getApiClient()); + } + + /** + * Instantiates this API class to invoke operations on the {{appName}} + * + * @param aiCoreService The configured connectivity instance to AI Core + */ + public {{classname}}( @Nonnull final AiCoreService aiCoreService ) + { + super(aiCoreService.getApiClient()); + } + {{/aiSdkConstructor}} {{#operation}} /** @@ -62,7 +118,8 @@ import java.util.StringJoiner; {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { + {{#vendorExtensions.x-return-nullable}}@Nullable{{/vendorExtensions.x-return-nullable}}{{^vendorExtensions.x-return-nullable}}@Nonnull{{/vendorExtensions.x-return-nullable}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/nullable_var_annotations.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/nullable_var_annotations.mustache new file mode 100644 index 000000000..54ee8cac6 --- /dev/null +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/nullable_var_annotations.mustache @@ -0,0 +1 @@ +{{#required}}{{#isNullable}}@Nullable{{/isNullable}}{{^isNullable}}@Nonnull{{/isNullable}}{{/required}}{{^required}}@Nullable{{/required}} \ No newline at end of file From 8357f5fbc8c8b3ce8e88d2e0455702d0f38d1314 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 29 Dec 2025 15:03:43 +0100 Subject: [PATCH 18/25] Apache mustache parity - Enhance JavaDoc - Support Vendor extension `x-sap-cloud-sdk-operation-name` --- .../sample/api/OrchestrationConfigsApi.java | 193 +++++++++---- .../apache/sample/api/PromptTemplatesApi.java | 263 +++++++++++++----- .../libraries/apache-httpclient/api.mustache | 33 ++- 3 files changed, 366 insertions(+), 123 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index d89b70448..870a184bf 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -1,13 +1,6 @@ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ +* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. +*/ package com.sap.cloud.sdk.datamodel.openapi.apache.sample.api; @@ -75,17 +68,33 @@ public OrchestrationConfigsApi( @Nonnull final ApiClient apiClient ) } /** - * + *

+ *

+ *

* Create or update an orchestration config + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param orchestrationConfigPostRequest - * (required) + * (required) The value for the parameter orchestrationConfigPostRequest * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @return OrchestrationConfigPostResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( @Nonnull final OrchestrationConfigPostRequest orchestrationConfigPostRequest, @Nullable final String aiResourceGroup ) @@ -139,17 +148,33 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( } /** - * + *

+ *

+ *

* Delete orchestration config + *

+ *

+ * 200 - Successful response + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 404 - Bad Request + *

+ *

+ * 0 - Common Error + *

* * @param orchestrationConfigId - * (required) + * (required) The value for the parameter orchestrationConfigId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @return OrchestrationConfigDeleteResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) @@ -209,17 +234,30 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( } /** - * + *

+ *

+ *

* Export orchestration config + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 0 - Common Error + *

* * @param orchestrationConfigId - * (required) + * (required) The value for the parameter orchestrationConfigId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @return File * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public File exportOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) @@ -278,19 +316,35 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( } /** - * + *

+ *

+ *

* Get orchestration config by UUID + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param orchestrationConfigId - * (required) + * (required) The value for the parameter orchestrationConfigId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param resolveTemplateRef - * (optional, default to false) + * (optional, default to false) The value for the parameter resolveTemplateRef * @return OrchestrationConfigGetResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup, @@ -352,17 +406,30 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( } /** - * + *

+ *

+ *

* Import orchestration config + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 0 - Common Error + *

* * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param _file - * (optional) + * (optional) The value for the parameter _file * @return OrchestrationConfigPostResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public OrchestrationConfigPostResponse importOrchestrationConfig( @Nullable final String aiResourceGroup, @Nullable final File _file ) @@ -412,25 +479,41 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( } /** - * + *

+ *

+ *

* List orchestration config history + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param scenario - * (required) + * (required) The value for the parameter scenario * @param version - * (required) + * (required) The value for the parameter version * @param name - * (required) + * (required) The value for the parameter name * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param includeSpec - * (optional, default to false) + * (optional, default to false) The value for the parameter includeSpec * @param resolveTemplateRef - * (optional, default to false) + * (optional, default to false) The value for the parameter resolveTemplateRef * @return OrchestrationConfigListResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public OrchestrationConfigListResponse listOrchestrationConfigHistory( @Nonnull final String scenario, @Nonnull final String version, @@ -508,27 +591,43 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( } /** - * + *

+ *

+ *

* List orchestration configs + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param scenario - * (optional) + * (optional) The value for the parameter scenario * @param name - * (optional) + * (optional) The value for the parameter name * @param version - * (optional) + * (optional) The value for the parameter version * @param retrieve - * (optional, default to both) + * (optional, default to both) The value for the parameter retrieve * @param includeSpec - * (optional, default to false) + * (optional, default to false) The value for the parameter includeSpec * @param resolveTemplateRef - * (optional, default to false) + * (optional, default to false) The value for the parameter resolveTemplateRef * @return OrchestrationConfigListResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public OrchestrationConfigListResponse listOrchestrationConfigs( @Nullable final String aiResourceGroup, @Nullable final String scenario, diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 83d7d51c9..c689d6754 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -1,13 +1,6 @@ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ +* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. +*/ package com.sap.cloud.sdk.datamodel.openapi.apache.sample.api; @@ -77,19 +70,35 @@ public PromptTemplatesApi( @Nonnull final ApiClient apiClient ) } /** - * + *

+ *

+ *

* Create or update a prompt template + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param promptTemplatePostRequest - * (required) + * (required) The value for the parameter promptTemplatePostRequest * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @return PromptTemplatePostResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplatePostResponse createUpdatePromptTemplate( @Nonnull final PromptTemplatePostRequest promptTemplatePostRequest, @Nullable final String aiResourceGroup, @@ -145,19 +154,35 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( } /** - * + *

+ *

+ *

* Delete prompt template + *

+ *

+ * 200 - Successful response + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 404 - Bad Request + *

+ *

+ * 0 - Common Error + *

* * @param promptTemplateId - * (required) + * (required) The value for the parameter promptTemplateId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @return PromptTemplateDeleteResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplateDeleteResponse deletePromptTemplate( @Nonnull final UUID promptTemplateId, @Nullable final String aiResourceGroup, @@ -219,19 +244,32 @@ public PromptTemplateDeleteResponse deletePromptTemplate( } /** - * + *

+ *

+ *

* Export prompt template + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 0 - Common Error + *

* * @param promptTemplateId - * (required) + * (required) The value for the parameter promptTemplateId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @return File * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public File exportPromptTemplate( @Nonnull final UUID promptTemplateId, @Nullable final String aiResourceGroup, @@ -292,19 +330,35 @@ public File exportPromptTemplate( } /** - * + *

+ *

+ *

* Get prompt template by UUID + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param promptTemplateId - * (required) + * (required) The value for the parameter promptTemplateId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @return PromptTemplateGetResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplateGetResponse getPromptTemplateByUuid( @Nonnull final UUID promptTemplateId, @Nullable final String aiResourceGroup, @@ -366,19 +420,32 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( } /** - * + *

+ *

+ *

* Import prompt template + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 0 - Common Error + *

* * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @param _file - * (optional) + * (optional) The value for the parameter _file * @return PromptTemplatePostResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplatePostResponse importPromptTemplate( @Nullable final String aiResourceGroup, @Nullable final String aiResourceGroupScope, @@ -430,23 +497,39 @@ public PromptTemplatePostResponse importPromptTemplate( } /** - * + *

+ *

+ *

* List prompt template history + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param scenario - * (required) + * (required) The value for the parameter scenario * @param version - * (required) + * (required) The value for the parameter version * @param name - * (required) + * (required) The value for the parameter name * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @return PromptTemplateListResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplateListResponse listPromptTemplateHistory( @Nonnull final String scenario, @Nonnull final String version, @@ -521,27 +604,43 @@ public PromptTemplateListResponse listPromptTemplateHistory( } /** - * + *

+ *

+ *

* List prompt templates + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @param scenario - * (optional) + * (optional) The value for the parameter scenario * @param name - * (optional) + * (optional) The value for the parameter name * @param version - * (optional) + * (optional) The value for the parameter version * @param retrieve - * (optional, default to both) + * (optional, default to both) The value for the parameter retrieve * @param includeSpec - * (optional, default to false) + * (optional, default to false) The value for the parameter includeSpec * @return PromptTemplateListResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplateListResponse listPromptTemplates( @Nullable final String aiResourceGroup, @Nullable final String aiResourceGroupScope, @@ -601,23 +700,39 @@ public PromptTemplateListResponse listPromptTemplates( } /** - * + *

+ *

+ *

* Parse prompt template by ID + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param promptTemplateId - * (required) + * (required) The value for the parameter promptTemplateId * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @param metadata - * (optional, default to false) + * (optional, default to false) The value for the parameter metadata * @param promptTemplateSubstitutionRequest - * (optional) + * (optional) The value for the parameter promptTemplateSubstitutionRequest * @return PromptTemplateSubstitutionResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplateSubstitutionResponse parsePromptTemplateById( @Nonnull final UUID promptTemplateId, @Nullable final String aiResourceGroup, @@ -681,27 +796,43 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( } /** - * + *

+ *

+ *

* Parse prompt template by name and version + *

+ *

+ * 200 - Successful response + *

+ *

+ * 400 - Bad Request + *

+ *

+ * 403 - Forbidden Error + *

+ *

+ * 0 - Common Error + *

* * @param scenario - * (required) + * (required) The value for the parameter scenario * @param version - * (required) + * (required) The value for the parameter version * @param name - * (required) + * (required) The value for the parameter name * @param aiResourceGroup - * Specify a resource group id to use (optional) + * (optional) Specify a resource group id to use * @param aiResourceGroupScope - * Specify whether the resource group scope is to be used (optional) + * (optional) Specify whether the resource group scope is to be used * @param metadata - * (optional, default to false) + * (optional, default to false) The value for the parameter metadata * @param promptTemplateSubstitutionRequest - * (optional) + * (optional) The value for the parameter promptTemplateSubstitutionRequest * @return PromptTemplateSubstitutionResponse * @throws OpenApiRequestException - * if fails to make API call + * if an error occurs while attempting to invoke the API */ + @Nonnull public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( @Nonnull final String scenario, @Nonnull final String version, diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index e0e375e17..4f1221165 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -1,4 +1,9 @@ -{{>licenseInfo}} +{{#copyrightHeader}} +/* +* {{copyrightHeader}} +*/ +{{/copyrightHeader}} + package {{package}}; import com.fasterxml.jackson.core.type.TypeReference; @@ -52,8 +57,7 @@ public class {{classname}} extends BaseApi { /** * Instantiates this API class to invoke operations on the {{appName}} */ - public {{classname}}() { - } + public {{classname}}() {} /** * Instantiates this API class to invoke operations on the {{appName}}. @@ -100,31 +104,40 @@ public class {{classname}} extends BaseApi { /** * {{summary}} * {{notes}} + {{#responses}} + *

{{code}}{{#message}} - {{message}}{{/message}}

+ {{/responses}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + * @param {{paramName}} {{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + {{#description}} + {{description}} + {{/description}} + {{^description}} + The value for the parameter {{paramName}} + {{/description}} {{/allParams}} {{#returnType}} * @return {{returnType}} {{/returnType}} - * @throws OpenApiRequestException if fails to make API call - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} */ {{#isDeprecated}} @Deprecated {{/isDeprecated}} {{#vendorExtensions.x-return-nullable}}@Nullable{{/vendorExtensions.x-return-nullable}}{{^vendorExtensions.x-return-nullable}}@Nonnull{{/vendorExtensions.x-return-nullable}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { - throw new OpenApiRequestException("Missing the required parameter '{{paramName}}' when calling {{operationId}}") + throw new OpenApiRequestException("Missing the required parameter '{{paramName}}' when calling {{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}") .statusCode(400); } {{/required}}{{/allParams}} From 4d5b97b60f3184cb78a2d472fbff8f641f9fef40 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 29 Dec 2025 15:41:14 +0100 Subject: [PATCH 19/25] Apache mustache parity - Method overloading for required and options param in operations --- .../sample/api/OrchestrationConfigsApi.java | 222 ++++++++++--- .../apache/sample/api/PromptTemplatesApi.java | 293 ++++++++++++++---- .../libraries/apache-httpclient/api.mustache | 167 ++++------ .../apache-httpclient/operationBody.mustache | 94 ++++++ 4 files changed, 575 insertions(+), 201 deletions(-) create mode 100644 datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 870a184bf..280347cdf 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -69,22 +69,16 @@ public OrchestrationConfigsApi( @Nonnull final ApiClient apiClient ) /** *

- *

*

* Create or update an orchestration config - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param orchestrationConfigPostRequest * (required) The value for the parameter orchestrationConfigPostRequest @@ -149,22 +143,43 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( /** *

- *

+ *

+ * Create or update an orchestration config + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param orchestrationConfigPostRequest + * The value for the parameter orchestrationConfigPostRequest + * @return OrchestrationConfigPostResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( + @Nonnull final OrchestrationConfigPostRequest orchestrationConfigPostRequest ) + throws OpenApiRequestException + { + return createUpdateOrchestrationConfig(orchestrationConfigPostRequest, null); + } + + /** + *

*

* Delete orchestration config - *

*

* 200 - Successful response - *

*

* 403 - Forbidden Error - *

*

* 404 - Bad Request - *

*

* 0 - Common Error - *

* * @param orchestrationConfigId * (required) The value for the parameter orchestrationConfigId @@ -235,19 +250,40 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( /** *

- *

+ *

+ * Delete orchestration config + *

+ * 200 - Successful response + *

+ * 403 - Forbidden Error + *

+ * 404 - Bad Request + *

+ * 0 - Common Error + * + * @param orchestrationConfigId + * The value for the parameter orchestrationConfigId + * @return OrchestrationConfigDeleteResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @Nonnull final UUID orchestrationConfigId ) + throws OpenApiRequestException + { + return deleteOrchestrationConfig(orchestrationConfigId, null); + } + + /** + *

*

* Export orchestration config - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 0 - Common Error - *

* * @param orchestrationConfigId * (required) The value for the parameter orchestrationConfigId @@ -317,22 +353,40 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( /** *

- *

+ *

+ * Export orchestration config + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 0 - Common Error + * + * @param orchestrationConfigId + * The value for the parameter orchestrationConfigId + * @return File + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public File exportOrchestrationConfig( @Nonnull final UUID orchestrationConfigId ) + throws OpenApiRequestException + { + return exportOrchestrationConfig(orchestrationConfigId, null); + } + + /** + *

*

* Get orchestration config by UUID - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param orchestrationConfigId * (required) The value for the parameter orchestrationConfigId @@ -407,19 +461,40 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( /** *

- *

+ *

+ * Get orchestration config by UUID + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param orchestrationConfigId + * The value for the parameter orchestrationConfigId + * @return OrchestrationConfigGetResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull final UUID orchestrationConfigId ) + throws OpenApiRequestException + { + return getOrchestrationConfigByUuid(orchestrationConfigId, null, null); + } + + /** + *

*

* Import orchestration config - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 0 - Common Error - *

* * @param aiResourceGroup * (optional) Specify a resource group id to use @@ -480,22 +555,38 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( /** *

- *

+ *

+ * Import orchestration config + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 0 - Common Error + * + * @return OrchestrationConfigPostResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public OrchestrationConfigPostResponse importOrchestrationConfig() + throws OpenApiRequestException + { + return importOrchestrationConfig(null, null); + } + + /** + *

*

* List orchestration config history - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param scenario * (required) The value for the parameter scenario @@ -592,22 +683,49 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( /** *

- *

+ *

+ * List orchestration config history + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param scenario + * The value for the parameter scenario + * @param version + * The value for the parameter version + * @param name + * The value for the parameter name + * @return OrchestrationConfigListResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public OrchestrationConfigListResponse listOrchestrationConfigHistory( + @Nonnull final String scenario, + @Nonnull final String version, + @Nonnull final String name ) + throws OpenApiRequestException + { + return listOrchestrationConfigHistory(scenario, version, name, null, null, null); + } + + /** + *

*

* List orchestration configs - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param aiResourceGroup * (optional) Specify a resource group id to use @@ -685,4 +803,28 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( localVarContentType, localVarReturnType); } + + /** + *

+ *

+ * List orchestration configs + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @return OrchestrationConfigListResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public OrchestrationConfigListResponse listOrchestrationConfigs() + throws OpenApiRequestException + { + return listOrchestrationConfigs(null, null, null, null, null, null, null); + } } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index c689d6754..14609059c 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -71,22 +71,16 @@ public PromptTemplatesApi( @Nonnull final ApiClient apiClient ) /** *

- *

*

* Create or update a prompt template - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param promptTemplatePostRequest * (required) The value for the parameter promptTemplatePostRequest @@ -155,22 +149,43 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( /** *

- *

+ *

+ * Create or update a prompt template + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param promptTemplatePostRequest + * The value for the parameter promptTemplatePostRequest + * @return PromptTemplatePostResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplatePostResponse createUpdatePromptTemplate( + @Nonnull final PromptTemplatePostRequest promptTemplatePostRequest ) + throws OpenApiRequestException + { + return createUpdatePromptTemplate(promptTemplatePostRequest, null, null); + } + + /** + *

*

* Delete prompt template - *

*

* 200 - Successful response - *

*

* 403 - Forbidden Error - *

*

* 404 - Bad Request - *

*

* 0 - Common Error - *

* * @param promptTemplateId * (required) The value for the parameter promptTemplateId @@ -245,19 +260,40 @@ public PromptTemplateDeleteResponse deletePromptTemplate( /** *

- *

+ *

+ * Delete prompt template + *

+ * 200 - Successful response + *

+ * 403 - Forbidden Error + *

+ * 404 - Bad Request + *

+ * 0 - Common Error + * + * @param promptTemplateId + * The value for the parameter promptTemplateId + * @return PromptTemplateDeleteResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplateDeleteResponse deletePromptTemplate( @Nonnull final UUID promptTemplateId ) + throws OpenApiRequestException + { + return deletePromptTemplate(promptTemplateId, null, null); + } + + /** + *

*

* Export prompt template - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 0 - Common Error - *

* * @param promptTemplateId * (required) The value for the parameter promptTemplateId @@ -331,22 +367,40 @@ public File exportPromptTemplate( /** *

- *

+ *

+ * Export prompt template + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 0 - Common Error + * + * @param promptTemplateId + * The value for the parameter promptTemplateId + * @return File + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public File exportPromptTemplate( @Nonnull final UUID promptTemplateId ) + throws OpenApiRequestException + { + return exportPromptTemplate(promptTemplateId, null, null); + } + + /** + *

*

* Get prompt template by UUID - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param promptTemplateId * (required) The value for the parameter promptTemplateId @@ -421,19 +475,40 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( /** *

- *

+ *

+ * Get prompt template by UUID + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param promptTemplateId + * The value for the parameter promptTemplateId + * @return PromptTemplateGetResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplateGetResponse getPromptTemplateByUuid( @Nonnull final UUID promptTemplateId ) + throws OpenApiRequestException + { + return getPromptTemplateByUuid(promptTemplateId, null, null); + } + + /** + *

*

* Import prompt template - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 0 - Common Error - *

* * @param aiResourceGroup * (optional) Specify a resource group id to use @@ -498,22 +573,38 @@ public PromptTemplatePostResponse importPromptTemplate( /** *

- *

+ *

+ * Import prompt template + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 0 - Common Error + * + * @return PromptTemplatePostResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplatePostResponse importPromptTemplate() + throws OpenApiRequestException + { + return importPromptTemplate(null, null, null); + } + + /** + *

*

* List prompt template history - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param scenario * (required) The value for the parameter scenario @@ -605,22 +696,49 @@ public PromptTemplateListResponse listPromptTemplateHistory( /** *

- *

+ *

+ * List prompt template history + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param scenario + * The value for the parameter scenario + * @param version + * The value for the parameter version + * @param name + * The value for the parameter name + * @return PromptTemplateListResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplateListResponse listPromptTemplateHistory( + @Nonnull final String scenario, + @Nonnull final String version, + @Nonnull final String name ) + throws OpenApiRequestException + { + return listPromptTemplateHistory(scenario, version, name, null, null); + } + + /** + *

*

* List prompt templates - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param aiResourceGroup * (optional) Specify a resource group id to use @@ -701,22 +819,40 @@ public PromptTemplateListResponse listPromptTemplates( /** *

- *

+ *

+ * List prompt templates + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @return PromptTemplateListResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplateListResponse listPromptTemplates() + throws OpenApiRequestException + { + return listPromptTemplates(null, null, null, null, null, null, null); + } + + /** + *

*

* Parse prompt template by ID - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param promptTemplateId * (required) The value for the parameter promptTemplateId @@ -797,22 +933,42 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( /** *

- *

+ *

+ * Parse prompt template by ID + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param promptTemplateId + * The value for the parameter promptTemplateId + * @return PromptTemplateSubstitutionResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplateSubstitutionResponse parsePromptTemplateById( @Nonnull final UUID promptTemplateId ) + throws OpenApiRequestException + { + return parsePromptTemplateById(promptTemplateId, null, null, null, null); + } + + /** + *

*

* Parse prompt template by name and version - *

*

* 200 - Successful response - *

*

* 400 - Bad Request - *

*

* 403 - Forbidden Error - *

*

* 0 - Common Error - *

* * @param scenario * (required) The value for the parameter scenario @@ -909,4 +1065,37 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( localVarContentType, localVarReturnType); } + + /** + *

+ *

+ * Parse prompt template by name and version + *

+ * 200 - Successful response + *

+ * 400 - Bad Request + *

+ * 403 - Forbidden Error + *

+ * 0 - Common Error + * + * @param scenario + * The value for the parameter scenario + * @param version + * The value for the parameter version + * @param name + * The value for the parameter name + * @return PromptTemplateSubstitutionResponse + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( + @Nonnull final String scenario, + @Nonnull final String version, + @Nonnull final String name ) + throws OpenApiRequestException + { + return parsePromptTemplateByNameVersion(scenario, version, name, null, null, null, null); + } } diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 4f1221165..1c7c2559b 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -101,21 +101,58 @@ public class {{classname}} extends BaseApi { {{/aiSdkConstructor}} {{#operation}} + {{#hasOptionalParams}} + /** + *

{{summary}} + *

{{notes}} + {{#responses}} + *

{{code}}{{#message}} - {{message}}{{/message}} + {{/responses}} + {{#allParams}} + * @param {{paramName}} {{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + {{#description}} + * {{description}} + {{/description}} + {{^description}} + * The value for the parameter {{paramName}} + {{/description}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + {{#vendorExtensions.x-return-nullable}}@Nullable{{/vendorExtensions.x-return-nullable}}{{^vendorExtensions.x-return-nullable}}@Nonnull{{/vendorExtensions.x-return-nullable}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { + {{>operationBody}} + } + {{/hasOptionalParams}} + /** - * {{summary}} - * {{notes}} + *

{{summary}} + *

{{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}}

+ *

{{code}}{{#message}} - {{message}}{{/message}} {{/responses}} - {{#allParams}} - * @param {{paramName}} {{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} - {{#description}} - {{description}} - {{/description}} - {{^description}} - The value for the parameter {{paramName}} - {{/description}} - {{/allParams}} + {{#requiredParams}} + * @param {{paramName}} + {{#description}} + * {{description}} + {{/description}} + {{^description}} + * The value for the parameter {{paramName}} + {{/description}} + {{/requiredParams}} {{#returnType}} * @return {{returnType}} {{/returnType}} @@ -125,109 +162,21 @@ public class {{classname}} extends BaseApi { * @see {{summary}} Documentation {{/externalDocs}} {{#isDeprecated}} - * @deprecated + * @deprecated {{/isDeprecated}} */ {{#isDeprecated}} @Deprecated {{/isDeprecated}} {{#vendorExtensions.x-return-nullable}}@Nullable{{/vendorExtensions.x-return-nullable}}{{^vendorExtensions.x-return-nullable}}@Nonnull{{/vendorExtensions.x-return-nullable}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) { - throw new OpenApiRequestException("Missing the required parameter '{{paramName}}' when calling {{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}") - .statusCode(400); - } - {{/required}}{{/allParams}} - // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", ApiClient.escapeString(ApiClient.parameterToString({{{paramName}}}))){{/pathParams}}; - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - {{#queryParams}} - {{#isDeepObject}} - localVarQueryParameterBaseName = "{{{baseName}}}"; - {{#isArray}} - for (int i=0; i < {{paramName}}.size(); i++) { - localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format(Locale.ROOT, "{{baseName}}[%d]", i))); - } - {{/isArray}} - {{^isArray}} - localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}")); - {{/isArray}} - {{/isDeepObject}} - {{^isDeepObject}} - {{#isExplode}} - {{#hasVars}} - {{#vars}} - {{#isArray}} - localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); - {{/isArray}} - {{^isArray}} - localVarQueryParams.addAll(ApiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); - {{/isArray}} - {{/vars}} - {{/hasVars}} - {{^hasVars}} - {{#isModel}} - localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); - {{/isModel}} - {{^isModel}} - {{#collectionFormat}}localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(ApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); - {{/isModel}} - {{/hasVars}} - {{/isExplode}} - {{^isExplode}} - {{#collectionFormat}}localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(ApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); - {{/isExplode}} - {{/isDeepObject}} - {{/queryParams}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", ApiClient.parameterToString({{paramName}})); - {{/headerParams}} - - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); - {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - {{#returnType}} - TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; - return apiClient.invokeAPI( - {{/returnType}} - {{^returnType}} - apiClient.invokeAPI( - {{/returnType}} - localVarPath, - "{{httpMethod}}", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} - ); - } + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#requiredParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) throws OpenApiRequestException { + {{#hasOptionalParams}} + {{#returnType}}return {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#hasRequiredParams}}{{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}, {{/hasRequiredParams}}{{#optionalParams}}null{{^-last}}, {{/-last}}{{/optionalParams}}); + {{/hasOptionalParams}} + {{^hasOptionalParams}} + {{>operationBody}} + {{/hasOptionalParams}} + } {{/operation}} } {{/operations}} \ No newline at end of file diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache new file mode 100644 index 000000000..c12e869ad --- /dev/null +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache @@ -0,0 +1,94 @@ +Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; +{{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new OpenApiRequestException("Missing the required parameter '{{paramName}}' when calling {{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}") + .statusCode(400); + } +{{/required}}{{/allParams}} +// create path and map variables +String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll("\\{" + "{{baseName}}" + "\\}", ApiClient.escapeString(ApiClient.parameterToString({{{paramName}}}))){{/pathParams}}; + +StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); +String localVarQueryParameterBaseName; +List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + {{#queryParams}} + {{#isDeepObject}} + localVarQueryParameterBaseName = "{{{baseName}}}"; + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format(Locale.ROOT, "{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}")); + {{/isArray}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} + {{#collectionFormat}}localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(ApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} + {{#collectionFormat}}localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(ApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isExplode}} + {{/isDeepObject}} + {{/queryParams}} + {{#headerParams}}if ({{paramName}} != null) + localVarHeaderParams.put("{{baseName}}", ApiClient.parameterToString({{paramName}})); + {{/headerParams}} + + {{#formParams}}if ({{paramName}} != null) + localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/formParams}} + + final String[] localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + }; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + }; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + {{#returnType}} + TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; + return apiClient.invokeAPI( + {{/returnType}} + {{^returnType}} + apiClient.invokeAPI( + {{/returnType}} + localVarPath, + "{{httpMethod}}", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} + ); \ No newline at end of file From e1390af936995507f72592fbf8a28c88b0065c4b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 29 Dec 2025 16:24:40 +0100 Subject: [PATCH 20/25] Apache mustache parity and object mapper config - final on local vars --- .../sample/api/OrchestrationConfigsApi.java | 112 ++++++------ .../apache/sample/api/PromptTemplatesApi.java | 169 +++++++++--------- .../services/openapi/apache/ApiClient.java | 35 ++-- .../apache-httpclient/operationBody.mustache | 18 +- 4 files changed, 173 insertions(+), 161 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java index 280347cdf..3a837ce6f 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java @@ -94,7 +94,7 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( @Nullable final String aiResourceGroup ) throws OpenApiRequestException { - Object localVarPostBody = orchestrationConfigPostRequest; + final Object localVarPostBody = orchestrationConfigPostRequest; // verify the required parameter 'orchestrationConfigPostRequest' is set if( orchestrationConfigPostRequest == null ) { @@ -104,14 +104,14 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( } // create path and map variables - String localVarPath = "/registry/v2/orchestrationConfigs"; + final String localVarPath = "/registry/v2/orchestrationConfigs"; - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -122,7 +122,7 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -195,7 +195,7 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( deleteOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'orchestrationConfigId' is set if( orchestrationConfigId == null ) { @@ -205,18 +205,18 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( } // create path and map variables - String localVarPath = + final String localVarPath = "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -229,7 +229,7 @@ public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -299,7 +299,7 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @Nonnull fin exportOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'orchestrationConfigId' is set if( orchestrationConfigId == null ) { @@ -309,18 +309,18 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @Nonnull fin } // create path and map variables - String localVarPath = + final String localVarPath = "/registry/v2/orchestrationConfigs/{orchestrationConfigId}/export" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -333,7 +333,7 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @Nonnull fin }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() + final TypeReference localVarReturnType = new TypeReference() { }; return apiClient @@ -405,7 +405,7 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nullable final Boolean resolveTemplateRef ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'orchestrationConfigId' is set if( orchestrationConfigId == null ) { @@ -415,18 +415,18 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( } // create path and map variables - String localVarPath = + final String localVarPath = "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" .replaceAll( "\\{" + "orchestrationConfigId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); if( aiResourceGroup != null ) @@ -440,7 +440,7 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -510,17 +510,17 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull fin importOrchestrationConfig( @Nullable final String aiResourceGroup, @Nullable final File _file ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/registry/v2/orchestrationConfigs/import"; + final String localVarPath = "/registry/v2/orchestrationConfigs/import"; - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -534,7 +534,7 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull fin final String[] localVarContentTypes = { "multipart/form-data" }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -614,7 +614,7 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( @Nullable final Boolean resolveTemplateRef ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'scenario' is set if( scenario == null ) { @@ -636,18 +636,18 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( } // create path and map variables - String localVarPath = + final String localVarPath = "/registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history" .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiClient.parameterToPair("include_spec", includeSpec)); localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); @@ -662,7 +662,7 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -756,17 +756,17 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( @Nullable final Boolean resolveTemplateRef ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/registry/v2/orchestrationConfigs"; + final String localVarPath = "/registry/v2/orchestrationConfigs"; - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiClient.parameterToPair("scenario", scenario)); localVarQueryParams.addAll(ApiClient.parameterToPair("name", name)); @@ -785,7 +785,7 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java index 14609059c..c8bcac355 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java @@ -99,7 +99,7 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { - Object localVarPostBody = promptTemplatePostRequest; + final Object localVarPostBody = promptTemplatePostRequest; // verify the required parameter 'promptTemplatePostRequest' is set if( promptTemplatePostRequest == null ) { @@ -109,14 +109,14 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( } // create path and map variables - String localVarPath = "/lm/promptTemplates"; + final String localVarPath = "/lm/promptTemplates"; - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -129,9 +129,10 @@ public PromptTemplatePostResponse createUpdatePromptTemplate( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() - { - }; + final TypeReference localVarReturnType = + new TypeReference() + { + }; return apiClient .invokeAPI( localVarPath, @@ -204,7 +205,7 @@ public PromptTemplateDeleteResponse deletePromptTemplate( @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { @@ -213,18 +214,18 @@ public PromptTemplateDeleteResponse deletePromptTemplate( } // create path and map variables - String localVarPath = + final String localVarPath = "/lm/promptTemplates/{promptTemplateId}" .replaceAll( "\\{" + "promptTemplateId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -239,7 +240,7 @@ public PromptTemplateDeleteResponse deletePromptTemplate( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -312,7 +313,7 @@ public File exportPromptTemplate( @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { @@ -321,18 +322,18 @@ public File exportPromptTemplate( } // create path and map variables - String localVarPath = + final String localVarPath = "/lm/promptTemplates/{promptTemplateId}/export" .replaceAll( "\\{" + "promptTemplateId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -347,7 +348,7 @@ public File exportPromptTemplate( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() + final TypeReference localVarReturnType = new TypeReference() { }; return apiClient @@ -419,7 +420,7 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { @@ -429,18 +430,18 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( } // create path and map variables - String localVarPath = + final String localVarPath = "/lm/promptTemplates/{promptTemplateId}" .replaceAll( "\\{" + "promptTemplateId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -455,9 +456,10 @@ public PromptTemplateGetResponse getPromptTemplateByUuid( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() - { - }; + final TypeReference localVarReturnType = + new TypeReference() + { + }; return apiClient .invokeAPI( localVarPath, @@ -527,17 +529,17 @@ public PromptTemplatePostResponse importPromptTemplate( @Nullable final File _file ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/lm/promptTemplates/import"; + final String localVarPath = "/lm/promptTemplates/import"; - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -553,9 +555,10 @@ public PromptTemplatePostResponse importPromptTemplate( final String[] localVarContentTypes = { "multipart/form-data" }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() - { - }; + final TypeReference localVarReturnType = + new TypeReference() + { + }; return apiClient .invokeAPI( localVarPath, @@ -629,7 +632,7 @@ public PromptTemplateListResponse listPromptTemplateHistory( @Nullable final String aiResourceGroupScope ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // verify the required parameter 'scenario' is set if( scenario == null ) { @@ -650,18 +653,18 @@ public PromptTemplateListResponse listPromptTemplateHistory( } // create path and map variables - String localVarPath = + final String localVarPath = "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history" .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); if( aiResourceGroup != null ) localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); @@ -676,9 +679,10 @@ public PromptTemplateListResponse listPromptTemplateHistory( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() - { - }; + final TypeReference localVarReturnType = + new TypeReference() + { + }; return apiClient .invokeAPI( localVarPath, @@ -769,17 +773,17 @@ public PromptTemplateListResponse listPromptTemplates( @Nullable final Boolean includeSpec ) throws OpenApiRequestException { - Object localVarPostBody = null; + final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/lm/promptTemplates"; + final String localVarPath = "/lm/promptTemplates"; - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiClient.parameterToPair("scenario", scenario)); localVarQueryParams.addAll(ApiClient.parameterToPair("name", name)); @@ -799,9 +803,10 @@ public PromptTemplateListResponse listPromptTemplates( }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = new TypeReference() - { - }; + final TypeReference localVarReturnType = + new TypeReference() + { + }; return apiClient .invokeAPI( localVarPath, @@ -877,7 +882,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( @Nullable final PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) throws OpenApiRequestException { - Object localVarPostBody = promptTemplateSubstitutionRequest; + final Object localVarPostBody = promptTemplateSubstitutionRequest; // verify the required parameter 'promptTemplateId' is set if( promptTemplateId == null ) { @@ -887,18 +892,18 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( } // create path and map variables - String localVarPath = + final String localVarPath = "/lm/promptTemplates/{promptTemplateId}/substitution" .replaceAll( "\\{" + "promptTemplateId" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiClient.parameterToPair("metadata", metadata)); if( aiResourceGroup != null ) @@ -912,7 +917,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateById( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; @@ -999,7 +1004,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( @Nullable final PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) throws OpenApiRequestException { - Object localVarPostBody = promptTemplateSubstitutionRequest; + final Object localVarPostBody = promptTemplateSubstitutionRequest; // verify the required parameter 'scenario' is set if( scenario == null ) { @@ -1022,18 +1027,18 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( } // create path and map variables - String localVarPath = + final String localVarPath = "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution" .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiClient.parameterToPair("metadata", metadata)); if( aiResourceGroup != null ) @@ -1047,7 +1052,7 @@ public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - TypeReference localVarReturnType = + final TypeReference localVarReturnType = new TypeReference() { }; diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 40b64df8f..78cb9a4d7 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -12,8 +12,13 @@ package com.sap.cloud.sdk.services.openapi.apache; +import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; +import static com.fasterxml.jackson.annotation.PropertyAccessor.GETTER; +import static com.fasterxml.jackson.annotation.PropertyAccessor.SETTER; +import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES; +import static com.fasterxml.jackson.databind.MapperFeature.DEFAULT_VIEW_INCLUSION; +import static com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS; import static com.sap.cloud.sdk.services.openapi.apache.DefaultApiResponseHandler.isJsonMime; -import static lombok.AccessLevel.NONE; import static lombok.AccessLevel.PRIVATE; import java.io.File; @@ -48,12 +53,12 @@ import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; import org.apache.hc.core5.http.message.BasicNameValuePair; +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.common.annotations.Beta; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; @@ -61,13 +66,14 @@ import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Value; import lombok.With; @Value -@Getter( NONE ) +@Getter( AccessLevel.NONE ) @AllArgsConstructor( access = PRIVATE ) public class ApiClient { @@ -109,16 +115,17 @@ public static ApiClient create() private static ObjectMapper createDefaultObjectMapper() { - var jackson = new ObjectMapper(); - jackson.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); - jackson.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - jackson.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); - jackson.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - jackson.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - jackson.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - jackson.registerModule(new JavaTimeModule()); - jackson.setDateFormat(new RFC3339DateFormat()); - return jackson; + return JsonMapper + .builder() + .addModule(new JavaTimeModule()) + .defaultDateFormat(new RFC3339DateFormat()) + .visibility(GETTER, Visibility.NONE) + .visibility(SETTER, Visibility.NONE) + .defaultPropertyInclusion(JsonInclude.Value.construct(NON_NULL, NON_NULL)) + .disable(FAIL_ON_UNKNOWN_PROPERTIES) + .disable(DEFAULT_VIEW_INCLUSION) + .disable(WRITE_DATES_AS_TIMESTAMPS) + .build(); } /** diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache index c12e869ad..8d92947dc 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache @@ -1,4 +1,4 @@ -Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; +final Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { @@ -7,15 +7,15 @@ Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam} } {{/required}}{{/allParams}} // create path and map variables -String localVarPath = "{{{path}}}"{{#pathParams}} +final String localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", ApiClient.escapeString(ApiClient.parameterToString({{{paramName}}}))){{/pathParams}}; -StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); +final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; -List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); +final List localVarQueryParams = new ArrayList(); +final List localVarCollectionQueryParams = new ArrayList(); +final Map localVarHeaderParams = new HashMap(); +final Map localVarFormParams = new HashMap(); {{#queryParams}} {{#isDeepObject}} @@ -74,7 +74,7 @@ List localVarQueryParams = new ArrayList(); final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); {{#returnType}} - TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; + final TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; return apiClient.invokeAPI( {{/returnType}} {{^returnType}} @@ -91,4 +91,4 @@ List localVarQueryParams = new ArrayList(); localVarAccept, localVarContentType, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} - ); \ No newline at end of file + ); From 97c5e0317cf5de375536c03ec35c0c868b88e629 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 30 Dec 2025 10:43:56 +0100 Subject: [PATCH 21/25] Revert to sodastore generation in sample --- .../openapi/openapi-api-apache-sample/pom.xml | 2 +- .../sample/api/OrchestrationConfigsApi.java | 830 ------- .../openapi/apache/sample/api/OrdersApi.java | 121 + .../apache/sample/api/PromptTemplatesApi.java | 1106 --------- .../openapi/apache/sample/api/SodasApi.java | 310 +++ .../openapi/apache/sample/model/AllOf.java | 413 ++++ .../openapi/apache/sample/model/AnyOf.java | 413 ++++ .../sample/model/AssistantChatMessage.java | 414 ---- .../sample/model/AzureContentSafetyInput.java | 371 --- .../AzureContentSafetyInputFilterConfig.java | 312 --- .../model/AzureContentSafetyOutput.java | 374 --- .../AzureContentSafetyOutputFilterConfig.java | 312 --- .../apache/sample/model/AzureThreshold.java | 86 - .../{ResponseFormatText.java => Bar.java} | 135 +- .../sample/model/ChatCompletionTool.java | 309 --- .../apache/sample/model/ChatMessage.java | 36 - .../openapi/apache/sample/model/Cola.java | 327 +++ ...atMessageContent.java => ColaBarCode.java} | 25 +- ...rChatMessageContent.java => ColaLogo.java} | 25 +- .../apache/sample/model/DPIConfig.java | 545 ----- .../model/DPIConfigMaskGroundingInput.java | 202 -- .../apache/sample/model/DPICustomEntity.java | 241 -- .../apache/sample/model/DPIEntities.java | 130 -- .../sample/model/DPIMethodConstant.java | 309 --- .../sample/model/DPIMethodFabricatedData.java | 267 --- .../sample/model/DPIStandardEntity.java | 242 -- .../DPIStandardEntityReplacementStrategy.java | 33 - .../sample/model/DataRepositoryType.java | 82 - .../sample/model/DeveloperChatMessage.java | 309 --- .../sample/model/DocumentGroundingFilter.java | 546 ----- .../apache/sample/model/ErrorResponse.java | 241 -- .../{KeyValueListPair.java => Fanta.java} | 162 +- .../apache/sample/model/FantaFlavor.java | 108 + .../sample/model/FilteringModuleConfig.java | 241 -- .../sample/model/FilteringStreamOptions.java | 202 -- .../{ImageContentUrl.java => FlavorType.java} | 116 +- ...ResponseFormatJsonObject.java => Foo.java} | 136 +- .../apache/sample/model/FunctionObject.java | 370 --- .../sample/model/GlobalStreamOptions.java | 308 --- .../GroundingFilterSearchConfiguration.java | 251 -- .../sample/model/GroundingModuleConfig.java | 309 --- .../model/GroundingModuleConfigConfig.java | 323 --- ...oundingModuleConfigConfigFiltersInner.java | 31 - ...oundingModuleConfigConfigPlaceholders.java | 263 --- .../apache/sample/model/ImageContent.java | 309 --- .../sample/model/ImageContentImageUrl.java | 241 -- .../sample/model/InputFilteringConfig.java | 219 -- .../apache/sample/model/LLMModelDetails.java | 397 ---- .../apache/sample/model/LlamaGuard38b.java | 773 ------- .../model/LlamaGuard38bFilterConfig.java | 310 --- .../MaskingModuleConfigMaskingProviders.java | 226 -- .../model/MaskingModuleConfigProviders.java | 218 -- .../apache/sample/model/MessageToolCall.java | 352 --- .../sample/model/MessageToolCallFunction.java | 248 -- .../apache/sample/model/ModuleConfigs.java | 370 --- .../sample/model/MultiChatTemplate.java | 260 --- .../{MultiChatContent.java => OneOf.java} | 10 +- ...onfig.java => OneOfWithDiscriminator.java} | 15 +- ... => OneOfWithDiscriminatorAndMapping.java} | 15 +- ...g.java => OneOfWithEnumDiscriminator.java} | 15 +- .../sample/model/OrchestrationConfig.java | 241 -- .../OrchestrationConfigDeleteResponse.java | 201 -- .../model/OrchestrationConfigGetResponse.java | 555 ----- .../OrchestrationConfigListResponse.java | 262 --- .../model/OrchestrationConfigPostRequest.java | 328 --- .../OrchestrationConfigPostResponse.java | 372 --- .../model/OrchestrationConfigResource.java | 555 ----- .../openapi/apache/sample/model/Order.java | 370 +++ .../sample/model/OrderWithTimestamp.java | 415 ++++ .../sample/model/OutputFilterConfig.java | 33 - .../sample/model/OutputFilteringConfig.java | 262 --- .../apache/sample/model/PromptTemplate.java | 33 - .../model/PromptTemplateDeleteResponse.java | 199 -- .../model/PromptTemplateGetResponse.java | 555 ----- .../model/PromptTemplateListResponse.java | 261 --- .../model/PromptTemplatePostRequest.java | 328 --- .../model/PromptTemplatePostResponse.java | 372 --- .../sample/model/PromptTemplateSpec.java | 411 ---- .../PromptTemplateSpecResponseFormat.java | 35 - .../PromptTemplateSubstitutionRequest.java | 201 -- .../PromptTemplateSubstitutionResponse.java | 263 --- .../model/PromptTemplatingModuleConfig.java | 242 -- .../PromptTemplatingModuleConfigPrompt.java | 32 - .../model/ResponseFormatJsonSchema.java | 310 --- .../ResponseFormatJsonSchemaJsonSchema.java | 366 --- .../model/RuntimeOrchestrationConfigFile.java | 328 --- .../model/RuntimePromptTemplateFile.java | 328 --- .../RuntimePromptTemplateFileMetadata.java | 287 --- ...SAPDocumentTranslationApplyToSelector.java | 384 ---- .../model/SAPDocumentTranslationInput.java | 355 --- .../SAPDocumentTranslationInputConfig.java | 308 --- .../model/SAPDocumentTranslationOutput.java | 310 --- .../SAPDocumentTranslationOutputConfig.java | 245 -- ...cumentTranslationOutputTargetLanguage.java | 69 - .../model/SearchDocumentKeyValueListPair.java | 321 --- .../sample/model/SearchSelectOptionEnum.java | 80 - .../sample/model/SingleChatTemplate.java | 241 -- .../openapi/apache/sample/model/Soda.java | 448 ++++ .../apache/sample/model/SodaWithId.java | 491 ++++ .../sample/model/SystemChatMessage.java | 309 --- .../openapi/apache/sample/model/Template.java | 389 ---- .../apache/sample/model/TemplateRef.java | 198 -- .../apache/sample/model/TemplateRefByID.java | 322 --- .../TemplateRefByScenarioNameVersion.java | 409 ---- .../sample/model/TemplateRefTemplateRef.java | 33 - .../sample/model/TemplateResponseFormat.java | 34 - .../apache/sample/model/TextContent.java | 309 --- .../apache/sample/model/ToolChatMessage.java | 352 --- .../sample/model/TranslationModuleConfig.java | 242 -- .../apache/sample/model/UserChatMessage.java | 309 --- .../model/UserChatMessageContentItem.java | 358 --- .../src/main/resources/prompt-registry.yaml | 2026 ----------------- 112 files changed, 3800 insertions(+), 28753 deletions(-) delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{ResponseFormatText.java => Bar.java} (62%) delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{ChatMessageContent.java => ColaBarCode.java} (60%) rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{UserChatMessageContent.java => ColaLogo.java} (55%) delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{KeyValueListPair.java => Fanta.java} (50%) create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{ImageContentUrl.java => FlavorType.java} (56%) rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{ResponseFormatJsonObject.java => Foo.java} (61%) delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{MultiChatContent.java => OneOf.java} (67%) rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{MaskingModuleConfig.java => OneOfWithDiscriminator.java} (57%) rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{DPIEntityConfig.java => OneOfWithDiscriminatorAndMapping.java} (55%) rename datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/{InputFilterConfig.java => OneOfWithEnumDiscriminator.java} (57%) delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java create mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java delete mode 100644 datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml diff --git a/datamodel/openapi/openapi-api-apache-sample/pom.xml b/datamodel/openapi/openapi-api-apache-sample/pom.xml index a58123553..0092dbf29 100644 --- a/datamodel/openapi/openapi-api-apache-sample/pom.xml +++ b/datamodel/openapi/openapi-api-apache-sample/pom.xml @@ -57,7 +57,7 @@ generate-sources - ${project.basedir}/src/main/resources/prompt-registry.yaml + ${project.basedir}/src/main/resources/sodastore.yaml com.sap.cloud.sdk.datamodel.openapi.apache.sample.api com.sap.cloud.sdk.datamodel.openapi.apache.sample.model diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java deleted file mode 100644 index 3a837ce6f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrchestrationConfigsApi.java +++ /dev/null @@ -1,830 +0,0 @@ -/* -* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. -*/ - -package com.sap.cloud.sdk.datamodel.openapi.apache.sample.api; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigDeleteResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigGetResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigListResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigPostRequest; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.OrchestrationConfigPostResponse; -import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Pair; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; - -/** - * Prompt Registry API in version 0.0.1. - * - * Prompt Storage service for Design time & Runtime prompt templates. - */ -@Beta -public class OrchestrationConfigsApi extends BaseApi -{ - - /** - * Instantiates this API class to invoke operations on the Prompt Registry API - */ - public OrchestrationConfigsApi() - { - } - - /** - * Instantiates this API class to invoke operations on the Prompt Registry API. - * - * @param httpDestination - * The destination that API should be used with - */ - public OrchestrationConfigsApi( @Nonnull final Destination httpDestination ) - { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the Prompt Registry API based on a given {@link ApiClient}. - * - * @param apiClient - * ApiClient to invoke the API on - */ - @Beta - public OrchestrationConfigsApi( @Nonnull final ApiClient apiClient ) - { - super(apiClient); - } - - /** - *

- *

- * Create or update an orchestration config - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param orchestrationConfigPostRequest - * (required) The value for the parameter orchestrationConfigPostRequest - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @return OrchestrationConfigPostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( - @Nonnull final OrchestrationConfigPostRequest orchestrationConfigPostRequest, - @Nullable final String aiResourceGroup ) - throws OpenApiRequestException - { - final Object localVarPostBody = orchestrationConfigPostRequest; - - // verify the required parameter 'orchestrationConfigPostRequest' is set - if( orchestrationConfigPostRequest == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'orchestrationConfigPostRequest' when calling createUpdateOrchestrationConfig") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = "/registry/v2/orchestrationConfigs"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Create or update an orchestration config - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param orchestrationConfigPostRequest - * The value for the parameter orchestrationConfigPostRequest - * @return OrchestrationConfigPostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigPostResponse createUpdateOrchestrationConfig( - @Nonnull final OrchestrationConfigPostRequest orchestrationConfigPostRequest ) - throws OpenApiRequestException - { - return createUpdateOrchestrationConfig(orchestrationConfigPostRequest, null); - } - - /** - *

- *

- * Delete orchestration config - *

- * 200 - Successful response - *

- * 403 - Forbidden Error - *

- * 404 - Bad Request - *

- * 0 - Common Error - * - * @param orchestrationConfigId - * (required) The value for the parameter orchestrationConfigId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @return OrchestrationConfigDeleteResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public - OrchestrationConfigDeleteResponse - deleteOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'orchestrationConfigId' is set - if( orchestrationConfigId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'orchestrationConfigId' when calling deleteOrchestrationConfig") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" - .replaceAll( - "\\{" + "orchestrationConfigId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Delete orchestration config - *

- * 200 - Successful response - *

- * 403 - Forbidden Error - *

- * 404 - Bad Request - *

- * 0 - Common Error - * - * @param orchestrationConfigId - * The value for the parameter orchestrationConfigId - * @return OrchestrationConfigDeleteResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( @Nonnull final UUID orchestrationConfigId ) - throws OpenApiRequestException - { - return deleteOrchestrationConfig(orchestrationConfigId, null); - } - - /** - *

- *

- * Export orchestration config - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @param orchestrationConfigId - * (required) The value for the parameter orchestrationConfigId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @return File - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public - File - exportOrchestrationConfig( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'orchestrationConfigId' is set - if( orchestrationConfigId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'orchestrationConfigId' when calling exportOrchestrationConfig") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/registry/v2/orchestrationConfigs/{orchestrationConfigId}/export" - .replaceAll( - "\\{" + "orchestrationConfigId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - - final String[] localVarAccepts = { "application/octet-stream", "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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Export orchestration config - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @param orchestrationConfigId - * The value for the parameter orchestrationConfigId - * @return File - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public File exportOrchestrationConfig( @Nonnull final UUID orchestrationConfigId ) - throws OpenApiRequestException - { - return exportOrchestrationConfig(orchestrationConfigId, null); - } - - /** - *

- *

- * Get orchestration config by UUID - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param orchestrationConfigId - * (required) The value for the parameter orchestrationConfigId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param resolveTemplateRef - * (optional, default to false) The value for the parameter resolveTemplateRef - * @return OrchestrationConfigGetResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( - @Nonnull final UUID orchestrationConfigId, - @Nullable final String aiResourceGroup, - @Nullable final Boolean resolveTemplateRef ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'orchestrationConfigId' is set - if( orchestrationConfigId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'orchestrationConfigId' when calling getOrchestrationConfigByUuid") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/registry/v2/orchestrationConfigs/{orchestrationConfigId}" - .replaceAll( - "\\{" + "orchestrationConfigId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(orchestrationConfigId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Get orchestration config by UUID - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param orchestrationConfigId - * The value for the parameter orchestrationConfigId - * @return OrchestrationConfigGetResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull final UUID orchestrationConfigId ) - throws OpenApiRequestException - { - return getOrchestrationConfigByUuid(orchestrationConfigId, null, null); - } - - /** - *

- *

- * Import orchestration config - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param _file - * (optional) The value for the parameter _file - * @return OrchestrationConfigPostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public - OrchestrationConfigPostResponse - importOrchestrationConfig( @Nullable final String aiResourceGroup, @Nullable final File _file ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // create path and map variables - final String localVarPath = "/registry/v2/orchestrationConfigs/import"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - - if( _file != null ) - localVarFormParams.put("file", _file); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "multipart/form-data" }; - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Import orchestration config - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @return OrchestrationConfigPostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigPostResponse importOrchestrationConfig() - throws OpenApiRequestException - { - return importOrchestrationConfig(null, null); - } - - /** - *

- *

- * List orchestration config history - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param scenario - * (required) The value for the parameter scenario - * @param version - * (required) The value for the parameter version - * @param name - * (required) The value for the parameter name - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param includeSpec - * (optional, default to false) The value for the parameter includeSpec - * @param resolveTemplateRef - * (optional, default to false) The value for the parameter resolveTemplateRef - * @return OrchestrationConfigListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigListResponse listOrchestrationConfigHistory( - @Nonnull final String scenario, - @Nonnull final String version, - @Nonnull final String name, - @Nullable final String aiResourceGroup, - @Nullable final Boolean includeSpec, - @Nullable final Boolean resolveTemplateRef ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'scenario' is set - if( scenario == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'scenario' when calling listOrchestrationConfigHistory") - .statusCode(400); - } - - // verify the required parameter 'version' is set - if( version == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'version' when calling listOrchestrationConfigHistory").statusCode(400); - } - - // verify the required parameter 'name' is set - if( name == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'name' when calling listOrchestrationConfigHistory").statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history" - .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("include_spec", includeSpec)); - localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * List orchestration config history - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param scenario - * The value for the parameter scenario - * @param version - * The value for the parameter version - * @param name - * The value for the parameter name - * @return OrchestrationConfigListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigListResponse listOrchestrationConfigHistory( - @Nonnull final String scenario, - @Nonnull final String version, - @Nonnull final String name ) - throws OpenApiRequestException - { - return listOrchestrationConfigHistory(scenario, version, name, null, null, null); - } - - /** - *

- *

- * List orchestration configs - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param scenario - * (optional) The value for the parameter scenario - * @param name - * (optional) The value for the parameter name - * @param version - * (optional) The value for the parameter version - * @param retrieve - * (optional, default to both) The value for the parameter retrieve - * @param includeSpec - * (optional, default to false) The value for the parameter includeSpec - * @param resolveTemplateRef - * (optional, default to false) The value for the parameter resolveTemplateRef - * @return OrchestrationConfigListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigListResponse listOrchestrationConfigs( - @Nullable final String aiResourceGroup, - @Nullable final String scenario, - @Nullable final String name, - @Nullable final String version, - @Nullable final String retrieve, - @Nullable final Boolean includeSpec, - @Nullable final Boolean resolveTemplateRef ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // create path and map variables - final String localVarPath = "/registry/v2/orchestrationConfigs"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("scenario", scenario)); - localVarQueryParams.addAll(ApiClient.parameterToPair("name", name)); - localVarQueryParams.addAll(ApiClient.parameterToPair("version", version)); - localVarQueryParams.addAll(ApiClient.parameterToPair("retrieve", retrieve)); - localVarQueryParams.addAll(ApiClient.parameterToPair("include_spec", includeSpec)); - localVarQueryParams.addAll(ApiClient.parameterToPair("resolve_template_ref", resolveTemplateRef)); - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * List orchestration configs - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @return OrchestrationConfigListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public OrchestrationConfigListResponse listOrchestrationConfigs() - throws OpenApiRequestException - { - return listOrchestrationConfigs(null, null, null, null, null, null, null); - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java new file mode 100644 index 000000000..4b30d9a4c --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. +*/ + +package com.sap.cloud.sdk.datamodel.openapi.apache.sample.api; + +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 com.fasterxml.jackson.core.type.TypeReference; +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Order; +import com.sap.cloud.sdk.services.openapi.apache.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.Pair; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; + +/** + * SodaStore API in version 1.0.0. + * + * API for managing soda products and orders in SodaStore. + */ +@Beta +public class OrdersApi extends BaseApi +{ + + /** + * Instantiates this API class to invoke operations on the SodaStore API + */ + public OrdersApi() + { + } + + /** + * Instantiates this API class to invoke operations on the SodaStore API. + * + * @param httpDestination + * The destination that API should be used with + */ + public OrdersApi( @Nonnull final Destination httpDestination ) + { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link ApiClient}. + * + * @param apiClient + * ApiClient to invoke the API on + */ + @Beta + public OrdersApi( @Nonnull final ApiClient apiClient ) + { + super(apiClient); + } + + /** + *

+ * Create a new order + *

+ *

+ * 201 - The created order + * + * @param order + * The order details + * @return Order + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public Order ordersPost( @Nonnull final Order order ) + throws OpenApiRequestException + { + final Object localVarPostBody = order; + + // verify the required parameter 'order' is set + if( order == null ) { + throw new OpenApiRequestException("Missing the required parameter 'order' when calling ordersPost") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/orders"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + 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(), + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java deleted file mode 100644 index c8bcac355..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/PromptTemplatesApi.java +++ /dev/null @@ -1,1106 +0,0 @@ -/* -* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. -*/ - -package com.sap.cloud.sdk.datamodel.openapi.apache.sample.api; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.common.annotations.Beta; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateDeleteResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateGetResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateListResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplatePostRequest; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplatePostResponse; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateSubstitutionRequest; -import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.PromptTemplateSubstitutionResponse; -import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Pair; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; - -/** - * Prompt Registry API in version 0.0.1. - * - * Prompt Storage service for Design time & Runtime prompt templates. - */ -@Beta -public class PromptTemplatesApi extends BaseApi -{ - - /** - * Instantiates this API class to invoke operations on the Prompt Registry API - */ - public PromptTemplatesApi() - { - } - - /** - * Instantiates this API class to invoke operations on the Prompt Registry API. - * - * @param httpDestination - * The destination that API should be used with - */ - public PromptTemplatesApi( @Nonnull final Destination httpDestination ) - { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the Prompt Registry API based on a given {@link ApiClient}. - * - * @param apiClient - * ApiClient to invoke the API on - */ - @Beta - public PromptTemplatesApi( @Nonnull final ApiClient apiClient ) - { - super(apiClient); - } - - /** - *

- *

- * Create or update a prompt template - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param promptTemplatePostRequest - * (required) The value for the parameter promptTemplatePostRequest - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @return PromptTemplatePostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplatePostResponse createUpdatePromptTemplate( - @Nonnull final PromptTemplatePostRequest promptTemplatePostRequest, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope ) - throws OpenApiRequestException - { - final Object localVarPostBody = promptTemplatePostRequest; - - // verify the required parameter 'promptTemplatePostRequest' is set - if( promptTemplatePostRequest == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'promptTemplatePostRequest' when calling createUpdatePromptTemplate") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = "/lm/promptTemplates"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Create or update a prompt template - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param promptTemplatePostRequest - * The value for the parameter promptTemplatePostRequest - * @return PromptTemplatePostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplatePostResponse createUpdatePromptTemplate( - @Nonnull final PromptTemplatePostRequest promptTemplatePostRequest ) - throws OpenApiRequestException - { - return createUpdatePromptTemplate(promptTemplatePostRequest, null, null); - } - - /** - *

- *

- * Delete prompt template - *

- * 200 - Successful response - *

- * 403 - Forbidden Error - *

- * 404 - Bad Request - *

- * 0 - Common Error - * - * @param promptTemplateId - * (required) The value for the parameter promptTemplateId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @return PromptTemplateDeleteResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateDeleteResponse deletePromptTemplate( - @Nonnull final UUID promptTemplateId, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'promptTemplateId' is set - if( promptTemplateId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'promptTemplateId' when calling deletePromptTemplate").statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/lm/promptTemplates/{promptTemplateId}" - .replaceAll( - "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Delete prompt template - *

- * 200 - Successful response - *

- * 403 - Forbidden Error - *

- * 404 - Bad Request - *

- * 0 - Common Error - * - * @param promptTemplateId - * The value for the parameter promptTemplateId - * @return PromptTemplateDeleteResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateDeleteResponse deletePromptTemplate( @Nonnull final UUID promptTemplateId ) - throws OpenApiRequestException - { - return deletePromptTemplate(promptTemplateId, null, null); - } - - /** - *

- *

- * Export prompt template - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @param promptTemplateId - * (required) The value for the parameter promptTemplateId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @return File - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public File exportPromptTemplate( - @Nonnull final UUID promptTemplateId, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'promptTemplateId' is set - if( promptTemplateId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'promptTemplateId' when calling exportPromptTemplate").statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/lm/promptTemplates/{promptTemplateId}/export" - .replaceAll( - "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - final String[] localVarAccepts = { "application/octet-stream", "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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Export prompt template - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @param promptTemplateId - * The value for the parameter promptTemplateId - * @return File - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public File exportPromptTemplate( @Nonnull final UUID promptTemplateId ) - throws OpenApiRequestException - { - return exportPromptTemplate(promptTemplateId, null, null); - } - - /** - *

- *

- * Get prompt template by UUID - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param promptTemplateId - * (required) The value for the parameter promptTemplateId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @return PromptTemplateGetResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateGetResponse getPromptTemplateByUuid( - @Nonnull final UUID promptTemplateId, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'promptTemplateId' is set - if( promptTemplateId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'promptTemplateId' when calling getPromptTemplateByUuid") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/lm/promptTemplates/{promptTemplateId}" - .replaceAll( - "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Get prompt template by UUID - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param promptTemplateId - * The value for the parameter promptTemplateId - * @return PromptTemplateGetResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateGetResponse getPromptTemplateByUuid( @Nonnull final UUID promptTemplateId ) - throws OpenApiRequestException - { - return getPromptTemplateByUuid(promptTemplateId, null, null); - } - - /** - *

- *

- * Import prompt template - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @param _file - * (optional) The value for the parameter _file - * @return PromptTemplatePostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplatePostResponse importPromptTemplate( - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope, - @Nullable final File _file ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // create path and map variables - final String localVarPath = "/lm/promptTemplates/import"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - if( _file != null ) - localVarFormParams.put("file", _file); - - final String[] localVarAccepts = { "application/json" }; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { "multipart/form-data" }; - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() - { - }; - return apiClient - .invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Import prompt template - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 0 - Common Error - * - * @return PromptTemplatePostResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplatePostResponse importPromptTemplate() - throws OpenApiRequestException - { - return importPromptTemplate(null, null, null); - } - - /** - *

- *

- * List prompt template history - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param scenario - * (required) The value for the parameter scenario - * @param version - * (required) The value for the parameter version - * @param name - * (required) The value for the parameter name - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @return PromptTemplateListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateListResponse listPromptTemplateHistory( - @Nonnull final String scenario, - @Nonnull final String version, - @Nonnull final String name, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // verify the required parameter 'scenario' is set - if( scenario == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'scenario' when calling listPromptTemplateHistory").statusCode(400); - } - - // verify the required parameter 'version' is set - if( version == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'version' when calling listPromptTemplateHistory").statusCode(400); - } - - // verify the required parameter 'name' is set - if( name == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'name' when calling listPromptTemplateHistory").statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history" - .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * List prompt template history - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param scenario - * The value for the parameter scenario - * @param version - * The value for the parameter version - * @param name - * The value for the parameter name - * @return PromptTemplateListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateListResponse listPromptTemplateHistory( - @Nonnull final String scenario, - @Nonnull final String version, - @Nonnull final String name ) - throws OpenApiRequestException - { - return listPromptTemplateHistory(scenario, version, name, null, null); - } - - /** - *

- *

- * List prompt templates - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @param scenario - * (optional) The value for the parameter scenario - * @param name - * (optional) The value for the parameter name - * @param version - * (optional) The value for the parameter version - * @param retrieve - * (optional, default to both) The value for the parameter retrieve - * @param includeSpec - * (optional, default to false) The value for the parameter includeSpec - * @return PromptTemplateListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateListResponse listPromptTemplates( - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope, - @Nullable final String scenario, - @Nullable final String name, - @Nullable final String version, - @Nullable final String retrieve, - @Nullable final Boolean includeSpec ) - throws OpenApiRequestException - { - final Object localVarPostBody = null; - - // create path and map variables - final String localVarPath = "/lm/promptTemplates"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("scenario", scenario)); - localVarQueryParams.addAll(ApiClient.parameterToPair("name", name)); - localVarQueryParams.addAll(ApiClient.parameterToPair("version", version)); - localVarQueryParams.addAll(ApiClient.parameterToPair("retrieve", retrieve)); - localVarQueryParams.addAll(ApiClient.parameterToPair("includeSpec", includeSpec)); - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * List prompt templates - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @return PromptTemplateListResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateListResponse listPromptTemplates() - throws OpenApiRequestException - { - return listPromptTemplates(null, null, null, null, null, null, null); - } - - /** - *

- *

- * Parse prompt template by ID - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param promptTemplateId - * (required) The value for the parameter promptTemplateId - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @param metadata - * (optional, default to false) The value for the parameter metadata - * @param promptTemplateSubstitutionRequest - * (optional) The value for the parameter promptTemplateSubstitutionRequest - * @return PromptTemplateSubstitutionResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateSubstitutionResponse parsePromptTemplateById( - @Nonnull final UUID promptTemplateId, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope, - @Nullable final Boolean metadata, - @Nullable final PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) - throws OpenApiRequestException - { - final Object localVarPostBody = promptTemplateSubstitutionRequest; - - // verify the required parameter 'promptTemplateId' is set - if( promptTemplateId == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'promptTemplateId' when calling parsePromptTemplateById") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/lm/promptTemplates/{promptTemplateId}/substitution" - .replaceAll( - "\\{" + "promptTemplateId" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(promptTemplateId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("metadata", metadata)); - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Parse prompt template by ID - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param promptTemplateId - * The value for the parameter promptTemplateId - * @return PromptTemplateSubstitutionResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateSubstitutionResponse parsePromptTemplateById( @Nonnull final UUID promptTemplateId ) - throws OpenApiRequestException - { - return parsePromptTemplateById(promptTemplateId, null, null, null, null); - } - - /** - *

- *

- * Parse prompt template by name and version - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param scenario - * (required) The value for the parameter scenario - * @param version - * (required) The value for the parameter version - * @param name - * (required) The value for the parameter name - * @param aiResourceGroup - * (optional) Specify a resource group id to use - * @param aiResourceGroupScope - * (optional) Specify whether the resource group scope is to be used - * @param metadata - * (optional, default to false) The value for the parameter metadata - * @param promptTemplateSubstitutionRequest - * (optional) The value for the parameter promptTemplateSubstitutionRequest - * @return PromptTemplateSubstitutionResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( - @Nonnull final String scenario, - @Nonnull final String version, - @Nonnull final String name, - @Nullable final String aiResourceGroup, - @Nullable final String aiResourceGroupScope, - @Nullable final Boolean metadata, - @Nullable final PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest ) - throws OpenApiRequestException - { - final Object localVarPostBody = promptTemplateSubstitutionRequest; - - // verify the required parameter 'scenario' is set - if( scenario == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'scenario' when calling parsePromptTemplateByNameVersion") - .statusCode(400); - } - - // verify the required parameter 'version' is set - if( version == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'version' when calling parsePromptTemplateByNameVersion") - .statusCode(400); - } - - // verify the required parameter 'name' is set - if( name == null ) { - throw new OpenApiRequestException( - "Missing the required parameter 'name' when calling parsePromptTemplateByNameVersion").statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution" - .replaceAll("\\{" + "scenario" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(scenario))) - .replaceAll("\\{" + "version" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(version))) - .replaceAll("\\{" + "name" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(name))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("metadata", metadata)); - if( aiResourceGroup != null ) - localVarHeaderParams.put("AI-Resource-Group", ApiClient.parameterToString(aiResourceGroup)); - if( aiResourceGroupScope != null ) - localVarHeaderParams.put("AI-Resource-Group-Scope", ApiClient.parameterToString(aiResourceGroupScope)); - - 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(), - localVarPostBody, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - *

- *

- * Parse prompt template by name and version - *

- * 200 - Successful response - *

- * 400 - Bad Request - *

- * 403 - Forbidden Error - *

- * 0 - Common Error - * - * @param scenario - * The value for the parameter scenario - * @param version - * The value for the parameter version - * @param name - * The value for the parameter name - * @return PromptTemplateSubstitutionResponse - * @throws OpenApiRequestException - * if an error occurs while attempting to invoke the API - */ - @Nonnull - public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion( - @Nonnull final String scenario, - @Nonnull final String version, - @Nonnull final String name ) - throws OpenApiRequestException - { - return parsePromptTemplateByNameVersion(scenario, version, name, null, null, null, null); - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java new file mode 100644 index 000000000..a08f0f7c7 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java @@ -0,0 +1,310 @@ +/* +* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. +*/ + +package com.sap.cloud.sdk.datamodel.openapi.apache.sample.api; + +import java.io.File; +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; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.common.annotations.Beta; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Soda; +import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.SodaWithId; +import com.sap.cloud.sdk.services.openapi.apache.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.Pair; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; + +/** + * SodaStore API in version 1.0.0. + * + * API for managing soda products and orders in SodaStore. + */ +@Beta +public class SodasApi extends BaseApi +{ + + /** + * Instantiates this API class to invoke operations on the SodaStore API + */ + public SodasApi() + { + } + + /** + * Instantiates this API class to invoke operations on the SodaStore API. + * + * @param httpDestination + * The destination that API should be used with + */ + public SodasApi( @Nonnull final Destination httpDestination ) + { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link ApiClient}. + * + * @param apiClient + * ApiClient to invoke the API on + */ + @Beta + public SodasApi( @Nonnull final ApiClient apiClient ) + { + super(apiClient); + } + + /** + *

+ * Download soda product data as binary + *

+ *

+ * 200 - Successful response + *

+ * 404 - Soda product not found + * + * @param id + * ID of the soda product to download + * @return File + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public File sodasDownloadIdGet( @Nonnull final Long id ) + throws OpenApiRequestException + { + final Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if( id == null ) { + throw new OpenApiRequestException("Missing the required parameter 'id' when calling sodasDownloadIdGet") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/sodas/download/{id}" + .replaceAll("\\{" + "id" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(id))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { "application/octet-stream" }; + 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(), + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + *

+ * Get all soda products + *

+ *

+ * 200 - A list of soda products + * + * @return List<SodaWithId> + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public List sodasGet() + throws OpenApiRequestException + { + final Object localVarPostBody = null; + + // create path and map variables + final String localVarPath = "/sodas"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + 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(), + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + *

+ * Get a specific soda product by ID + *

+ *

+ * 200 - The soda product + *

+ * 404 - Soda product not found + * + * @param id + * ID of the soda product to retrieve + * @return SodaWithId + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nonnull + public SodaWithId sodasIdGet( @Nonnull final Long id ) + throws OpenApiRequestException + { + final Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if( id == null ) { + throw new OpenApiRequestException("Missing the required parameter 'id' when calling sodasIdGet") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/sodas/{id}".replaceAll("\\{" + "id" + "\\}", ApiClient.escapeString(ApiClient.parameterToString(id))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + 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(), + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + *

+ * Update a specific soda product by ID + *

+ *

+ * 200 - The updated soda product + *

+ * 204 - Nothing has changed + *

+ * 404 - Soda product not found + * + * @param sodaWithId + * The updated soda product + * @return Soda + * @throws OpenApiRequestException + * if an error occurs while attempting to invoke the API + */ + @Nullable + public Soda sodasPut( @Nonnull final SodaWithId sodaWithId ) + throws OpenApiRequestException + { + final Object localVarPostBody = sodaWithId; + + // verify the required parameter 'sodaWithId' is set + if( sodaWithId == null ) { + throw new OpenApiRequestException("Missing the required parameter 'sodaWithId' when calling sodasPut") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/sodas"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + 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, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java new file mode 100644 index 000000000..d6462cc87 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * AllOf + */ + +@Beta // CHECKSTYLE:OFF +public class AllOf +// CHECKSTYLE:ON +{ + @JsonProperty( "sodaType" ) + private String sodaType; + + @JsonProperty( "caffeine" ) + private Boolean caffeine; + + @JsonProperty( "logo" ) + private ColaLogo logo; + + @JsonProperty( "barCode" ) + private ColaBarCode barCode; + + @JsonProperty( "color" ) + private String color; + + @JsonProperty( "flavor" ) + private FantaFlavor flavor; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AllOf. + */ + protected AllOf() + { + } + + /** + * Set the sodaType of this {@link AllOf} instance and return the same instance. + * + * @param sodaType + * The sodaType of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf sodaType( @Nullable final String sodaType ) + { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link AllOf} instance. + */ + @Nonnull + public String getSodaType() + { + return sodaType; + } + + /** + * Set the sodaType of this {@link AllOf} instance. + * + * @param sodaType + * The sodaType of this {@link AllOf} + */ + public void setSodaType( @Nullable final String sodaType ) + { + this.sodaType = sodaType; + } + + /** + * Set the caffeine of this {@link AllOf} instance and return the same instance. + * + * @param caffeine + * The caffeine of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf caffeine( @Nullable final Boolean caffeine ) + { + this.caffeine = caffeine; + return this; + } + + /** + * Get caffeine + * + * @return caffeine The caffeine of this {@link AllOf} instance. + */ + @Nonnull + public Boolean isCaffeine() + { + return caffeine; + } + + /** + * Set the caffeine of this {@link AllOf} instance. + * + * @param caffeine + * The caffeine of this {@link AllOf} + */ + public void setCaffeine( @Nullable final Boolean caffeine ) + { + this.caffeine = caffeine; + } + + /** + * Set the logo of this {@link AllOf} instance and return the same instance. + * + * @param logo + * The logo of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf logo( @Nullable final ColaLogo logo ) + { + this.logo = logo; + return this; + } + + /** + * Get logo + * + * @return logo The logo of this {@link AllOf} instance. + */ + @Nonnull + public ColaLogo getLogo() + { + return logo; + } + + /** + * Set the logo of this {@link AllOf} instance. + * + * @param logo + * The logo of this {@link AllOf} + */ + public void setLogo( @Nullable final ColaLogo logo ) + { + this.logo = logo; + } + + /** + * Set the barCode of this {@link AllOf} instance and return the same instance. + * + * @param barCode + * The barCode of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf barCode( @Nullable final ColaBarCode barCode ) + { + this.barCode = barCode; + return this; + } + + /** + * Get barCode + * + * @return barCode The barCode of this {@link AllOf} instance. + */ + @Nonnull + public ColaBarCode getBarCode() + { + return barCode; + } + + /** + * Set the barCode of this {@link AllOf} instance. + * + * @param barCode + * The barCode of this {@link AllOf} + */ + public void setBarCode( @Nullable final ColaBarCode barCode ) + { + this.barCode = barCode; + } + + /** + * Set the color of this {@link AllOf} instance and return the same instance. + * + * @param color + * The color of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf color( @Nullable final String color ) + { + this.color = color; + return this; + } + + /** + * Get color + * + * @return color The color of this {@link AllOf} instance. + */ + @Nonnull + public String getColor() + { + return color; + } + + /** + * Set the color of this {@link AllOf} instance. + * + * @param color + * The color of this {@link AllOf} + */ + public void setColor( @Nullable final String color ) + { + this.color = color; + } + + /** + * Set the flavor of this {@link AllOf} instance and return the same instance. + * + * @param flavor + * The flavor of this {@link AllOf} + * @return The same instance of this {@link AllOf} class + */ + @Nonnull + public AllOf flavor( @Nullable final FantaFlavor flavor ) + { + this.flavor = flavor; + return this; + } + + /** + * Get flavor + * + * @return flavor The flavor of this {@link AllOf} instance. + */ + @Nonnull + public FantaFlavor getFlavor() + { + return flavor; + } + + /** + * Set the flavor of this {@link AllOf} instance. + * + * @param flavor + * The flavor of this {@link AllOf} + */ + public void setFlavor( @Nullable final FantaFlavor flavor ) + { + this.flavor = flavor; + } + + /** + * Get the names of the unrecognizable properties of the {@link AllOf}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AllOf} instance. + * + * @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("AllOf has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AllOf} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( sodaType != null ) + declaredFields.put("sodaType", sodaType); + if( caffeine != null ) + declaredFields.put("caffeine", caffeine); + if( logo != null ) + declaredFields.put("logo", logo); + if( barCode != null ) + declaredFields.put("barCode", barCode); + if( color != null ) + declaredFields.put("color", color); + if( flavor != null ) + declaredFields.put("flavor", flavor); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AllOf} instance. If the map previously contained a mapping for the + * key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final AllOf allOf = (AllOf) o; + return Objects.equals(this.cloudSdkCustomFields, allOf.cloudSdkCustomFields) + && Objects.equals(this.sodaType, allOf.sodaType) + && Objects.equals(this.caffeine, allOf.caffeine) + && Objects.equals(this.logo, allOf.logo) + && Objects.equals(this.barCode, allOf.barCode) + && Objects.equals(this.color, allOf.color) + && Objects.equals(this.flavor, allOf.flavor); + } + + @Override + public int hashCode() + { + return Objects.hash(sodaType, caffeine, logo, barCode, color, flavor, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AllOf {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" barCode: ").append(toIndentedString(barCode)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" flavor: ").append(toIndentedString(flavor)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java new file mode 100644 index 000000000..97f8d677f --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * AnyOf + */ + +@Beta // CHECKSTYLE:OFF +public class AnyOf +// CHECKSTYLE:ON +{ + @JsonProperty( "sodaType" ) + private String sodaType; + + @JsonProperty( "caffeine" ) + private Boolean caffeine; + + @JsonProperty( "logo" ) + private ColaLogo logo; + + @JsonProperty( "barCode" ) + private ColaBarCode barCode; + + @JsonProperty( "color" ) + private String color; + + @JsonProperty( "flavor" ) + private FantaFlavor flavor; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for AnyOf. + */ + protected AnyOf() + { + } + + /** + * Set the sodaType of this {@link AnyOf} instance and return the same instance. + * + * @param sodaType + * The sodaType of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf sodaType( @Nullable final String sodaType ) + { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link AnyOf} instance. + */ + @Nonnull + public String getSodaType() + { + return sodaType; + } + + /** + * Set the sodaType of this {@link AnyOf} instance. + * + * @param sodaType + * The sodaType of this {@link AnyOf} + */ + public void setSodaType( @Nullable final String sodaType ) + { + this.sodaType = sodaType; + } + + /** + * Set the caffeine of this {@link AnyOf} instance and return the same instance. + * + * @param caffeine + * The caffeine of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf caffeine( @Nullable final Boolean caffeine ) + { + this.caffeine = caffeine; + return this; + } + + /** + * Get caffeine + * + * @return caffeine The caffeine of this {@link AnyOf} instance. + */ + @Nonnull + public Boolean isCaffeine() + { + return caffeine; + } + + /** + * Set the caffeine of this {@link AnyOf} instance. + * + * @param caffeine + * The caffeine of this {@link AnyOf} + */ + public void setCaffeine( @Nullable final Boolean caffeine ) + { + this.caffeine = caffeine; + } + + /** + * Set the logo of this {@link AnyOf} instance and return the same instance. + * + * @param logo + * The logo of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf logo( @Nullable final ColaLogo logo ) + { + this.logo = logo; + return this; + } + + /** + * Get logo + * + * @return logo The logo of this {@link AnyOf} instance. + */ + @Nonnull + public ColaLogo getLogo() + { + return logo; + } + + /** + * Set the logo of this {@link AnyOf} instance. + * + * @param logo + * The logo of this {@link AnyOf} + */ + public void setLogo( @Nullable final ColaLogo logo ) + { + this.logo = logo; + } + + /** + * Set the barCode of this {@link AnyOf} instance and return the same instance. + * + * @param barCode + * The barCode of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf barCode( @Nullable final ColaBarCode barCode ) + { + this.barCode = barCode; + return this; + } + + /** + * Get barCode + * + * @return barCode The barCode of this {@link AnyOf} instance. + */ + @Nonnull + public ColaBarCode getBarCode() + { + return barCode; + } + + /** + * Set the barCode of this {@link AnyOf} instance. + * + * @param barCode + * The barCode of this {@link AnyOf} + */ + public void setBarCode( @Nullable final ColaBarCode barCode ) + { + this.barCode = barCode; + } + + /** + * Set the color of this {@link AnyOf} instance and return the same instance. + * + * @param color + * The color of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf color( @Nullable final String color ) + { + this.color = color; + return this; + } + + /** + * Get color + * + * @return color The color of this {@link AnyOf} instance. + */ + @Nonnull + public String getColor() + { + return color; + } + + /** + * Set the color of this {@link AnyOf} instance. + * + * @param color + * The color of this {@link AnyOf} + */ + public void setColor( @Nullable final String color ) + { + this.color = color; + } + + /** + * Set the flavor of this {@link AnyOf} instance and return the same instance. + * + * @param flavor + * The flavor of this {@link AnyOf} + * @return The same instance of this {@link AnyOf} class + */ + @Nonnull + public AnyOf flavor( @Nullable final FantaFlavor flavor ) + { + this.flavor = flavor; + return this; + } + + /** + * Get flavor + * + * @return flavor The flavor of this {@link AnyOf} instance. + */ + @Nonnull + public FantaFlavor getFlavor() + { + return flavor; + } + + /** + * Set the flavor of this {@link AnyOf} instance. + * + * @param flavor + * The flavor of this {@link AnyOf} + */ + public void setFlavor( @Nullable final FantaFlavor flavor ) + { + this.flavor = flavor; + } + + /** + * Get the names of the unrecognizable properties of the {@link AnyOf}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AnyOf} instance. + * + * @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("AnyOf has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AnyOf} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( sodaType != null ) + declaredFields.put("sodaType", sodaType); + if( caffeine != null ) + declaredFields.put("caffeine", caffeine); + if( logo != null ) + declaredFields.put("logo", logo); + if( barCode != null ) + declaredFields.put("barCode", barCode); + if( color != null ) + declaredFields.put("color", color); + if( flavor != null ) + declaredFields.put("flavor", flavor); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AnyOf} instance. If the map previously contained a mapping for the + * key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final AnyOf anyOf = (AnyOf) o; + return Objects.equals(this.cloudSdkCustomFields, anyOf.cloudSdkCustomFields) + && Objects.equals(this.sodaType, anyOf.sodaType) + && Objects.equals(this.caffeine, anyOf.caffeine) + && Objects.equals(this.logo, anyOf.logo) + && Objects.equals(this.barCode, anyOf.barCode) + && Objects.equals(this.color, anyOf.color) + && Objects.equals(this.flavor, anyOf.flavor); + } + + @Override + public int hashCode() + { + return Objects.hash(sodaType, caffeine, logo, barCode, color, flavor, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class AnyOf {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" barCode: ").append(toIndentedString(barCode)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" flavor: ").append(toIndentedString(flavor)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java deleted file mode 100644 index bad1e31cf..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AssistantChatMessage.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * AssistantChatMessage - */ - -@Beta // CHECKSTYLE:OFF -public class AssistantChatMessage implements ChatMessage -// CHECKSTYLE:ON -{ - /** - * Gets or Sets role - */ - public enum RoleEnum - { - /** - * The ASSISTANT option of this AssistantChatMessage - */ - ASSISTANT("assistant"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this AssistantChatMessage - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum( 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 AssistantChatMessage - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue( @Nonnull final String value ) - { - for( RoleEnum b : RoleEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "role" ) - private RoleEnum role; - - @JsonProperty( "content" ) - private ChatMessageContent content; - - @JsonProperty( "refusal" ) - private String refusal; - - @JsonProperty( "tool_calls" ) - private List toolCalls = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AssistantChatMessage. - */ - protected AssistantChatMessage() - { - } - - /** - * Set the role of this {@link AssistantChatMessage} instance and return the same instance. - * - * @param role - * The role of this {@link AssistantChatMessage} - * @return The same instance of this {@link AssistantChatMessage} class - */ - @Nonnull - public AssistantChatMessage role( @Nonnull final RoleEnum role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link AssistantChatMessage} instance. - */ - @Nonnull - public RoleEnum getRole() - { - return role; - } - - /** - * Set the role of this {@link AssistantChatMessage} instance. - * - * @param role - * The role of this {@link AssistantChatMessage} - */ - public void setRole( @Nonnull final RoleEnum role ) - { - this.role = role; - } - - /** - * Set the content of this {@link AssistantChatMessage} instance and return the same instance. - * - * @param content - * The content of this {@link AssistantChatMessage} - * @return The same instance of this {@link AssistantChatMessage} class - */ - @Nonnull - public AssistantChatMessage content( @Nullable final ChatMessageContent content ) - { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link AssistantChatMessage} instance. - */ - @Nonnull - public ChatMessageContent getContent() - { - return content; - } - - /** - * Set the content of this {@link AssistantChatMessage} instance. - * - * @param content - * The content of this {@link AssistantChatMessage} - */ - public void setContent( @Nullable final ChatMessageContent content ) - { - this.content = content; - } - - /** - * Set the refusal of this {@link AssistantChatMessage} instance and return the same instance. - * - * @param refusal - * The refusal of this {@link AssistantChatMessage} - * @return The same instance of this {@link AssistantChatMessage} class - */ - @Nonnull - public AssistantChatMessage refusal( @Nullable final String refusal ) - { - this.refusal = refusal; - return this; - } - - /** - * Get refusal - * - * @return refusal The refusal of this {@link AssistantChatMessage} instance. - */ - @Nonnull - public String getRefusal() - { - return refusal; - } - - /** - * Set the refusal of this {@link AssistantChatMessage} instance. - * - * @param refusal - * The refusal of this {@link AssistantChatMessage} - */ - public void setRefusal( @Nullable final String refusal ) - { - this.refusal = refusal; - } - - /** - * Set the toolCalls of this {@link AssistantChatMessage} instance and return the same instance. - * - * @param toolCalls - * The tool calls generated by the model, such as function calls. - * @return The same instance of this {@link AssistantChatMessage} class - */ - @Nonnull - public AssistantChatMessage toolCalls( @Nullable final List toolCalls ) - { - this.toolCalls = toolCalls; - return this; - } - - /** - * Add one toolCalls instance to this {@link AssistantChatMessage}. - * - * @param toolCallsItem - * The toolCalls that should be added - * @return The same instance of type {@link AssistantChatMessage} - */ - @Nonnull - public AssistantChatMessage addToolCallsItem( @Nonnull final MessageToolCall toolCallsItem ) - { - if( this.toolCalls == null ) { - this.toolCalls = new ArrayList<>(); - } - this.toolCalls.add(toolCallsItem); - return this; - } - - /** - * The tool calls generated by the model, such as function calls. - * - * @return toolCalls The toolCalls of this {@link AssistantChatMessage} instance. - */ - @Nonnull - public List getToolCalls() - { - return toolCalls; - } - - /** - * Set the toolCalls of this {@link AssistantChatMessage} instance. - * - * @param toolCalls - * The tool calls generated by the model, such as function calls. - */ - public void setToolCalls( @Nullable final List toolCalls ) - { - this.toolCalls = toolCalls; - } - - /** - * Get the names of the unrecognizable properties of the {@link AssistantChatMessage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AssistantChatMessage} 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("AssistantChatMessage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AssistantChatMessage} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( role != null ) - declaredFields.put("role", role); - if( content != null ) - declaredFields.put("content", content); - if( refusal != null ) - declaredFields.put("refusal", refusal); - if( toolCalls != null ) - declaredFields.put("toolCalls", toolCalls); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AssistantChatMessage} 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 AssistantChatMessage assistantChatMessage = (AssistantChatMessage) o; - return Objects.equals(this.cloudSdkCustomFields, assistantChatMessage.cloudSdkCustomFields) - && Objects.equals(this.role, assistantChatMessage.role) - && Objects.equals(this.content, assistantChatMessage.content) - && Objects.equals(this.refusal, assistantChatMessage.refusal) - && Objects.equals(this.toolCalls, assistantChatMessage.toolCalls); - } - - @Override - public int hashCode() - { - return Objects.hash(role, content, refusal, toolCalls, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AssistantChatMessage {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" refusal: ").append(toIndentedString(refusal)).append("\n"); - sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java deleted file mode 100644 index 499774e0a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInput.java +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Filter configuration for Azure Content Safety - */ - -@Beta // CHECKSTYLE:OFF -public class AzureContentSafetyInput -// CHECKSTYLE:ON -{ - @JsonProperty( "hate" ) - private AzureThreshold hate; - - @JsonProperty( "self_harm" ) - private AzureThreshold selfHarm; - - @JsonProperty( "sexual" ) - private AzureThreshold sexual; - - @JsonProperty( "violence" ) - private AzureThreshold violence; - - @JsonProperty( "prompt_shield" ) - private Boolean promptShield = false; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AzureContentSafetyInput. - */ - protected AzureContentSafetyInput() - { - } - - /** - * Set the hate of this {@link AzureContentSafetyInput} instance and return the same instance. - * - * @param hate - * The hate of this {@link AzureContentSafetyInput} - * @return The same instance of this {@link AzureContentSafetyInput} class - */ - @Nonnull - public AzureContentSafetyInput hate( @Nullable final AzureThreshold hate ) - { - this.hate = hate; - return this; - } - - /** - * Get hate - * - * @return hate The hate of this {@link AzureContentSafetyInput} instance. - */ - @Nonnull - public AzureThreshold getHate() - { - return hate; - } - - /** - * Set the hate of this {@link AzureContentSafetyInput} instance. - * - * @param hate - * The hate of this {@link AzureContentSafetyInput} - */ - public void setHate( @Nullable final AzureThreshold hate ) - { - this.hate = hate; - } - - /** - * Set the selfHarm of this {@link AzureContentSafetyInput} instance and return the same instance. - * - * @param selfHarm - * The selfHarm of this {@link AzureContentSafetyInput} - * @return The same instance of this {@link AzureContentSafetyInput} class - */ - @Nonnull - public AzureContentSafetyInput selfHarm( @Nullable final AzureThreshold selfHarm ) - { - this.selfHarm = selfHarm; - return this; - } - - /** - * Get selfHarm - * - * @return selfHarm The selfHarm of this {@link AzureContentSafetyInput} instance. - */ - @Nonnull - public AzureThreshold getSelfHarm() - { - return selfHarm; - } - - /** - * Set the selfHarm of this {@link AzureContentSafetyInput} instance. - * - * @param selfHarm - * The selfHarm of this {@link AzureContentSafetyInput} - */ - public void setSelfHarm( @Nullable final AzureThreshold selfHarm ) - { - this.selfHarm = selfHarm; - } - - /** - * Set the sexual of this {@link AzureContentSafetyInput} instance and return the same instance. - * - * @param sexual - * The sexual of this {@link AzureContentSafetyInput} - * @return The same instance of this {@link AzureContentSafetyInput} class - */ - @Nonnull - public AzureContentSafetyInput sexual( @Nullable final AzureThreshold sexual ) - { - this.sexual = sexual; - return this; - } - - /** - * Get sexual - * - * @return sexual The sexual of this {@link AzureContentSafetyInput} instance. - */ - @Nonnull - public AzureThreshold getSexual() - { - return sexual; - } - - /** - * Set the sexual of this {@link AzureContentSafetyInput} instance. - * - * @param sexual - * The sexual of this {@link AzureContentSafetyInput} - */ - public void setSexual( @Nullable final AzureThreshold sexual ) - { - this.sexual = sexual; - } - - /** - * Set the violence of this {@link AzureContentSafetyInput} instance and return the same instance. - * - * @param violence - * The violence of this {@link AzureContentSafetyInput} - * @return The same instance of this {@link AzureContentSafetyInput} class - */ - @Nonnull - public AzureContentSafetyInput violence( @Nullable final AzureThreshold violence ) - { - this.violence = violence; - return this; - } - - /** - * Get violence - * - * @return violence The violence of this {@link AzureContentSafetyInput} instance. - */ - @Nonnull - public AzureThreshold getViolence() - { - return violence; - } - - /** - * Set the violence of this {@link AzureContentSafetyInput} instance. - * - * @param violence - * The violence of this {@link AzureContentSafetyInput} - */ - public void setViolence( @Nullable final AzureThreshold violence ) - { - this.violence = violence; - } - - /** - * Set the promptShield of this {@link AzureContentSafetyInput} instance and return the same instance. - * - * @param promptShield - * Filter prompts for harmful content such as jailbreaks and prompt injections. - * @return The same instance of this {@link AzureContentSafetyInput} class - */ - @Nonnull - public AzureContentSafetyInput promptShield( @Nullable final Boolean promptShield ) - { - this.promptShield = promptShield; - return this; - } - - /** - * Filter prompts for harmful content such as jailbreaks and prompt injections. - * - * @return promptShield The promptShield of this {@link AzureContentSafetyInput} instance. - */ - @Nonnull - public Boolean isPromptShield() - { - return promptShield; - } - - /** - * Set the promptShield of this {@link AzureContentSafetyInput} instance. - * - * @param promptShield - * Filter prompts for harmful content such as jailbreaks and prompt injections. - */ - public void setPromptShield( @Nullable final Boolean promptShield ) - { - this.promptShield = promptShield; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzureContentSafetyInput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentSafetyInput} 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("AzureContentSafetyInput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentSafetyInput} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( hate != null ) - declaredFields.put("hate", hate); - if( selfHarm != null ) - declaredFields.put("selfHarm", selfHarm); - if( sexual != null ) - declaredFields.put("sexual", sexual); - if( violence != null ) - declaredFields.put("violence", violence); - if( promptShield != null ) - declaredFields.put("promptShield", promptShield); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentSafetyInput} 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 AzureContentSafetyInput azureContentSafetyInput = (AzureContentSafetyInput) o; - return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyInput.cloudSdkCustomFields) - && Objects.equals(this.hate, azureContentSafetyInput.hate) - && Objects.equals(this.selfHarm, azureContentSafetyInput.selfHarm) - && Objects.equals(this.sexual, azureContentSafetyInput.sexual) - && Objects.equals(this.violence, azureContentSafetyInput.violence) - && Objects.equals(this.promptShield, azureContentSafetyInput.promptShield); - } - - @Override - public int hashCode() - { - return Objects.hash(hate, selfHarm, sexual, violence, promptShield, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentSafetyInput {\n"); - sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); - sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); - sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n"); - sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); - sb.append(" promptShield: ").append(toIndentedString(promptShield)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java deleted file mode 100644 index d244a4f45..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyInputFilterConfig.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * AzureContentSafetyInputFilterConfig - */ - -@Beta // CHECKSTYLE:OFF -public class AzureContentSafetyInputFilterConfig implements InputFilterConfig -// CHECKSTYLE:ON -{ - /** - * Name of the filter provider type - */ - public enum TypeEnum - { - /** - * The AZURE_CONTENT_SAFETY option of this AzureContentSafetyInputFilterConfig - */ - AZURE_CONTENT_SAFETY("azure_content_safety"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this AzureContentSafetyInputFilterConfig - */ - 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 AzureContentSafetyInputFilterConfig - */ - @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 AzureContentSafetyInput config; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AzureContentSafetyInputFilterConfig. - */ - protected AzureContentSafetyInputFilterConfig() - { - } - - /** - * Set the type of this {@link AzureContentSafetyInputFilterConfig} instance and return the same instance. - * - * @param type - * Name of the filter provider type - * @return The same instance of this {@link AzureContentSafetyInputFilterConfig} class - */ - @Nonnull - public AzureContentSafetyInputFilterConfig type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Name of the filter provider type - * - * @return type The type of this {@link AzureContentSafetyInputFilterConfig} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link AzureContentSafetyInputFilterConfig} instance. - * - * @param type - * Name of the filter provider type - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the config of this {@link AzureContentSafetyInputFilterConfig} instance and return the same instance. - * - * @param config - * The config of this {@link AzureContentSafetyInputFilterConfig} - * @return The same instance of this {@link AzureContentSafetyInputFilterConfig} class - */ - @Nonnull - public AzureContentSafetyInputFilterConfig config( @Nullable final AzureContentSafetyInput config ) - { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link AzureContentSafetyInputFilterConfig} instance. - */ - @Nonnull - public AzureContentSafetyInput getConfig() - { - return config; - } - - /** - * Set the config of this {@link AzureContentSafetyInputFilterConfig} instance. - * - * @param config - * The config of this {@link AzureContentSafetyInputFilterConfig} - */ - public void setConfig( @Nullable final AzureContentSafetyInput config ) - { - this.config = config; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzureContentSafetyInputFilterConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentSafetyInputFilterConfig} 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( - "AzureContentSafetyInputFilterConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentSafetyInputFilterConfig} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( config != null ) - declaredFields.put("config", config); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentSafetyInputFilterConfig} 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 AzureContentSafetyInputFilterConfig azureContentSafetyInputFilterConfig = - (AzureContentSafetyInputFilterConfig) o; - return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyInputFilterConfig.cloudSdkCustomFields) - && Objects.equals(this.type, azureContentSafetyInputFilterConfig.type) - && Objects.equals(this.config, azureContentSafetyInputFilterConfig.config); - } - - @Override - public int hashCode() - { - return Objects.hash(type, config, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentSafetyInputFilterConfig {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java deleted file mode 100644 index 16620fcb6..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutput.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Filter configuration for Azure Content Safety - */ - -@Beta // CHECKSTYLE:OFF -public class AzureContentSafetyOutput -// CHECKSTYLE:ON -{ - @JsonProperty( "hate" ) - private AzureThreshold hate; - - @JsonProperty( "self_harm" ) - private AzureThreshold selfHarm; - - @JsonProperty( "sexual" ) - private AzureThreshold sexual; - - @JsonProperty( "violence" ) - private AzureThreshold violence; - - @JsonProperty( "protected_material_code" ) - private Boolean protectedMaterialCode = false; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AzureContentSafetyOutput. - */ - protected AzureContentSafetyOutput() - { - } - - /** - * Set the hate of this {@link AzureContentSafetyOutput} instance and return the same instance. - * - * @param hate - * The hate of this {@link AzureContentSafetyOutput} - * @return The same instance of this {@link AzureContentSafetyOutput} class - */ - @Nonnull - public AzureContentSafetyOutput hate( @Nullable final AzureThreshold hate ) - { - this.hate = hate; - return this; - } - - /** - * Get hate - * - * @return hate The hate of this {@link AzureContentSafetyOutput} instance. - */ - @Nonnull - public AzureThreshold getHate() - { - return hate; - } - - /** - * Set the hate of this {@link AzureContentSafetyOutput} instance. - * - * @param hate - * The hate of this {@link AzureContentSafetyOutput} - */ - public void setHate( @Nullable final AzureThreshold hate ) - { - this.hate = hate; - } - - /** - * Set the selfHarm of this {@link AzureContentSafetyOutput} instance and return the same instance. - * - * @param selfHarm - * The selfHarm of this {@link AzureContentSafetyOutput} - * @return The same instance of this {@link AzureContentSafetyOutput} class - */ - @Nonnull - public AzureContentSafetyOutput selfHarm( @Nullable final AzureThreshold selfHarm ) - { - this.selfHarm = selfHarm; - return this; - } - - /** - * Get selfHarm - * - * @return selfHarm The selfHarm of this {@link AzureContentSafetyOutput} instance. - */ - @Nonnull - public AzureThreshold getSelfHarm() - { - return selfHarm; - } - - /** - * Set the selfHarm of this {@link AzureContentSafetyOutput} instance. - * - * @param selfHarm - * The selfHarm of this {@link AzureContentSafetyOutput} - */ - public void setSelfHarm( @Nullable final AzureThreshold selfHarm ) - { - this.selfHarm = selfHarm; - } - - /** - * Set the sexual of this {@link AzureContentSafetyOutput} instance and return the same instance. - * - * @param sexual - * The sexual of this {@link AzureContentSafetyOutput} - * @return The same instance of this {@link AzureContentSafetyOutput} class - */ - @Nonnull - public AzureContentSafetyOutput sexual( @Nullable final AzureThreshold sexual ) - { - this.sexual = sexual; - return this; - } - - /** - * Get sexual - * - * @return sexual The sexual of this {@link AzureContentSafetyOutput} instance. - */ - @Nonnull - public AzureThreshold getSexual() - { - return sexual; - } - - /** - * Set the sexual of this {@link AzureContentSafetyOutput} instance. - * - * @param sexual - * The sexual of this {@link AzureContentSafetyOutput} - */ - public void setSexual( @Nullable final AzureThreshold sexual ) - { - this.sexual = sexual; - } - - /** - * Set the violence of this {@link AzureContentSafetyOutput} instance and return the same instance. - * - * @param violence - * The violence of this {@link AzureContentSafetyOutput} - * @return The same instance of this {@link AzureContentSafetyOutput} class - */ - @Nonnull - public AzureContentSafetyOutput violence( @Nullable final AzureThreshold violence ) - { - this.violence = violence; - return this; - } - - /** - * Get violence - * - * @return violence The violence of this {@link AzureContentSafetyOutput} instance. - */ - @Nonnull - public AzureThreshold getViolence() - { - return violence; - } - - /** - * Set the violence of this {@link AzureContentSafetyOutput} instance. - * - * @param violence - * The violence of this {@link AzureContentSafetyOutput} - */ - public void setViolence( @Nullable final AzureThreshold violence ) - { - this.violence = violence; - } - - /** - * Set the protectedMaterialCode of this {@link AzureContentSafetyOutput} instance and return the same instance. - * - * @param protectedMaterialCode - * Detect protected code content from known GitHub repositories. The scan includes software libraries, - * source code, algorithms, and other proprietary programming content. - * @return The same instance of this {@link AzureContentSafetyOutput} class - */ - @Nonnull - public AzureContentSafetyOutput protectedMaterialCode( @Nullable final Boolean protectedMaterialCode ) - { - this.protectedMaterialCode = protectedMaterialCode; - return this; - } - - /** - * Detect protected code content from known GitHub repositories. The scan includes software libraries, source code, - * algorithms, and other proprietary programming content. - * - * @return protectedMaterialCode The protectedMaterialCode of this {@link AzureContentSafetyOutput} instance. - */ - @Nonnull - public Boolean isProtectedMaterialCode() - { - return protectedMaterialCode; - } - - /** - * Set the protectedMaterialCode of this {@link AzureContentSafetyOutput} instance. - * - * @param protectedMaterialCode - * Detect protected code content from known GitHub repositories. The scan includes software libraries, - * source code, algorithms, and other proprietary programming content. - */ - public void setProtectedMaterialCode( @Nullable final Boolean protectedMaterialCode ) - { - this.protectedMaterialCode = protectedMaterialCode; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzureContentSafetyOutput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentSafetyOutput} 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("AzureContentSafetyOutput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentSafetyOutput} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( hate != null ) - declaredFields.put("hate", hate); - if( selfHarm != null ) - declaredFields.put("selfHarm", selfHarm); - if( sexual != null ) - declaredFields.put("sexual", sexual); - if( violence != null ) - declaredFields.put("violence", violence); - if( protectedMaterialCode != null ) - declaredFields.put("protectedMaterialCode", protectedMaterialCode); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentSafetyOutput} 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 AzureContentSafetyOutput azureContentSafetyOutput = (AzureContentSafetyOutput) o; - return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyOutput.cloudSdkCustomFields) - && Objects.equals(this.hate, azureContentSafetyOutput.hate) - && Objects.equals(this.selfHarm, azureContentSafetyOutput.selfHarm) - && Objects.equals(this.sexual, azureContentSafetyOutput.sexual) - && Objects.equals(this.violence, azureContentSafetyOutput.violence) - && Objects.equals(this.protectedMaterialCode, azureContentSafetyOutput.protectedMaterialCode); - } - - @Override - public int hashCode() - { - return Objects.hash(hate, selfHarm, sexual, violence, protectedMaterialCode, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentSafetyOutput {\n"); - sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); - sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); - sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n"); - sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); - sb.append(" protectedMaterialCode: ").append(toIndentedString(protectedMaterialCode)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java deleted file mode 100644 index 1353dd435..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureContentSafetyOutputFilterConfig.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * AzureContentSafetyOutputFilterConfig - */ - -@Beta // CHECKSTYLE:OFF -public class AzureContentSafetyOutputFilterConfig implements OutputFilterConfig -// CHECKSTYLE:ON -{ - /** - * Name of the filter provider type - */ - public enum TypeEnum - { - /** - * The AZURE_CONTENT_SAFETY option of this AzureContentSafetyOutputFilterConfig - */ - AZURE_CONTENT_SAFETY("azure_content_safety"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this AzureContentSafetyOutputFilterConfig - */ - 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 AzureContentSafetyOutputFilterConfig - */ - @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 AzureContentSafetyOutput config; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AzureContentSafetyOutputFilterConfig. - */ - protected AzureContentSafetyOutputFilterConfig() - { - } - - /** - * Set the type of this {@link AzureContentSafetyOutputFilterConfig} instance and return the same instance. - * - * @param type - * Name of the filter provider type - * @return The same instance of this {@link AzureContentSafetyOutputFilterConfig} class - */ - @Nonnull - public AzureContentSafetyOutputFilterConfig type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Name of the filter provider type - * - * @return type The type of this {@link AzureContentSafetyOutputFilterConfig} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link AzureContentSafetyOutputFilterConfig} instance. - * - * @param type - * Name of the filter provider type - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the config of this {@link AzureContentSafetyOutputFilterConfig} instance and return the same instance. - * - * @param config - * The config of this {@link AzureContentSafetyOutputFilterConfig} - * @return The same instance of this {@link AzureContentSafetyOutputFilterConfig} class - */ - @Nonnull - public AzureContentSafetyOutputFilterConfig config( @Nullable final AzureContentSafetyOutput config ) - { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link AzureContentSafetyOutputFilterConfig} instance. - */ - @Nonnull - public AzureContentSafetyOutput getConfig() - { - return config; - } - - /** - * Set the config of this {@link AzureContentSafetyOutputFilterConfig} instance. - * - * @param config - * The config of this {@link AzureContentSafetyOutputFilterConfig} - */ - public void setConfig( @Nullable final AzureContentSafetyOutput config ) - { - this.config = config; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzureContentSafetyOutputFilterConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentSafetyOutputFilterConfig} 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( - "AzureContentSafetyOutputFilterConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentSafetyOutputFilterConfig} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( config != null ) - declaredFields.put("config", config); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentSafetyOutputFilterConfig} 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 AzureContentSafetyOutputFilterConfig azureContentSafetyOutputFilterConfig = - (AzureContentSafetyOutputFilterConfig) o; - return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyOutputFilterConfig.cloudSdkCustomFields) - && Objects.equals(this.type, azureContentSafetyOutputFilterConfig.type) - && Objects.equals(this.config, azureContentSafetyOutputFilterConfig.config); - } - - @Override - public int hashCode() - { - return Objects.hash(type, config, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentSafetyOutputFilterConfig {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java deleted file mode 100644 index fb7df9c8d..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AzureThreshold.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import javax.annotation.Nonnull; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Gets or Sets AzureThreshold - */ - -@Beta -public enum AzureThreshold -{ - - NUMBER_0(0), - - NUMBER_2(2), - - NUMBER_4(4), - - NUMBER_6(6), - - NUMBER_unknown_default_open_api(11184809); - - private final Integer value; - - AzureThreshold( Integer value ) - { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public Integer 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 AzureThreshold fromValue( @Nonnull final Integer value ) - { - for( final AzureThreshold b : AzureThreshold.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return NUMBER_unknown_default_open_api; - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java similarity index 62% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java index f7e94b815..55111820b 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatText.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -33,31 +33,34 @@ import com.google.common.annotations.Beta; /** - * ResponseFormatText + * Bar */ @Beta // CHECKSTYLE:OFF -public class ResponseFormatText implements PromptTemplateSpecResponseFormat, TemplateResponseFormat +public class Bar implements OneOfWithEnumDiscriminator // CHECKSTYLE:ON { + @JsonProperty( "bar" ) + private String bar; + /** - * The type of response format being defined: `text` + * Gets or Sets disc */ - public enum TypeEnum + public enum DiscEnum { /** - * The TEXT option of this ResponseFormatText + * The DISC_BAR option of this Bar */ - TEXT("text"), + DISC_BAR("disc_bar"), /** - * The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatText + * The UNKNOWN_DEFAULT_OPEN_API option of this Bar */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private String value; - TypeEnum( String value ) + DiscEnum( String value ) { this.value = value; } @@ -91,13 +94,13 @@ public String toString() * * @param value * The String value - * @return The enum value of type ResponseFormatText + * @return The enum value of type Bar */ @JsonCreator @Nonnull - public static TypeEnum fromValue( @Nonnull final String value ) + public static DiscEnum fromValue( @Nonnull final String value ) { - for( TypeEnum b : TypeEnum.values() ) { + for( DiscEnum b : DiscEnum.values() ) { if( b.value.equals(value) ) { return b; } @@ -106,58 +109,94 @@ public static TypeEnum fromValue( @Nonnull final String value ) } } - @JsonProperty( "type" ) - private TypeEnum type; + @JsonProperty( "disc" ) + private DiscEnum disc; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** - * Default constructor for ResponseFormatText. + * Default constructor for Bar. + */ + protected Bar() + { + } + + /** + * Set the bar of this {@link Bar} instance and return the same instance. + * + * @param bar + * The bar of this {@link Bar} + * @return The same instance of this {@link Bar} class + */ + @Nonnull + public Bar bar( @Nullable final String bar ) + { + this.bar = bar; + return this; + } + + /** + * Get bar + * + * @return bar The bar of this {@link Bar} instance. + */ + @Nonnull + public String getBar() + { + return bar; + } + + /** + * Set the bar of this {@link Bar} instance. + * + * @param bar + * The bar of this {@link Bar} */ - protected ResponseFormatText() + public void setBar( @Nullable final String bar ) { + this.bar = bar; } /** - * Set the type of this {@link ResponseFormatText} instance and return the same instance. + * Set the disc of this {@link Bar} instance and return the same instance. * - * @param type - * The type of response format being defined: `text` - * @return The same instance of this {@link ResponseFormatText} class + * @param disc + * The disc of this {@link Bar} + * @return The same instance of this {@link Bar} class */ @Nonnull - public ResponseFormatText type( @Nonnull final TypeEnum type ) + public Bar disc( @Nullable final DiscEnum disc ) { - this.type = type; + this.disc = disc; return this; } /** - * The type of response format being defined: `text` + * Get disc * - * @return type The type of this {@link ResponseFormatText} instance. + * @return disc The disc of this {@link Bar} instance. */ @Nonnull - public TypeEnum getType() + public DiscEnum getDisc() { - return type; + return disc; } /** - * Set the type of this {@link ResponseFormatText} instance. + * Set the disc of this {@link Bar} instance. * - * @param type - * The type of response format being defined: `text` + * @param disc + * The disc of this {@link Bar} */ - public void setType( @Nonnull final TypeEnum type ) + public void setDisc( @Nullable final DiscEnum disc ) { - this.type = type; + this.disc = disc; } /** - * Get the names of the unrecognizable properties of the {@link ResponseFormatText}. + * Get the names of the unrecognizable properties of the {@link Bar}. * * @return The set of properties names */ @@ -169,7 +208,7 @@ public Set getCustomFieldNames() } /** - * Get the value of an unrecognizable property of this {@link ResponseFormatText} instance. + * Get the value of an unrecognizable property of this {@link Bar} instance. * * @deprecated Use {@link #toMap()} instead. * @param name @@ -184,13 +223,13 @@ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException { if( !cloudSdkCustomFields.containsKey(name) ) { - throw new NoSuchElementException("ResponseFormatText has no field with name '" + name + "'."); + throw new NoSuchElementException("Bar has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link ResponseFormatText} instance including unrecognized properties. + * Get the value of all properties of this {@link Bar} instance including unrecognized properties. * * @return The map of all properties */ @@ -199,14 +238,16 @@ public Object getCustomField( @Nonnull final String name ) public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); + if( bar != null ) + declaredFields.put("bar", bar); + if( disc != null ) + declaredFields.put("disc", disc); return declaredFields; } /** - * Set an unrecognizable property of this {@link ResponseFormatText} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link Bar} 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 @@ -228,15 +269,16 @@ public boolean equals( @Nullable final java.lang.Object o ) if( o == null || getClass() != o.getClass() ) { return false; } - final ResponseFormatText responseFormatText = (ResponseFormatText) o; - return Objects.equals(this.cloudSdkCustomFields, responseFormatText.cloudSdkCustomFields) - && Objects.equals(this.type, responseFormatText.type); + final Bar bar = (Bar) o; + return Objects.equals(this.cloudSdkCustomFields, bar.cloudSdkCustomFields) + && Objects.equals(this.bar, bar.bar) + && Objects.equals(this.disc, bar.disc); } @Override public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); + return Objects.hash(bar, disc, cloudSdkCustomFields); } @Override @@ -244,8 +286,9 @@ public int hashCode() public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class ResponseFormatText {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("class Bar {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" disc: ").append(toIndentedString(disc)).append("\n"); cloudSdkCustomFields .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); sb.append("}"); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java deleted file mode 100644 index 803eb5a21..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatCompletionTool.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * ChatCompletionTool - */ - -@Beta // CHECKSTYLE:OFF -public class ChatCompletionTool -// CHECKSTYLE:ON -{ - /** - * The type of the tool. Currently, only `function` is supported. - */ - public enum TypeEnum - { - /** - * The FUNCTION option of this ChatCompletionTool - */ - FUNCTION("function"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this ChatCompletionTool - */ - 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 ChatCompletionTool - */ - @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( "function" ) - private FunctionObject function; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ChatCompletionTool. - */ - protected ChatCompletionTool() - { - } - - /** - * Set the type of this {@link ChatCompletionTool} instance and return the same instance. - * - * @param type - * The type of the tool. Currently, only `function` is supported. - * @return The same instance of this {@link ChatCompletionTool} class - */ - @Nonnull - public ChatCompletionTool type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * The type of the tool. Currently, only `function` is supported. - * - * @return type The type of this {@link ChatCompletionTool} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link ChatCompletionTool} instance. - * - * @param type - * The type of the tool. Currently, only `function` is supported. - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the function of this {@link ChatCompletionTool} instance and return the same instance. - * - * @param function - * The function of this {@link ChatCompletionTool} - * @return The same instance of this {@link ChatCompletionTool} class - */ - @Nonnull - public ChatCompletionTool function( @Nonnull final FunctionObject function ) - { - this.function = function; - return this; - } - - /** - * Get function - * - * @return function The function of this {@link ChatCompletionTool} instance. - */ - @Nonnull - public FunctionObject getFunction() - { - return function; - } - - /** - * Set the function of this {@link ChatCompletionTool} instance. - * - * @param function - * The function of this {@link ChatCompletionTool} - */ - public void setFunction( @Nonnull final FunctionObject function ) - { - this.function = function; - } - - /** - * Get the names of the unrecognizable properties of the {@link ChatCompletionTool}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ChatCompletionTool} 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("ChatCompletionTool has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ChatCompletionTool} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( function != null ) - declaredFields.put("function", function); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ChatCompletionTool} 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 ChatCompletionTool chatCompletionTool = (ChatCompletionTool) o; - return Objects.equals(this.cloudSdkCustomFields, chatCompletionTool.cloudSdkCustomFields) - && Objects.equals(this.type, chatCompletionTool.type) - && Objects.equals(this.function, chatCompletionTool.function); - } - - @Override - public int hashCode() - { - return Objects.hash(type, function, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ChatCompletionTool {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" function: ").append(toIndentedString(function)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java deleted file mode 100644 index ac6e70339..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessage.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * ChatMessage - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = AssistantChatMessage.class ), - @JsonSubTypes.Type( value = DeveloperChatMessage.class ), - @JsonSubTypes.Type( value = SystemChatMessage.class ), - @JsonSubTypes.Type( value = ToolChatMessage.class ), - @JsonSubTypes.Type( value = UserChatMessage.class ), } ) - -public interface ChatMessage -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java new file mode 100644 index 000000000..7d5bb90be --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java @@ -0,0 +1,327 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Cola + */ + +@Beta // CHECKSTYLE:OFF +public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping +// CHECKSTYLE:ON +{ + @JsonProperty( "sodaType" ) + private String sodaType; + + @JsonProperty( "caffeine" ) + private Boolean caffeine; + + @JsonProperty( "logo" ) + private ColaLogo logo; + + @JsonProperty( "barCode" ) + private ColaBarCode barCode; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for Cola. + */ + protected Cola() + { + } + + /** + * Set the sodaType of this {@link Cola} instance and return the same instance. + * + * @param sodaType + * The sodaType of this {@link Cola} + * @return The same instance of this {@link Cola} class + */ + @Nonnull + public Cola sodaType( @Nullable final String sodaType ) + { + this.sodaType = sodaType; + return this; + } + + /** + * Get sodaType + * + * @return sodaType The sodaType of this {@link Cola} instance. + */ + @Nonnull + public String getSodaType() + { + return sodaType; + } + + /** + * Set the sodaType of this {@link Cola} instance. + * + * @param sodaType + * The sodaType of this {@link Cola} + */ + public void setSodaType( @Nullable final String sodaType ) + { + this.sodaType = sodaType; + } + + /** + * Set the caffeine of this {@link Cola} instance and return the same instance. + * + * @param caffeine + * The caffeine of this {@link Cola} + * @return The same instance of this {@link Cola} class + */ + @Nonnull + public Cola caffeine( @Nullable final Boolean caffeine ) + { + this.caffeine = caffeine; + return this; + } + + /** + * Get caffeine + * + * @return caffeine The caffeine of this {@link Cola} instance. + */ + @Nonnull + public Boolean isCaffeine() + { + return caffeine; + } + + /** + * Set the caffeine of this {@link Cola} instance. + * + * @param caffeine + * The caffeine of this {@link Cola} + */ + public void setCaffeine( @Nullable final Boolean caffeine ) + { + this.caffeine = caffeine; + } + + /** + * Set the logo of this {@link Cola} instance and return the same instance. + * + * @param logo + * The logo of this {@link Cola} + * @return The same instance of this {@link Cola} class + */ + @Nonnull + public Cola logo( @Nullable final ColaLogo logo ) + { + this.logo = logo; + return this; + } + + /** + * Get logo + * + * @return logo The logo of this {@link Cola} instance. + */ + @Nonnull + public ColaLogo getLogo() + { + return logo; + } + + /** + * Set the logo of this {@link Cola} instance. + * + * @param logo + * The logo of this {@link Cola} + */ + public void setLogo( @Nullable final ColaLogo logo ) + { + this.logo = logo; + } + + /** + * Set the barCode of this {@link Cola} instance and return the same instance. + * + * @param barCode + * The barCode of this {@link Cola} + * @return The same instance of this {@link Cola} class + */ + @Nonnull + public Cola barCode( @Nullable final ColaBarCode barCode ) + { + this.barCode = barCode; + return this; + } + + /** + * Get barCode + * + * @return barCode The barCode of this {@link Cola} instance. + */ + @Nonnull + public ColaBarCode getBarCode() + { + return barCode; + } + + /** + * Set the barCode of this {@link Cola} instance. + * + * @param barCode + * The barCode of this {@link Cola} + */ + public void setBarCode( @Nullable final ColaBarCode barCode ) + { + this.barCode = barCode; + } + + /** + * Get the names of the unrecognizable properties of the {@link Cola}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Cola} instance. + * + * @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("Cola has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link Cola} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( sodaType != null ) + declaredFields.put("sodaType", sodaType); + if( caffeine != null ) + declaredFields.put("caffeine", caffeine); + if( logo != null ) + declaredFields.put("logo", logo); + if( barCode != null ) + declaredFields.put("barCode", barCode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link Cola} instance. If the map previously contained a mapping for the + * key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final Cola cola = (Cola) o; + return Objects.equals(this.cloudSdkCustomFields, cola.cloudSdkCustomFields) + && Objects.equals(this.sodaType, cola.sodaType) + && Objects.equals(this.caffeine, cola.caffeine) + && Objects.equals(this.logo, cola.logo) + && Objects.equals(this.barCode, cola.barCode); + } + + @Override + public int hashCode() + { + return Objects.hash(sodaType, caffeine, logo, barCode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class Cola {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" caffeine: ").append(toIndentedString(caffeine)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" barCode: ").append(toIndentedString(barCode)).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 "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java similarity index 60% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java index b89cdc2a3..6ca5fa9dc 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ChatMessageContent.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -15,6 +15,7 @@ package com.sap.cloud.sdk.datamodel.openapi.apache.sample.model; +import java.math.BigDecimal; import java.util.List; import javax.annotation.Nonnull; @@ -22,34 +23,34 @@ import com.google.common.annotations.Beta; /** - * ChatMessageContent + * ColaBarCode */ @Beta -public interface ChatMessageContent +public interface ColaBarCode { /** - * Helper class to create {@code List } that implements {@link ChatMessageContent}. + * Helper class to create {@code List } that implements {@link ColaBarCode}. */ - record ListOfTextContents(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatMessageContent {} + record ListOfBigDecimals(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ColaBarCode {} /** - * Creator to enable deserialization of {@code List }. + * Creator to enable deserialization of {@code List }. * * @param val * the value to use - * @return a new instance of {@link ListOfTextContents}. + * @return a new instance of {@link ListOfBigDecimals}. */ @com.fasterxml.jackson.annotation.JsonCreator @Nonnull - static ListOfTextContents createListOfTextContents( @Nonnull final List val ) + static ListOfBigDecimals createListOfBigDecimals( @Nonnull final List val ) { - return new ListOfTextContents(val); + return new ListOfBigDecimals(val); } /** - * Helper class to create {@code String } that implements {@link ChatMessageContent}. + * Helper class to create {@code String } that implements {@link ColaBarCode}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatMessageContent {} + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ColaBarCode {} /** * Creator to enable deserialization of {@code String }. diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java similarity index 55% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java index 8ebd2fb23..84624d0e3 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContent.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -22,35 +22,34 @@ import com.google.common.annotations.Beta; /** - * UserChatMessageContent + * ColaLogo */ @Beta -public interface UserChatMessageContent +public interface ColaLogo { /** - * Helper class to create {@code List } that implements {@link UserChatMessageContent}. + * Helper class to create {@code List> } that implements {@link ColaLogo}. */ - record ListOfUserChatMessageContentItems(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements UserChatMessageContent {} + record ListOfListOfIntegers(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List> values) implements ColaLogo {} /** - * Creator to enable deserialization of {@code List }. + * Creator to enable deserialization of {@code List> }. * * @param val * the value to use - * @return a new instance of {@link ListOfUserChatMessageContentItems}. + * @return a new instance of {@link ListOfListOfIntegers}. */ @com.fasterxml.jackson.annotation.JsonCreator @Nonnull - static ListOfUserChatMessageContentItems createListOfUserChatMessageContentItems( - @Nonnull final List val ) + static ListOfListOfIntegers createListOfListOfIntegers( @Nonnull final List> val ) { - return new ListOfUserChatMessageContentItems(val); + return new ListOfListOfIntegers(val); } /** - * Helper class to create {@code String } that implements {@link UserChatMessageContent}. + * Helper class to create {@code String } that implements {@link ColaLogo}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements UserChatMessageContent {} + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ColaLogo {} /** * Creator to enable deserialization of {@code String }. diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java deleted file mode 100644 index b6a28ae28..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfig.java +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * DPIConfig - */ - -@Beta // CHECKSTYLE:OFF -public class DPIConfig -// CHECKSTYLE:ON -{ - /** - * Type of masking service provider - */ - public enum TypeEnum - { - /** - * The SAP_DATA_PRIVACY_INTEGRATION option of this DPIConfig - */ - SAP_DATA_PRIVACY_INTEGRATION("sap_data_privacy_integration"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this DPIConfig - */ - 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 DPIConfig - */ - @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; - - /** - * Type of masking method to be used - */ - public enum MethodEnum - { - /** - * The ANONYMIZATION option of this DPIConfig - */ - ANONYMIZATION("anonymization"), - - /** - * The PSEUDONYMIZATION option of this DPIConfig - */ - PSEUDONYMIZATION("pseudonymization"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this DPIConfig - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - MethodEnum( 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 DPIConfig - */ - @JsonCreator - @Nonnull - public static MethodEnum fromValue( @Nonnull final String value ) - { - for( MethodEnum b : MethodEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "method" ) - private MethodEnum method; - - @JsonProperty( "entities" ) - private List entities = new ArrayList<>(); - - @JsonProperty( "allowlist" ) - private List allowlist = new ArrayList<>(); - - @JsonProperty( "mask_grounding_input" ) - private DPIConfigMaskGroundingInput maskGroundingInput; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DPIConfig. - */ - protected DPIConfig() - { - } - - /** - * Set the type of this {@link DPIConfig} instance and return the same instance. - * - * @param type - * Type of masking service provider - * @return The same instance of this {@link DPIConfig} class - */ - @Nonnull - public DPIConfig type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Type of masking service provider - * - * @return type The type of this {@link DPIConfig} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link DPIConfig} instance. - * - * @param type - * Type of masking service provider - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the method of this {@link DPIConfig} instance and return the same instance. - * - * @param method - * Type of masking method to be used - * @return The same instance of this {@link DPIConfig} class - */ - @Nonnull - public DPIConfig method( @Nonnull final MethodEnum method ) - { - this.method = method; - return this; - } - - /** - * Type of masking method to be used - * - * @return method The method of this {@link DPIConfig} instance. - */ - @Nonnull - public MethodEnum getMethod() - { - return method; - } - - /** - * Set the method of this {@link DPIConfig} instance. - * - * @param method - * Type of masking method to be used - */ - public void setMethod( @Nonnull final MethodEnum method ) - { - this.method = method; - } - - /** - * Set the entities of this {@link DPIConfig} instance and return the same instance. - * - * @param entities - * List of entities to be masked - * @return The same instance of this {@link DPIConfig} class - */ - @Nonnull - public DPIConfig entities( @Nonnull final List entities ) - { - this.entities = entities; - return this; - } - - /** - * Add one entities instance to this {@link DPIConfig}. - * - * @param entitiesItem - * The entities that should be added - * @return The same instance of type {@link DPIConfig} - */ - @Nonnull - public DPIConfig addEntitiesItem( @Nonnull final DPIEntityConfig entitiesItem ) - { - if( this.entities == null ) { - this.entities = new ArrayList<>(); - } - this.entities.add(entitiesItem); - return this; - } - - /** - * List of entities to be masked - * - * @return entities The entities of this {@link DPIConfig} instance. - */ - @Nonnull - public List getEntities() - { - return entities; - } - - /** - * Set the entities of this {@link DPIConfig} instance. - * - * @param entities - * List of entities to be masked - */ - public void setEntities( @Nonnull final List entities ) - { - this.entities = entities; - } - - /** - * Set the allowlist of this {@link DPIConfig} instance and return the same instance. - * - * @param allowlist - * List of strings that should not be masked - * @return The same instance of this {@link DPIConfig} class - */ - @Nonnull - public DPIConfig allowlist( @Nullable final List allowlist ) - { - this.allowlist = allowlist; - return this; - } - - /** - * Add one allowlist instance to this {@link DPIConfig}. - * - * @param allowlistItem - * The allowlist that should be added - * @return The same instance of type {@link DPIConfig} - */ - @Nonnull - public DPIConfig addAllowlistItem( @Nonnull final String allowlistItem ) - { - if( this.allowlist == null ) { - this.allowlist = new ArrayList<>(); - } - this.allowlist.add(allowlistItem); - return this; - } - - /** - * List of strings that should not be masked - * - * @return allowlist The allowlist of this {@link DPIConfig} instance. - */ - @Nonnull - public List getAllowlist() - { - return allowlist; - } - - /** - * Set the allowlist of this {@link DPIConfig} instance. - * - * @param allowlist - * List of strings that should not be masked - */ - public void setAllowlist( @Nullable final List allowlist ) - { - this.allowlist = allowlist; - } - - /** - * Set the maskGroundingInput of this {@link DPIConfig} instance and return the same instance. - * - * @param maskGroundingInput - * The maskGroundingInput of this {@link DPIConfig} - * @return The same instance of this {@link DPIConfig} class - */ - @Nonnull - public DPIConfig maskGroundingInput( @Nullable final DPIConfigMaskGroundingInput maskGroundingInput ) - { - this.maskGroundingInput = maskGroundingInput; - return this; - } - - /** - * Get maskGroundingInput - * - * @return maskGroundingInput The maskGroundingInput of this {@link DPIConfig} instance. - */ - @Nonnull - public DPIConfigMaskGroundingInput getMaskGroundingInput() - { - return maskGroundingInput; - } - - /** - * Set the maskGroundingInput of this {@link DPIConfig} instance. - * - * @param maskGroundingInput - * The maskGroundingInput of this {@link DPIConfig} - */ - public void setMaskGroundingInput( @Nullable final DPIConfigMaskGroundingInput maskGroundingInput ) - { - this.maskGroundingInput = maskGroundingInput; - } - - /** - * Get the names of the unrecognizable properties of the {@link DPIConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DPIConfig} 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("DPIConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DPIConfig} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( method != null ) - declaredFields.put("method", method); - if( entities != null ) - declaredFields.put("entities", entities); - if( allowlist != null ) - declaredFields.put("allowlist", allowlist); - if( maskGroundingInput != null ) - declaredFields.put("maskGroundingInput", maskGroundingInput); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DPIConfig} 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 DPIConfig dpIConfig = (DPIConfig) o; - return Objects.equals(this.cloudSdkCustomFields, dpIConfig.cloudSdkCustomFields) - && Objects.equals(this.type, dpIConfig.type) - && Objects.equals(this.method, dpIConfig.method) - && Objects.equals(this.entities, dpIConfig.entities) - && Objects.equals(this.allowlist, dpIConfig.allowlist) - && Objects.equals(this.maskGroundingInput, dpIConfig.maskGroundingInput); - } - - @Override - public int hashCode() - { - return Objects.hash(type, method, entities, allowlist, maskGroundingInput, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DPIConfig {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); - sb.append(" allowlist: ").append(toIndentedString(allowlist)).append("\n"); - sb.append(" maskGroundingInput: ").append(toIndentedString(maskGroundingInput)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java deleted file mode 100644 index 6b386e048..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIConfigMaskGroundingInput.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * DPIConfigMaskGroundingInput - */ - -@Beta // CHECKSTYLE:OFF -public class DPIConfigMaskGroundingInput -// CHECKSTYLE:ON -{ - @JsonProperty( "enabled" ) - private Boolean enabled = false; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DPIConfigMaskGroundingInput. - */ - protected DPIConfigMaskGroundingInput() - { - } - - /** - * Set the enabled of this {@link DPIConfigMaskGroundingInput} instance and return the same instance. - * - * @param enabled - * controls whether the input to the grounding module will be masked with the configuration supplied in - * the masking module - * @return The same instance of this {@link DPIConfigMaskGroundingInput} class - */ - @Nonnull - public DPIConfigMaskGroundingInput enabled( @Nullable final Boolean enabled ) - { - this.enabled = enabled; - return this; - } - - /** - * controls whether the input to the grounding module will be masked with the configuration supplied in the masking - * module - * - * @return enabled The enabled of this {@link DPIConfigMaskGroundingInput} instance. - */ - @Nonnull - public Boolean isEnabled() - { - return enabled; - } - - /** - * Set the enabled of this {@link DPIConfigMaskGroundingInput} instance. - * - * @param enabled - * controls whether the input to the grounding module will be masked with the configuration supplied in - * the masking module - */ - public void setEnabled( @Nullable final Boolean enabled ) - { - this.enabled = enabled; - } - - /** - * Get the names of the unrecognizable properties of the {@link DPIConfigMaskGroundingInput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DPIConfigMaskGroundingInput} 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("DPIConfigMaskGroundingInput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DPIConfigMaskGroundingInput} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( enabled != null ) - declaredFields.put("enabled", enabled); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DPIConfigMaskGroundingInput} 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 DPIConfigMaskGroundingInput dpIConfigMaskGroundingInput = (DPIConfigMaskGroundingInput) o; - return Objects.equals(this.cloudSdkCustomFields, dpIConfigMaskGroundingInput.cloudSdkCustomFields) - && Objects.equals(this.enabled, dpIConfigMaskGroundingInput.enabled); - } - - @Override - public int hashCode() - { - return Objects.hash(enabled, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DPIConfigMaskGroundingInput {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java deleted file mode 100644 index 3dad3a337..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPICustomEntity.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * DPICustomEntity - */ - -@Beta // CHECKSTYLE:OFF -public class DPICustomEntity implements DPIEntityConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "regex" ) - private String regex; - - @JsonProperty( "replacement_strategy" ) - private DPIMethodConstant replacementStrategy; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DPICustomEntity. - */ - protected DPICustomEntity() - { - } - - /** - * Set the regex of this {@link DPICustomEntity} instance and return the same instance. - * - * @param regex - * Regular expression to match the entity - * @return The same instance of this {@link DPICustomEntity} class - */ - @Nonnull - public DPICustomEntity regex( @Nonnull final String regex ) - { - this.regex = regex; - return this; - } - - /** - * Regular expression to match the entity - * - * @return regex The regex of this {@link DPICustomEntity} instance. - */ - @Nonnull - public String getRegex() - { - return regex; - } - - /** - * Set the regex of this {@link DPICustomEntity} instance. - * - * @param regex - * Regular expression to match the entity - */ - public void setRegex( @Nonnull final String regex ) - { - this.regex = regex; - } - - /** - * Set the replacementStrategy of this {@link DPICustomEntity} instance and return the same instance. - * - * @param replacementStrategy - * The replacementStrategy of this {@link DPICustomEntity} - * @return The same instance of this {@link DPICustomEntity} class - */ - @Nonnull - public DPICustomEntity replacementStrategy( @Nonnull final DPIMethodConstant replacementStrategy ) - { - this.replacementStrategy = replacementStrategy; - return this; - } - - /** - * Get replacementStrategy - * - * @return replacementStrategy The replacementStrategy of this {@link DPICustomEntity} instance. - */ - @Nonnull - public DPIMethodConstant getReplacementStrategy() - { - return replacementStrategy; - } - - /** - * Set the replacementStrategy of this {@link DPICustomEntity} instance. - * - * @param replacementStrategy - * The replacementStrategy of this {@link DPICustomEntity} - */ - public void setReplacementStrategy( @Nonnull final DPIMethodConstant replacementStrategy ) - { - this.replacementStrategy = replacementStrategy; - } - - /** - * Get the names of the unrecognizable properties of the {@link DPICustomEntity}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DPICustomEntity} 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("DPICustomEntity has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DPICustomEntity} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( regex != null ) - declaredFields.put("regex", regex); - if( replacementStrategy != null ) - declaredFields.put("replacementStrategy", replacementStrategy); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DPICustomEntity} 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 DPICustomEntity dpICustomEntity = (DPICustomEntity) o; - return Objects.equals(this.cloudSdkCustomFields, dpICustomEntity.cloudSdkCustomFields) - && Objects.equals(this.regex, dpICustomEntity.regex) - && Objects.equals(this.replacementStrategy, dpICustomEntity.replacementStrategy); - } - - @Override - public int hashCode() - { - return Objects.hash(regex, replacementStrategy, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DPICustomEntity {\n"); - sb.append(" regex: ").append(toIndentedString(regex)).append("\n"); - sb.append(" replacementStrategy: ").append(toIndentedString(replacementStrategy)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java deleted file mode 100644 index 8c8acdcec..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntities.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import javax.annotation.Nonnull; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Default entities supported by data privacy and integration service - */ - -@Beta -public enum DPIEntities -{ - - PROFILE_PERSON("profile-person"), - - PROFILE_ORG("profile-org"), - - PROFILE_UNIVERSITY("profile-university"), - - PROFILE_LOCATION("profile-location"), - - PROFILE_EMAIL("profile-email"), - - PROFILE_PHONE("profile-phone"), - - PROFILE_ADDRESS("profile-address"), - - PROFILE_SAPIDS_INTERNAL("profile-sapids-internal"), - - PROFILE_SAPIDS_PUBLIC("profile-sapids-public"), - - PROFILE_URL("profile-url"), - - PROFILE_USERNAME_PASSWORD("profile-username-password"), - - PROFILE_NATIONALID("profile-nationalid"), - - PROFILE_IBAN("profile-iban"), - - PROFILE_SSN("profile-ssn"), - - PROFILE_CREDIT_CARD_NUMBER("profile-credit-card-number"), - - PROFILE_PASSPORT("profile-passport"), - - PROFILE_DRIVERLICENSE("profile-driverlicense"), - - PROFILE_NATIONALITY("profile-nationality"), - - PROFILE_RELIGIOUS_GROUP("profile-religious-group"), - - PROFILE_POLITICAL_GROUP("profile-political-group"), - - PROFILE_PRONOUNS_GENDER("profile-pronouns-gender"), - - PROFILE_ETHNICITY("profile-ethnicity"), - - PROFILE_GENDER("profile-gender"), - - PROFILE_SEXUAL_ORIENTATION("profile-sexual-orientation"), - - PROFILE_TRADE_UNION("profile-trade-union"), - - PROFILE_SENSITIVE_DATA("profile-sensitive-data"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - DPIEntities( 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 DPIEntities fromValue( @Nonnull final String value ) - { - for( final DPIEntities b : DPIEntities.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java deleted file mode 100644 index 13d5bc1dc..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodConstant.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Replaces the entity with the specified value followed by an incrementing number - */ - -@Beta // CHECKSTYLE:OFF -public class DPIMethodConstant implements DPIStandardEntityReplacementStrategy -// CHECKSTYLE:ON -{ - /** - * Gets or Sets method - */ - public enum MethodEnum - { - /** - * The CONSTANT option of this DPIMethodConstant - */ - CONSTANT("constant"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this DPIMethodConstant - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - MethodEnum( 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 DPIMethodConstant - */ - @JsonCreator - @Nonnull - public static MethodEnum fromValue( @Nonnull final String value ) - { - for( MethodEnum b : MethodEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "method" ) - private MethodEnum method; - - @JsonProperty( "value" ) - private String value; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DPIMethodConstant. - */ - protected DPIMethodConstant() - { - } - - /** - * Set the method of this {@link DPIMethodConstant} instance and return the same instance. - * - * @param method - * The method of this {@link DPIMethodConstant} - * @return The same instance of this {@link DPIMethodConstant} class - */ - @Nonnull - public DPIMethodConstant method( @Nonnull final MethodEnum method ) - { - this.method = method; - return this; - } - - /** - * Get method - * - * @return method The method of this {@link DPIMethodConstant} instance. - */ - @Nonnull - public MethodEnum getMethod() - { - return method; - } - - /** - * Set the method of this {@link DPIMethodConstant} instance. - * - * @param method - * The method of this {@link DPIMethodConstant} - */ - public void setMethod( @Nonnull final MethodEnum method ) - { - this.method = method; - } - - /** - * Set the value of this {@link DPIMethodConstant} instance and return the same instance. - * - * @param value - * Value to be used for replacement - * @return The same instance of this {@link DPIMethodConstant} class - */ - @Nonnull - public DPIMethodConstant value( @Nonnull final String value ) - { - this.value = value; - return this; - } - - /** - * Value to be used for replacement - * - * @return value The value of this {@link DPIMethodConstant} instance. - */ - @Nonnull - public String getValue() - { - return value; - } - - /** - * Set the value of this {@link DPIMethodConstant} instance. - * - * @param value - * Value to be used for replacement - */ - public void setValue( @Nonnull final String value ) - { - this.value = value; - } - - /** - * Get the names of the unrecognizable properties of the {@link DPIMethodConstant}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DPIMethodConstant} 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("DPIMethodConstant has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DPIMethodConstant} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( method != null ) - declaredFields.put("method", method); - if( value != null ) - declaredFields.put("value", value); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DPIMethodConstant} 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 DPIMethodConstant dpIMethodConstant = (DPIMethodConstant) o; - return Objects.equals(this.cloudSdkCustomFields, dpIMethodConstant.cloudSdkCustomFields) - && Objects.equals(this.method, dpIMethodConstant.method) - && Objects.equals(this.value, dpIMethodConstant.value); - } - - @Override - public int hashCode() - { - return Objects.hash(method, value, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DPIMethodConstant {\n"); - sb.append(" method: ").append(toIndentedString(method)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java deleted file mode 100644 index 564581c2b..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIMethodFabricatedData.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Replaces the entity with a randomly generated value appropriate to its type. - */ - -@Beta // CHECKSTYLE:OFF -public class DPIMethodFabricatedData implements DPIStandardEntityReplacementStrategy -// CHECKSTYLE:ON -{ - /** - * Gets or Sets method - */ - public enum MethodEnum - { - /** - * The FABRICATED_DATA option of this DPIMethodFabricatedData - */ - FABRICATED_DATA("fabricated_data"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this DPIMethodFabricatedData - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - MethodEnum( 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 DPIMethodFabricatedData - */ - @JsonCreator - @Nonnull - public static MethodEnum fromValue( @Nonnull final String value ) - { - for( MethodEnum b : MethodEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "method" ) - private MethodEnum method; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DPIMethodFabricatedData. - */ - protected DPIMethodFabricatedData() - { - } - - /** - * Set the method of this {@link DPIMethodFabricatedData} instance and return the same instance. - * - * @param method - * The method of this {@link DPIMethodFabricatedData} - * @return The same instance of this {@link DPIMethodFabricatedData} class - */ - @Nonnull - public DPIMethodFabricatedData method( @Nonnull final MethodEnum method ) - { - this.method = method; - return this; - } - - /** - * Get method - * - * @return method The method of this {@link DPIMethodFabricatedData} instance. - */ - @Nonnull - public MethodEnum getMethod() - { - return method; - } - - /** - * Set the method of this {@link DPIMethodFabricatedData} instance. - * - * @param method - * The method of this {@link DPIMethodFabricatedData} - */ - public void setMethod( @Nonnull final MethodEnum method ) - { - this.method = method; - } - - /** - * Get the names of the unrecognizable properties of the {@link DPIMethodFabricatedData}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DPIMethodFabricatedData} 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("DPIMethodFabricatedData has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DPIMethodFabricatedData} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( method != null ) - declaredFields.put("method", method); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DPIMethodFabricatedData} 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 DPIMethodFabricatedData dpIMethodFabricatedData = (DPIMethodFabricatedData) o; - return Objects.equals(this.cloudSdkCustomFields, dpIMethodFabricatedData.cloudSdkCustomFields) - && Objects.equals(this.method, dpIMethodFabricatedData.method); - } - - @Override - public int hashCode() - { - return Objects.hash(method, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DPIMethodFabricatedData {\n"); - sb.append(" method: ").append(toIndentedString(method)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java deleted file mode 100644 index 64cce67e4..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntity.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * DPIStandardEntity - */ - -@Beta // CHECKSTYLE:OFF -public class DPIStandardEntity implements DPIEntityConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "type" ) - private DPIEntities type; - - @JsonProperty( "replacement_strategy" ) - private DPIStandardEntityReplacementStrategy replacementStrategy; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DPIStandardEntity. - */ - protected DPIStandardEntity() - { - } - - /** - * Set the type of this {@link DPIStandardEntity} instance and return the same instance. - * - * @param type - * The type of this {@link DPIStandardEntity} - * @return The same instance of this {@link DPIStandardEntity} class - */ - @Nonnull - public DPIStandardEntity type( @Nonnull final DPIEntities type ) - { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link DPIStandardEntity} instance. - */ - @Nonnull - public DPIEntities getType() - { - return type; - } - - /** - * Set the type of this {@link DPIStandardEntity} instance. - * - * @param type - * The type of this {@link DPIStandardEntity} - */ - public void setType( @Nonnull final DPIEntities type ) - { - this.type = type; - } - - /** - * Set the replacementStrategy of this {@link DPIStandardEntity} instance and return the same instance. - * - * @param replacementStrategy - * The replacementStrategy of this {@link DPIStandardEntity} - * @return The same instance of this {@link DPIStandardEntity} class - */ - @Nonnull - public DPIStandardEntity replacementStrategy( - @Nullable final DPIStandardEntityReplacementStrategy replacementStrategy ) - { - this.replacementStrategy = replacementStrategy; - return this; - } - - /** - * Get replacementStrategy - * - * @return replacementStrategy The replacementStrategy of this {@link DPIStandardEntity} instance. - */ - @Nonnull - public DPIStandardEntityReplacementStrategy getReplacementStrategy() - { - return replacementStrategy; - } - - /** - * Set the replacementStrategy of this {@link DPIStandardEntity} instance. - * - * @param replacementStrategy - * The replacementStrategy of this {@link DPIStandardEntity} - */ - public void setReplacementStrategy( @Nullable final DPIStandardEntityReplacementStrategy replacementStrategy ) - { - this.replacementStrategy = replacementStrategy; - } - - /** - * Get the names of the unrecognizable properties of the {@link DPIStandardEntity}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DPIStandardEntity} 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("DPIStandardEntity has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DPIStandardEntity} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( replacementStrategy != null ) - declaredFields.put("replacementStrategy", replacementStrategy); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DPIStandardEntity} 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 DPIStandardEntity dpIStandardEntity = (DPIStandardEntity) o; - return Objects.equals(this.cloudSdkCustomFields, dpIStandardEntity.cloudSdkCustomFields) - && Objects.equals(this.type, dpIStandardEntity.type) - && Objects.equals(this.replacementStrategy, dpIStandardEntity.replacementStrategy); - } - - @Override - public int hashCode() - { - return Objects.hash(type, replacementStrategy, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DPIStandardEntity {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" replacementStrategy: ").append(toIndentedString(replacementStrategy)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java deleted file mode 100644 index 64f03bdcf..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIStandardEntityReplacementStrategy.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * Replacement strategy to be used for the entity - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = DPIMethodConstant.class ), - @JsonSubTypes.Type( value = DPIMethodFabricatedData.class ), } ) - -public interface DPIStandardEntityReplacementStrategy -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java deleted file mode 100644 index ea712242f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DataRepositoryType.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import javax.annotation.Nonnull; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Only include DataRepositories with the given type. - */ - -@Beta -public enum DataRepositoryType -{ - - VECTOR("vector"), - - HELP_SAP_COM("help.sap.com"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - DataRepositoryType( String value ) - { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() - { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() - { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value - * The input value. - * - * @return The enum representation of the given value. - */ - @JsonCreator - public static DataRepositoryType fromValue( @Nonnull final String value ) - { - for( final DataRepositoryType b : DataRepositoryType.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java deleted file mode 100644 index c3c17e4c8..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DeveloperChatMessage.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * DeveloperChatMessage - */ - -@Beta // CHECKSTYLE:OFF -public class DeveloperChatMessage implements ChatMessage -// CHECKSTYLE:ON -{ - /** - * Gets or Sets role - */ - public enum RoleEnum - { - /** - * The DEVELOPER option of this DeveloperChatMessage - */ - DEVELOPER("developer"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this DeveloperChatMessage - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum( 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 DeveloperChatMessage - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue( @Nonnull final String value ) - { - for( RoleEnum b : RoleEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "role" ) - private RoleEnum role; - - @JsonProperty( "content" ) - private ChatMessageContent content; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DeveloperChatMessage. - */ - protected DeveloperChatMessage() - { - } - - /** - * Set the role of this {@link DeveloperChatMessage} instance and return the same instance. - * - * @param role - * The role of this {@link DeveloperChatMessage} - * @return The same instance of this {@link DeveloperChatMessage} class - */ - @Nonnull - public DeveloperChatMessage role( @Nonnull final RoleEnum role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link DeveloperChatMessage} instance. - */ - @Nonnull - public RoleEnum getRole() - { - return role; - } - - /** - * Set the role of this {@link DeveloperChatMessage} instance. - * - * @param role - * The role of this {@link DeveloperChatMessage} - */ - public void setRole( @Nonnull final RoleEnum role ) - { - this.role = role; - } - - /** - * Set the content of this {@link DeveloperChatMessage} instance and return the same instance. - * - * @param content - * The content of this {@link DeveloperChatMessage} - * @return The same instance of this {@link DeveloperChatMessage} class - */ - @Nonnull - public DeveloperChatMessage content( @Nonnull final ChatMessageContent content ) - { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link DeveloperChatMessage} instance. - */ - @Nonnull - public ChatMessageContent getContent() - { - return content; - } - - /** - * Set the content of this {@link DeveloperChatMessage} instance. - * - * @param content - * The content of this {@link DeveloperChatMessage} - */ - public void setContent( @Nonnull final ChatMessageContent content ) - { - this.content = content; - } - - /** - * Get the names of the unrecognizable properties of the {@link DeveloperChatMessage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DeveloperChatMessage} 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("DeveloperChatMessage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DeveloperChatMessage} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( role != null ) - declaredFields.put("role", role); - if( content != null ) - declaredFields.put("content", content); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DeveloperChatMessage} 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 DeveloperChatMessage developerChatMessage = (DeveloperChatMessage) o; - return Objects.equals(this.cloudSdkCustomFields, developerChatMessage.cloudSdkCustomFields) - && Objects.equals(this.role, developerChatMessage.role) - && Objects.equals(this.content, developerChatMessage.content); - } - - @Override - public int hashCode() - { - return Objects.hash(role, content, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DeveloperChatMessage {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java deleted file mode 100644 index 46854776a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DocumentGroundingFilter.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * DocumentGroundingFilter - */ - -@Beta // CHECKSTYLE:OFF -public class DocumentGroundingFilter implements GroundingModuleConfigConfigFiltersInner -// CHECKSTYLE:ON -{ - @JsonProperty( "id" ) - private String id; - - @JsonProperty( "search_config" ) - private GroundingFilterSearchConfiguration searchConfig; - - @JsonProperty( "data_repositories" ) - private List dataRepositories = new ArrayList<>(Arrays.asList("*")); - - @JsonProperty( "data_repository_type" ) - private DataRepositoryType dataRepositoryType; - - @JsonProperty( "data_repository_metadata" ) - private List dataRepositoryMetadata = new ArrayList<>(); - - @JsonProperty( "document_metadata" ) - private List documentMetadata = new ArrayList<>(); - - @JsonProperty( "chunk_metadata" ) - private List chunkMetadata = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for DocumentGroundingFilter. - */ - protected DocumentGroundingFilter() - { - } - - /** - * Set the id of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param id - * Identifier of this SearchFilter - unique per request. - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter id( @Nullable final String id ) - { - this.id = id; - return this; - } - - /** - * Identifier of this SearchFilter - unique per request. - * - * @return id The id of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public String getId() - { - return id; - } - - /** - * Set the id of this {@link DocumentGroundingFilter} instance. - * - * @param id - * Identifier of this SearchFilter - unique per request. - */ - public void setId( @Nullable final String id ) - { - this.id = id; - } - - /** - * Set the searchConfig of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param searchConfig - * The searchConfig of this {@link DocumentGroundingFilter} - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter searchConfig( @Nullable final GroundingFilterSearchConfiguration searchConfig ) - { - this.searchConfig = searchConfig; - return this; - } - - /** - * Get searchConfig - * - * @return searchConfig The searchConfig of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public GroundingFilterSearchConfiguration getSearchConfig() - { - return searchConfig; - } - - /** - * Set the searchConfig of this {@link DocumentGroundingFilter} instance. - * - * @param searchConfig - * The searchConfig of this {@link DocumentGroundingFilter} - */ - public void setSearchConfig( @Nullable final GroundingFilterSearchConfiguration searchConfig ) - { - this.searchConfig = searchConfig; - } - - /** - * Set the dataRepositories of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param dataRepositories - * Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository - * ids. - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter dataRepositories( @Nullable final List dataRepositories ) - { - this.dataRepositories = dataRepositories; - return this; - } - - /** - * Add one dataRepositories instance to this {@link DocumentGroundingFilter}. - * - * @param dataRepositoriesItem - * The dataRepositories that should be added - * @return The same instance of type {@link DocumentGroundingFilter} - */ - @Nonnull - public DocumentGroundingFilter addDataRepositoriesItem( @Nonnull final String dataRepositoriesItem ) - { - if( this.dataRepositories == null ) { - this.dataRepositories = new ArrayList<>(Arrays.asList("*")); - } - this.dataRepositories.add(dataRepositoriesItem); - return this; - } - - /** - * Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. - * - * @return dataRepositories The dataRepositories of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public List getDataRepositories() - { - return dataRepositories; - } - - /** - * Set the dataRepositories of this {@link DocumentGroundingFilter} instance. - * - * @param dataRepositories - * Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository - * ids. - */ - public void setDataRepositories( @Nullable final List dataRepositories ) - { - this.dataRepositories = dataRepositories; - } - - /** - * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param dataRepositoryType - * The dataRepositoryType of this {@link DocumentGroundingFilter} - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter dataRepositoryType( @Nonnull final DataRepositoryType dataRepositoryType ) - { - this.dataRepositoryType = dataRepositoryType; - return this; - } - - /** - * Get dataRepositoryType - * - * @return dataRepositoryType The dataRepositoryType of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public DataRepositoryType getDataRepositoryType() - { - return dataRepositoryType; - } - - /** - * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance. - * - * @param dataRepositoryType - * The dataRepositoryType of this {@link DocumentGroundingFilter} - */ - public void setDataRepositoryType( @Nonnull final DataRepositoryType dataRepositoryType ) - { - this.dataRepositoryType = dataRepositoryType; - } - - /** - * Set the dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param dataRepositoryMetadata - * Restrict DataRepositories considered during search to those annotated with the given metadata. Useful - * when combined with dataRepositories=['*'] - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter dataRepositoryMetadata( - @Nullable final List dataRepositoryMetadata ) - { - this.dataRepositoryMetadata = dataRepositoryMetadata; - return this; - } - - /** - * Add one dataRepositoryMetadata instance to this {@link DocumentGroundingFilter}. - * - * @param dataRepositoryMetadataItem - * The dataRepositoryMetadata that should be added - * @return The same instance of type {@link DocumentGroundingFilter} - */ - @Nonnull - public DocumentGroundingFilter addDataRepositoryMetadataItem( - @Nonnull final KeyValueListPair dataRepositoryMetadataItem ) - { - if( this.dataRepositoryMetadata == null ) { - this.dataRepositoryMetadata = new ArrayList<>(); - } - this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); - return this; - } - - /** - * Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when - * combined with dataRepositories=['*'] - * - * @return dataRepositoryMetadata The dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public List getDataRepositoryMetadata() - { - return dataRepositoryMetadata; - } - - /** - * Set the dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance. - * - * @param dataRepositoryMetadata - * Restrict DataRepositories considered during search to those annotated with the given metadata. Useful - * when combined with dataRepositories=['*'] - */ - public void setDataRepositoryMetadata( @Nullable final List dataRepositoryMetadata ) - { - this.dataRepositoryMetadata = dataRepositoryMetadata; - } - - /** - * Set the documentMetadata of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param documentMetadata - * Restrict documents considered during search to those annotated with the given metadata. - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter documentMetadata( - @Nullable final List documentMetadata ) - { - this.documentMetadata = documentMetadata; - return this; - } - - /** - * Add one documentMetadata instance to this {@link DocumentGroundingFilter}. - * - * @param documentMetadataItem - * The documentMetadata that should be added - * @return The same instance of type {@link DocumentGroundingFilter} - */ - @Nonnull - public DocumentGroundingFilter addDocumentMetadataItem( - @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem ) - { - if( this.documentMetadata == null ) { - this.documentMetadata = new ArrayList<>(); - } - this.documentMetadata.add(documentMetadataItem); - return this; - } - - /** - * Restrict documents considered during search to those annotated with the given metadata. - * - * @return documentMetadata The documentMetadata of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public List getDocumentMetadata() - { - return documentMetadata; - } - - /** - * Set the documentMetadata of this {@link DocumentGroundingFilter} instance. - * - * @param documentMetadata - * Restrict documents considered during search to those annotated with the given metadata. - */ - public void setDocumentMetadata( @Nullable final List documentMetadata ) - { - this.documentMetadata = documentMetadata; - } - - /** - * Set the chunkMetadata of this {@link DocumentGroundingFilter} instance and return the same instance. - * - * @param chunkMetadata - * Restrict chunks considered during search to those with the given metadata. - * @return The same instance of this {@link DocumentGroundingFilter} class - */ - @Nonnull - public DocumentGroundingFilter chunkMetadata( @Nullable final List chunkMetadata ) - { - this.chunkMetadata = chunkMetadata; - return this; - } - - /** - * Add one chunkMetadata instance to this {@link DocumentGroundingFilter}. - * - * @param chunkMetadataItem - * The chunkMetadata that should be added - * @return The same instance of type {@link DocumentGroundingFilter} - */ - @Nonnull - public DocumentGroundingFilter addChunkMetadataItem( @Nonnull final KeyValueListPair chunkMetadataItem ) - { - if( this.chunkMetadata == null ) { - this.chunkMetadata = new ArrayList<>(); - } - this.chunkMetadata.add(chunkMetadataItem); - return this; - } - - /** - * Restrict chunks considered during search to those with the given metadata. - * - * @return chunkMetadata The chunkMetadata of this {@link DocumentGroundingFilter} instance. - */ - @Nonnull - public List getChunkMetadata() - { - return chunkMetadata; - } - - /** - * Set the chunkMetadata of this {@link DocumentGroundingFilter} instance. - * - * @param chunkMetadata - * Restrict chunks considered during search to those with the given metadata. - */ - public void setChunkMetadata( @Nullable final List chunkMetadata ) - { - this.chunkMetadata = chunkMetadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link DocumentGroundingFilter}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DocumentGroundingFilter} 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("DocumentGroundingFilter has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DocumentGroundingFilter} 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( searchConfig != null ) - declaredFields.put("searchConfig", searchConfig); - if( dataRepositories != null ) - declaredFields.put("dataRepositories", dataRepositories); - if( dataRepositoryType != null ) - declaredFields.put("dataRepositoryType", dataRepositoryType); - if( dataRepositoryMetadata != null ) - declaredFields.put("dataRepositoryMetadata", dataRepositoryMetadata); - if( documentMetadata != null ) - declaredFields.put("documentMetadata", documentMetadata); - if( chunkMetadata != null ) - declaredFields.put("chunkMetadata", chunkMetadata); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DocumentGroundingFilter} 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 DocumentGroundingFilter documentGroundingFilter = (DocumentGroundingFilter) o; - return Objects.equals(this.cloudSdkCustomFields, documentGroundingFilter.cloudSdkCustomFields) - && Objects.equals(this.id, documentGroundingFilter.id) - && Objects.equals(this.searchConfig, documentGroundingFilter.searchConfig) - && Objects.equals(this.dataRepositories, documentGroundingFilter.dataRepositories) - && Objects.equals(this.dataRepositoryType, documentGroundingFilter.dataRepositoryType) - && Objects.equals(this.dataRepositoryMetadata, documentGroundingFilter.dataRepositoryMetadata) - && Objects.equals(this.documentMetadata, documentGroundingFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, documentGroundingFilter.chunkMetadata); - } - - @Override - public int hashCode() - { - return Objects - .hash( - id, - searchConfig, - dataRepositories, - dataRepositoryType, - dataRepositoryMetadata, - documentMetadata, - chunkMetadata, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class DocumentGroundingFilter {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" searchConfig: ").append(toIndentedString(searchConfig)).append("\n"); - sb.append(" dataRepositories: ").append(toIndentedString(dataRepositories)).append("\n"); - sb.append(" dataRepositoryType: ").append(toIndentedString(dataRepositoryType)).append("\n"); - sb.append(" dataRepositoryMetadata: ").append(toIndentedString(dataRepositoryMetadata)).append("\n"); - sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); - sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java deleted file mode 100644 index 449e750ee..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ErrorResponse.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * ErrorResponse - */ - -@Beta // CHECKSTYLE:OFF -public class ErrorResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "request_id" ) - private String requestId; - - @JsonProperty( "message" ) - private String message; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ErrorResponse. - */ - protected ErrorResponse() - { - } - - /** - * Set the requestId of this {@link ErrorResponse} instance and return the same instance. - * - * @param requestId - * The requestId of this {@link ErrorResponse} - * @return The same instance of this {@link ErrorResponse} class - */ - @Nonnull - public ErrorResponse requestId( @Nonnull final String requestId ) - { - this.requestId = requestId; - return this; - } - - /** - * Get requestId - * - * @return requestId The requestId of this {@link ErrorResponse} instance. - */ - @Nonnull - public String getRequestId() - { - return requestId; - } - - /** - * Set the requestId of this {@link ErrorResponse} instance. - * - * @param requestId - * The requestId of this {@link ErrorResponse} - */ - public void setRequestId( @Nonnull final String requestId ) - { - this.requestId = requestId; - } - - /** - * Set the message of this {@link ErrorResponse} instance and return the same instance. - * - * @param message - * The message of this {@link ErrorResponse} - * @return The same instance of this {@link ErrorResponse} class - */ - @Nonnull - public ErrorResponse message( @Nonnull final String message ) - { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link ErrorResponse} instance. - */ - @Nonnull - public String getMessage() - { - return message; - } - - /** - * Set the message of this {@link ErrorResponse} instance. - * - * @param message - * The message of this {@link ErrorResponse} - */ - public void setMessage( @Nonnull final String message ) - { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link ErrorResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ErrorResponse} 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("ErrorResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ErrorResponse} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( requestId != null ) - declaredFields.put("requestId", requestId); - if( message != null ) - declaredFields.put("message", message); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ErrorResponse} 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 ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.cloudSdkCustomFields, errorResponse.cloudSdkCustomFields) - && Objects.equals(this.requestId, errorResponse.requestId) - && Objects.equals(this.message, errorResponse.message); - } - - @Override - public int hashCode() - { - return Objects.hash(requestId, message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); - sb.append(" requestId: ").append(toIndentedString(requestId)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java similarity index 50% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java index 245f3d533..0215af3cb 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/KeyValueListPair.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -15,9 +15,7 @@ package com.sap.cloud.sdk.datamodel.openapi.apache.sample.model; -import java.util.ArrayList; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Objects; @@ -33,121 +31,143 @@ import com.google.common.annotations.Beta; /** - * KeyValueListPair + * Fanta */ @Beta // CHECKSTYLE:OFF -public class KeyValueListPair +public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping // CHECKSTYLE:ON { - @JsonProperty( "key" ) - private String key; + @JsonProperty( "sodaType" ) + private String sodaType; - @JsonProperty( "value" ) - private List value = new ArrayList<>(); + @JsonProperty( "color" ) + private String color; + + @JsonProperty( "flavor" ) + private FantaFlavor flavor; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** - * Default constructor for KeyValueListPair. + * Default constructor for Fanta. */ - protected KeyValueListPair() + protected Fanta() { } /** - * Set the key of this {@link KeyValueListPair} instance and return the same instance. + * Set the sodaType of this {@link Fanta} instance and return the same instance. * - * @param key - * The key of this {@link KeyValueListPair} - * @return The same instance of this {@link KeyValueListPair} class + * @param sodaType + * The sodaType of this {@link Fanta} + * @return The same instance of this {@link Fanta} class */ @Nonnull - public KeyValueListPair key( @Nonnull final String key ) + public Fanta sodaType( @Nullable final String sodaType ) { - this.key = key; + this.sodaType = sodaType; return this; } /** - * Get key + * Get sodaType * - * @return key The key of this {@link KeyValueListPair} instance. + * @return sodaType The sodaType of this {@link Fanta} instance. */ @Nonnull - public String getKey() + public String getSodaType() { - return key; + return sodaType; } /** - * Set the key of this {@link KeyValueListPair} instance. + * Set the sodaType of this {@link Fanta} instance. * - * @param key - * The key of this {@link KeyValueListPair} + * @param sodaType + * The sodaType of this {@link Fanta} */ - public void setKey( @Nonnull final String key ) + public void setSodaType( @Nullable final String sodaType ) { - this.key = key; + this.sodaType = sodaType; } /** - * Set the value of this {@link KeyValueListPair} instance and return the same instance. + * Set the color of this {@link Fanta} instance and return the same instance. * - * @param value - * The value of this {@link KeyValueListPair} - * @return The same instance of this {@link KeyValueListPair} class + * @param color + * The color of this {@link Fanta} + * @return The same instance of this {@link Fanta} class */ @Nonnull - public KeyValueListPair value( @Nonnull final List value ) + public Fanta color( @Nullable final String color ) { - this.value = value; + this.color = color; return this; } /** - * Add one value instance to this {@link KeyValueListPair}. + * Get color * - * @param valueItem - * The value that should be added - * @return The same instance of type {@link KeyValueListPair} + * @return color The color of this {@link Fanta} instance. */ @Nonnull - public KeyValueListPair addValueItem( @Nonnull final String valueItem ) + public String getColor() { - if( this.value == null ) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); + return color; + } + + /** + * Set the color of this {@link Fanta} instance. + * + * @param color + * The color of this {@link Fanta} + */ + public void setColor( @Nullable final String color ) + { + this.color = color; + } + + /** + * Set the flavor of this {@link Fanta} instance and return the same instance. + * + * @param flavor + * The flavor of this {@link Fanta} + * @return The same instance of this {@link Fanta} class + */ + @Nonnull + public Fanta flavor( @Nullable final FantaFlavor flavor ) + { + this.flavor = flavor; return this; } /** - * Get value + * Get flavor * - * @return value The value of this {@link KeyValueListPair} instance. + * @return flavor The flavor of this {@link Fanta} instance. */ @Nonnull - public List getValue() + public FantaFlavor getFlavor() { - return value; + return flavor; } /** - * Set the value of this {@link KeyValueListPair} instance. + * Set the flavor of this {@link Fanta} instance. * - * @param value - * The value of this {@link KeyValueListPair} + * @param flavor + * The flavor of this {@link Fanta} */ - public void setValue( @Nonnull final List value ) + public void setFlavor( @Nullable final FantaFlavor flavor ) { - this.value = value; + this.flavor = flavor; } /** - * Get the names of the unrecognizable properties of the {@link KeyValueListPair}. + * Get the names of the unrecognizable properties of the {@link Fanta}. * * @return The set of properties names */ @@ -159,7 +179,7 @@ public Set getCustomFieldNames() } /** - * Get the value of an unrecognizable property of this {@link KeyValueListPair} instance. + * Get the value of an unrecognizable property of this {@link Fanta} instance. * * @deprecated Use {@link #toMap()} instead. * @param name @@ -174,13 +194,13 @@ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException { if( !cloudSdkCustomFields.containsKey(name) ) { - throw new NoSuchElementException("KeyValueListPair has no field with name '" + name + "'."); + throw new NoSuchElementException("Fanta has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link KeyValueListPair} instance including unrecognized properties. + * Get the value of all properties of this {@link Fanta} instance including unrecognized properties. * * @return The map of all properties */ @@ -189,16 +209,18 @@ public Object getCustomField( @Nonnull final String name ) public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( key != null ) - declaredFields.put("key", key); - if( value != null ) - declaredFields.put("value", value); + if( sodaType != null ) + declaredFields.put("sodaType", sodaType); + if( color != null ) + declaredFields.put("color", color); + if( flavor != null ) + declaredFields.put("flavor", flavor); return declaredFields; } /** - * Set an unrecognizable property of this {@link KeyValueListPair} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link Fanta} instance. If the map previously contained a mapping for the + * key, the old value is replaced by the specified value. * * @param customFieldName * The name of the property @@ -220,16 +242,17 @@ public boolean equals( @Nullable final java.lang.Object o ) if( o == null || getClass() != o.getClass() ) { return false; } - final KeyValueListPair keyValueListPair = (KeyValueListPair) o; - return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) - && Objects.equals(this.key, keyValueListPair.key) - && Objects.equals(this.value, keyValueListPair.value); + final Fanta fanta = (Fanta) o; + return Objects.equals(this.cloudSdkCustomFields, fanta.cloudSdkCustomFields) + && Objects.equals(this.sodaType, fanta.sodaType) + && Objects.equals(this.color, fanta.color) + && Objects.equals(this.flavor, fanta.flavor); } @Override public int hashCode() { - return Objects.hash(key, value, cloudSdkCustomFields); + return Objects.hash(sodaType, color, flavor, cloudSdkCustomFields); } @Override @@ -237,9 +260,10 @@ public int hashCode() public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class KeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("class Fanta {\n"); + sb.append(" sodaType: ").append(toIndentedString(sodaType)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" flavor: ").append(toIndentedString(flavor)).append("\n"); cloudSdkCustomFields .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); sb.append("}"); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java new file mode 100644 index 000000000..143119694 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.util.List; + +import javax.annotation.Nonnull; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * FantaFlavor + */ +@Beta +public interface FantaFlavor +{ + /** + * Helper class to create {@code String } that implements {@link FantaFlavor}. + */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements FantaFlavor {} + + /** + * 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 FantaFlavor}. + */ + record InnerInteger(@com.fasterxml.jackson.annotation.JsonValue @Nonnull Integer value) implements FantaFlavor {} + + /** + * 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); + } + + /** + * Helper class to create {@code FlavorType } that implements {@link FantaFlavor}. + */ + record InnerFlavorType(@com.fasterxml.jackson.annotation.JsonValue @Nonnull FlavorType value) implements FantaFlavor {} + + /** + * Creator to enable deserialization of {@code FlavorType }. + * + * @param val + * the value to use + * @return a new instance of {@link InnerFlavorType}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerFlavorType createInnerFlavorType( @Nonnull final FlavorType val ) + { + return new InnerFlavorType(val); + } + + /** + * Helper class to create {@code List } that implements {@link FantaFlavor}. + */ + record ListOfFlavorTypes(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements FantaFlavor {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val + * the value to use + * @return a new instance of {@link ListOfFlavorTypes}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfFlavorTypes createListOfFlavorTypes( @Nonnull final List val ) + { + return new ListOfFlavorTypes(val); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java deleted file mode 100644 index 648ad36f8..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringModuleConfig.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * FilteringModuleConfig - */ - -@Beta // CHECKSTYLE:OFF -public class FilteringModuleConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "input" ) - private InputFilteringConfig input; - - @JsonProperty( "output" ) - private OutputFilteringConfig output; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for FilteringModuleConfig. - */ - protected FilteringModuleConfig() - { - } - - /** - * Set the input of this {@link FilteringModuleConfig} instance and return the same instance. - * - * @param input - * List of provider type and filters - * @return The same instance of this {@link FilteringModuleConfig} class - */ - @Nonnull - public FilteringModuleConfig input( @Nullable final InputFilteringConfig input ) - { - this.input = input; - return this; - } - - /** - * List of provider type and filters - * - * @return input The input of this {@link FilteringModuleConfig} instance. - */ - @Nonnull - public InputFilteringConfig getInput() - { - return input; - } - - /** - * Set the input of this {@link FilteringModuleConfig} instance. - * - * @param input - * List of provider type and filters - */ - public void setInput( @Nullable final InputFilteringConfig input ) - { - this.input = input; - } - - /** - * Set the output of this {@link FilteringModuleConfig} instance and return the same instance. - * - * @param output - * List of provider type and filters - * @return The same instance of this {@link FilteringModuleConfig} class - */ - @Nonnull - public FilteringModuleConfig output( @Nullable final OutputFilteringConfig output ) - { - this.output = output; - return this; - } - - /** - * List of provider type and filters - * - * @return output The output of this {@link FilteringModuleConfig} instance. - */ - @Nonnull - public OutputFilteringConfig getOutput() - { - return output; - } - - /** - * Set the output of this {@link FilteringModuleConfig} instance. - * - * @param output - * List of provider type and filters - */ - public void setOutput( @Nullable final OutputFilteringConfig output ) - { - this.output = output; - } - - /** - * Get the names of the unrecognizable properties of the {@link FilteringModuleConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link FilteringModuleConfig} 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("FilteringModuleConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link FilteringModuleConfig} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( input != null ) - declaredFields.put("input", input); - if( output != null ) - declaredFields.put("output", output); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link FilteringModuleConfig} 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 FilteringModuleConfig filteringModuleConfig = (FilteringModuleConfig) o; - return Objects.equals(this.cloudSdkCustomFields, filteringModuleConfig.cloudSdkCustomFields) - && Objects.equals(this.input, filteringModuleConfig.input) - && Objects.equals(this.output, filteringModuleConfig.output); - } - - @Override - public int hashCode() - { - return Objects.hash(input, output, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class FilteringModuleConfig {\n"); - sb.append(" input: ").append(toIndentedString(input)).append("\n"); - sb.append(" output: ").append(toIndentedString(output)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java deleted file mode 100644 index 77629a087..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FilteringStreamOptions.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Stream options for output filtering. Will be ignored if stream is false. - */ - -@Beta // CHECKSTYLE:OFF -public class FilteringStreamOptions -// CHECKSTYLE:ON -{ - @JsonProperty( "overlap" ) - private Integer overlap = 0; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for FilteringStreamOptions. - */ - protected FilteringStreamOptions() - { - } - - /** - * Set the overlap of this {@link FilteringStreamOptions} instance and return the same instance. - * - * @param overlap - * Number of characters that should be additionally sent to content filtering services from previous - * chunks as additional context. Minimum: 0 Maximum: 10000 - * @return The same instance of this {@link FilteringStreamOptions} class - */ - @Nonnull - public FilteringStreamOptions overlap( @Nullable final Integer overlap ) - { - this.overlap = overlap; - return this; - } - - /** - * Number of characters that should be additionally sent to content filtering services from previous chunks as - * additional context. minimum: 0 maximum: 10000 - * - * @return overlap The overlap of this {@link FilteringStreamOptions} instance. - */ - @Nonnull - public Integer getOverlap() - { - return overlap; - } - - /** - * Set the overlap of this {@link FilteringStreamOptions} instance. - * - * @param overlap - * Number of characters that should be additionally sent to content filtering services from previous - * chunks as additional context. Minimum: 0 Maximum: 10000 - */ - public void setOverlap( @Nullable final Integer overlap ) - { - this.overlap = overlap; - } - - /** - * Get the names of the unrecognizable properties of the {@link FilteringStreamOptions}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link FilteringStreamOptions} 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("FilteringStreamOptions has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link FilteringStreamOptions} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( overlap != null ) - declaredFields.put("overlap", overlap); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link FilteringStreamOptions} 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 FilteringStreamOptions filteringStreamOptions = (FilteringStreamOptions) o; - return Objects.equals(this.cloudSdkCustomFields, filteringStreamOptions.cloudSdkCustomFields) - && Objects.equals(this.overlap, filteringStreamOptions.overlap); - } - - @Override - public int hashCode() - { - return Objects.hash(overlap, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class FilteringStreamOptions {\n"); - sb.append(" overlap: ").append(toIndentedString(overlap)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java similarity index 56% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java index b06e269e9..e95740c27 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentUrl.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -31,104 +31,104 @@ import com.google.common.annotations.Beta; /** - * ImageContentUrl + * FlavorType */ @Beta // CHECKSTYLE:OFF -public class ImageContentUrl +public class FlavorType // CHECKSTYLE:ON { - @JsonProperty( "url" ) - private String url; + @JsonProperty( "intensity" ) + private Integer intensity; - @JsonProperty( "detail" ) - private String detail = "auto"; + @JsonProperty( "nuance" ) + private String nuance; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** - * Default constructor for ImageContentUrl. + * Default constructor for FlavorType. */ - protected ImageContentUrl() + protected FlavorType() { } /** - * Set the url of this {@link ImageContentUrl} instance and return the same instance. + * Set the intensity of this {@link FlavorType} instance and return the same instance. * - * @param url - * The url of this {@link ImageContentUrl} - * @return The same instance of this {@link ImageContentUrl} class + * @param intensity + * The intensity of the flavor + * @return The same instance of this {@link FlavorType} class */ @Nonnull - public ImageContentUrl url( @Nonnull final String url ) + public FlavorType intensity( @Nullable final Integer intensity ) { - this.url = url; + this.intensity = intensity; return this; } /** - * Get url + * The intensity of the flavor * - * @return url The url of this {@link ImageContentUrl} instance. + * @return intensity The intensity of this {@link FlavorType} instance. */ @Nonnull - public String getUrl() + public Integer getIntensity() { - return url; + return intensity; } /** - * Set the url of this {@link ImageContentUrl} instance. + * Set the intensity of this {@link FlavorType} instance. * - * @param url - * The url of this {@link ImageContentUrl} + * @param intensity + * The intensity of the flavor */ - public void setUrl( @Nonnull final String url ) + public void setIntensity( @Nullable final Integer intensity ) { - this.url = url; + this.intensity = intensity; } /** - * Set the detail of this {@link ImageContentUrl} instance and return the same instance. + * Set the nuance of this {@link FlavorType} instance and return the same instance. * - * @param detail - * The detail of this {@link ImageContentUrl} - * @return The same instance of this {@link ImageContentUrl} class + * @param nuance + * The nuance of the flavor + * @return The same instance of this {@link FlavorType} class */ @Nonnull - public ImageContentUrl detail( @Nullable final String detail ) + public FlavorType nuance( @Nullable final String nuance ) { - this.detail = detail; + this.nuance = nuance; return this; } /** - * Get detail + * The nuance of the flavor * - * @return detail The detail of this {@link ImageContentUrl} instance. + * @return nuance The nuance of this {@link FlavorType} instance. */ @Nonnull - public String getDetail() + public String getNuance() { - return detail; + return nuance; } /** - * Set the detail of this {@link ImageContentUrl} instance. + * Set the nuance of this {@link FlavorType} instance. * - * @param detail - * The detail of this {@link ImageContentUrl} + * @param nuance + * The nuance of the flavor */ - public void setDetail( @Nullable final String detail ) + public void setNuance( @Nullable final String nuance ) { - this.detail = detail; + this.nuance = nuance; } /** - * Get the names of the unrecognizable properties of the {@link ImageContentUrl}. + * Get the names of the unrecognizable properties of the {@link FlavorType}. * * @return The set of properties names */ @@ -140,7 +140,7 @@ public Set getCustomFieldNames() } /** - * Get the value of an unrecognizable property of this {@link ImageContentUrl} instance. + * Get the value of an unrecognizable property of this {@link FlavorType} instance. * * @deprecated Use {@link #toMap()} instead. * @param name @@ -155,13 +155,13 @@ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException { if( !cloudSdkCustomFields.containsKey(name) ) { - throw new NoSuchElementException("ImageContentUrl has no field with name '" + name + "'."); + throw new NoSuchElementException("FlavorType has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link ImageContentUrl} instance including unrecognized properties. + * Get the value of all properties of this {@link FlavorType} instance including unrecognized properties. * * @return The map of all properties */ @@ -170,16 +170,16 @@ public Object getCustomField( @Nonnull final String name ) public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( url != null ) - declaredFields.put("url", url); - if( detail != null ) - declaredFields.put("detail", detail); + if( intensity != null ) + declaredFields.put("intensity", intensity); + if( nuance != null ) + declaredFields.put("nuance", nuance); return declaredFields; } /** - * Set an unrecognizable property of this {@link ImageContentUrl} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link FlavorType} 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 @@ -201,16 +201,16 @@ public boolean equals( @Nullable final java.lang.Object o ) if( o == null || getClass() != o.getClass() ) { return false; } - final ImageContentUrl imageContentUrl = (ImageContentUrl) o; - return Objects.equals(this.cloudSdkCustomFields, imageContentUrl.cloudSdkCustomFields) - && Objects.equals(this.url, imageContentUrl.url) - && Objects.equals(this.detail, imageContentUrl.detail); + final FlavorType flavorType = (FlavorType) o; + return Objects.equals(this.cloudSdkCustomFields, flavorType.cloudSdkCustomFields) + && Objects.equals(this.intensity, flavorType.intensity) + && Objects.equals(this.nuance, flavorType.nuance); } @Override public int hashCode() { - return Objects.hash(url, detail, cloudSdkCustomFields); + return Objects.hash(intensity, nuance, cloudSdkCustomFields); } @Override @@ -218,9 +218,9 @@ public int hashCode() public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class ImageContentUrl {\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append("class FlavorType {\n"); + sb.append(" intensity: ").append(toIndentedString(intensity)).append("\n"); + sb.append(" nuance: ").append(toIndentedString(nuance)).append("\n"); cloudSdkCustomFields .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); sb.append("}"); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java similarity index 61% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java index 9cd995069..963d22d89 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonObject.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -33,31 +33,34 @@ import com.google.common.annotations.Beta; /** - * ResponseFormatJsonObject + * Foo */ @Beta // CHECKSTYLE:OFF -public class ResponseFormatJsonObject implements PromptTemplateSpecResponseFormat, TemplateResponseFormat +public class Foo implements OneOfWithEnumDiscriminator // CHECKSTYLE:ON { + @JsonProperty( "foo" ) + private String foo; + /** - * The type of response format being defined: `json_object` + * Gets or Sets disc */ - public enum TypeEnum + public enum DiscEnum { /** - * The JSON_OBJECT option of this ResponseFormatJsonObject + * The DISC_FOO option of this Foo */ - JSON_OBJECT("json_object"), + DISC_FOO("disc_foo"), /** - * The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatJsonObject + * The UNKNOWN_DEFAULT_OPEN_API option of this Foo */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private String value; - TypeEnum( String value ) + DiscEnum( String value ) { this.value = value; } @@ -91,13 +94,13 @@ public String toString() * * @param value * The String value - * @return The enum value of type ResponseFormatJsonObject + * @return The enum value of type Foo */ @JsonCreator @Nonnull - public static TypeEnum fromValue( @Nonnull final String value ) + public static DiscEnum fromValue( @Nonnull final String value ) { - for( TypeEnum b : TypeEnum.values() ) { + for( DiscEnum b : DiscEnum.values() ) { if( b.value.equals(value) ) { return b; } @@ -106,58 +109,94 @@ public static TypeEnum fromValue( @Nonnull final String value ) } } - @JsonProperty( "type" ) - private TypeEnum type; + @JsonProperty( "disc" ) + private DiscEnum disc; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** - * Default constructor for ResponseFormatJsonObject. + * Default constructor for Foo. + */ + protected Foo() + { + } + + /** + * Set the foo of this {@link Foo} instance and return the same instance. + * + * @param foo + * The foo of this {@link Foo} + * @return The same instance of this {@link Foo} class + */ + @Nonnull + public Foo foo( @Nullable final String foo ) + { + this.foo = foo; + return this; + } + + /** + * Get foo + * + * @return foo The foo of this {@link Foo} instance. + */ + @Nonnull + public String getFoo() + { + return foo; + } + + /** + * Set the foo of this {@link Foo} instance. + * + * @param foo + * The foo of this {@link Foo} */ - protected ResponseFormatJsonObject() + public void setFoo( @Nullable final String foo ) { + this.foo = foo; } /** - * Set the type of this {@link ResponseFormatJsonObject} instance and return the same instance. + * Set the disc of this {@link Foo} instance and return the same instance. * - * @param type - * The type of response format being defined: `json_object` - * @return The same instance of this {@link ResponseFormatJsonObject} class + * @param disc + * The disc of this {@link Foo} + * @return The same instance of this {@link Foo} class */ @Nonnull - public ResponseFormatJsonObject type( @Nonnull final TypeEnum type ) + public Foo disc( @Nullable final DiscEnum disc ) { - this.type = type; + this.disc = disc; return this; } /** - * The type of response format being defined: `json_object` + * Get disc * - * @return type The type of this {@link ResponseFormatJsonObject} instance. + * @return disc The disc of this {@link Foo} instance. */ @Nonnull - public TypeEnum getType() + public DiscEnum getDisc() { - return type; + return disc; } /** - * Set the type of this {@link ResponseFormatJsonObject} instance. + * Set the disc of this {@link Foo} instance. * - * @param type - * The type of response format being defined: `json_object` + * @param disc + * The disc of this {@link Foo} */ - public void setType( @Nonnull final TypeEnum type ) + public void setDisc( @Nullable final DiscEnum disc ) { - this.type = type; + this.disc = disc; } /** - * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonObject}. + * Get the names of the unrecognizable properties of the {@link Foo}. * * @return The set of properties names */ @@ -169,7 +208,7 @@ public Set getCustomFieldNames() } /** - * Get the value of an unrecognizable property of this {@link ResponseFormatJsonObject} instance. + * Get the value of an unrecognizable property of this {@link Foo} instance. * * @deprecated Use {@link #toMap()} instead. * @param name @@ -184,14 +223,13 @@ public Object getCustomField( @Nonnull final String name ) throws NoSuchElementException { if( !cloudSdkCustomFields.containsKey(name) ) { - throw new NoSuchElementException("ResponseFormatJsonObject has no field with name '" + name + "'."); + throw new NoSuchElementException("Foo has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link ResponseFormatJsonObject} instance including unrecognized - * properties. + * Get the value of all properties of this {@link Foo} instance including unrecognized properties. * * @return The map of all properties */ @@ -200,14 +238,16 @@ public Object getCustomField( @Nonnull final String name ) public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); + if( foo != null ) + declaredFields.put("foo", foo); + if( disc != null ) + declaredFields.put("disc", disc); return declaredFields; } /** - * Set an unrecognizable property of this {@link ResponseFormatJsonObject} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link Foo} 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 @@ -229,15 +269,16 @@ public boolean equals( @Nullable final java.lang.Object o ) if( o == null || getClass() != o.getClass() ) { return false; } - final ResponseFormatJsonObject responseFormatJsonObject = (ResponseFormatJsonObject) o; - return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonObject.cloudSdkCustomFields) - && Objects.equals(this.type, responseFormatJsonObject.type); + final Foo foo = (Foo) o; + return Objects.equals(this.cloudSdkCustomFields, foo.cloudSdkCustomFields) + && Objects.equals(this.foo, foo.foo) + && Objects.equals(this.disc, foo.disc); } @Override public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); + return Objects.hash(foo, disc, cloudSdkCustomFields); } @Override @@ -245,8 +286,9 @@ public int hashCode() public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class ResponseFormatJsonObject {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("class Foo {\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append(" disc: ").append(toIndentedString(disc)).append("\n"); cloudSdkCustomFields .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); sb.append("}"); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java deleted file mode 100644 index 93e7c7882..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FunctionObject.java +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * FunctionObject - */ - -@Beta // CHECKSTYLE:OFF -public class FunctionObject -// CHECKSTYLE:ON -{ - @JsonProperty( "description" ) - private String description; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "parameters" ) - private Map parameters = new HashMap<>(); - - @JsonProperty( "strict" ) - private Boolean strict = false; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for FunctionObject. - */ - protected FunctionObject() - { - } - - /** - * Set the description of this {@link FunctionObject} instance and return the same instance. - * - * @param description - * A description of what the function does, used by the model to choose when and how to call the - * function. - * @return The same instance of this {@link FunctionObject} class - */ - @Nonnull - public FunctionObject description( @Nullable final String description ) - { - this.description = description; - return this; - } - - /** - * A description of what the function does, used by the model to choose when and how to call the function. - * - * @return description The description of this {@link FunctionObject} instance. - */ - @Nonnull - public String getDescription() - { - return description; - } - - /** - * Set the description of this {@link FunctionObject} instance. - * - * @param description - * A description of what the function does, used by the model to choose when and how to call the - * function. - */ - public void setDescription( @Nullable final String description ) - { - this.description = description; - } - - /** - * Set the name of this {@link FunctionObject} instance and return the same instance. - * - * @param name - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with - * a maximum length of 64. - * @return The same instance of this {@link FunctionObject} class - */ - @Nonnull - public FunctionObject name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum - * length of 64. - * - * @return name The name of this {@link FunctionObject} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link FunctionObject} instance. - * - * @param name - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with - * a maximum length of 64. - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the parameters of this {@link FunctionObject} instance and return the same instance. - * - * @param parameters - * The parameters the functions accepts, described as a JSON Schema object. See the - * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema - * reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - * Omitting `parameters` defines a function with an empty parameter list. - * @return The same instance of this {@link FunctionObject} class - */ - @Nonnull - public FunctionObject parameters( @Nullable final Map parameters ) - { - this.parameters = parameters; - return this; - } - - /** - * Put one parameters instance to this {@link FunctionObject} instance. - * - * @param key - * The String key of this parameters instance - * @param parametersItem - * The parameters that should be added under the given key - * @return The same instance of type {@link FunctionObject} - */ - @Nonnull - public FunctionObject putparametersItem( @Nonnull final String key, @Nullable final Object parametersItem ) - { - if( this.parameters == null ) { - this.parameters = new HashMap<>(); - } - this.parameters.put(key, parametersItem); - return this; - } - - /** - * The parameters the functions accepts, described as a JSON Schema object. See the - * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema - * reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting - * `parameters` defines a function with an empty parameter list. - * - * @return parameters The parameters of this {@link FunctionObject} instance. - */ - @Nonnull - public Map getParameters() - { - return parameters; - } - - /** - * Set the parameters of this {@link FunctionObject} instance. - * - * @param parameters - * The parameters the functions accepts, described as a JSON Schema object. See the - * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema - * reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - * Omitting `parameters` defines a function with an empty parameter list. - */ - public void setParameters( @Nullable final Map parameters ) - { - this.parameters = parameters; - } - - /** - * Set the strict of this {@link FunctionObject} instance and return the same instance. - * - * @param strict - * Whether to enable strict schema adherence when generating the function call. If set to true, the model - * will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema - * is supported when `strict` is `true`. Learn more about Structured Outputs in the - * [function calling guide](docs/guides/function-calling). - * @return The same instance of this {@link FunctionObject} class - */ - @Nonnull - public FunctionObject strict( @Nullable final Boolean strict ) - { - this.strict = strict; - return this; - } - - /** - * Whether to enable strict schema adherence when generating the function call. If set to true, the model will - * follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported - * when `strict` is `true`. Learn more about Structured Outputs in the [function calling - * guide](docs/guides/function-calling). - * - * @return strict The strict of this {@link FunctionObject} instance. - */ - @Nullable - public Boolean isStrict() - { - return strict; - } - - /** - * Set the strict of this {@link FunctionObject} instance. - * - * @param strict - * Whether to enable strict schema adherence when generating the function call. If set to true, the model - * will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema - * is supported when `strict` is `true`. Learn more about Structured Outputs in the - * [function calling guide](docs/guides/function-calling). - */ - public void setStrict( @Nullable final Boolean strict ) - { - this.strict = strict; - } - - /** - * Get the names of the unrecognizable properties of the {@link FunctionObject}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link FunctionObject} 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("FunctionObject has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link FunctionObject} 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( name != null ) - declaredFields.put("name", name); - if( parameters != null ) - declaredFields.put("parameters", parameters); - if( strict != null ) - declaredFields.put("strict", strict); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link FunctionObject} 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 FunctionObject functionObject = (FunctionObject) o; - return Objects.equals(this.cloudSdkCustomFields, functionObject.cloudSdkCustomFields) - && Objects.equals(this.description, functionObject.description) - && Objects.equals(this.name, functionObject.name) - && Objects.equals(this.parameters, functionObject.parameters) - && Objects.equals(this.strict, functionObject.strict); - } - - @Override - public int hashCode() - { - return Objects.hash(description, name, parameters, strict, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class FunctionObject {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); - sb.append(" strict: ").append(toIndentedString(strict)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java deleted file mode 100644 index a79b819ef..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GlobalStreamOptions.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Options for streaming. Will be ignored if enabled is false. - */ - -@Beta // CHECKSTYLE:OFF -public class GlobalStreamOptions -// CHECKSTYLE:ON -{ - @JsonProperty( "enabled" ) - private Boolean enabled = false; - - @JsonProperty( "chunk_size" ) - private Integer chunkSize = 100; - - @JsonProperty( "delimiters" ) - private List delimiters = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for GlobalStreamOptions. - */ - protected GlobalStreamOptions() - { - } - - /** - * Set the enabled of this {@link GlobalStreamOptions} instance and return the same instance. - * - * @param enabled - * If true, the response will be streamed back to the client - * @return The same instance of this {@link GlobalStreamOptions} class - */ - @Nonnull - public GlobalStreamOptions enabled( @Nullable final Boolean enabled ) - { - this.enabled = enabled; - return this; - } - - /** - * If true, the response will be streamed back to the client - * - * @return enabled The enabled of this {@link GlobalStreamOptions} instance. - */ - @Nonnull - public Boolean isEnabled() - { - return enabled; - } - - /** - * Set the enabled of this {@link GlobalStreamOptions} instance. - * - * @param enabled - * If true, the response will be streamed back to the client - */ - public void setEnabled( @Nullable final Boolean enabled ) - { - this.enabled = enabled; - } - - /** - * Set the chunkSize of this {@link GlobalStreamOptions} instance and return the same instance. - * - * @param chunkSize - * Minimum number of characters per chunk that post-LLM modules operate on. Minimum: 1 Maximum: 10000 - * @return The same instance of this {@link GlobalStreamOptions} class - */ - @Nonnull - public GlobalStreamOptions chunkSize( @Nullable final Integer chunkSize ) - { - this.chunkSize = chunkSize; - return this; - } - - /** - * Minimum number of characters per chunk that post-LLM modules operate on. minimum: 1 maximum: 10000 - * - * @return chunkSize The chunkSize of this {@link GlobalStreamOptions} instance. - */ - @Nonnull - public Integer getChunkSize() - { - return chunkSize; - } - - /** - * Set the chunkSize of this {@link GlobalStreamOptions} instance. - * - * @param chunkSize - * Minimum number of characters per chunk that post-LLM modules operate on. Minimum: 1 Maximum: 10000 - */ - public void setChunkSize( @Nullable final Integer chunkSize ) - { - this.chunkSize = chunkSize; - } - - /** - * Set the delimiters of this {@link GlobalStreamOptions} instance and return the same instance. - * - * @param delimiters - * List of delimiters to split the input text into chunks.Please note, this is a required parameter when - * `input_translation_module_config` or `output_translation_module_config` are - * configured. - * @return The same instance of this {@link GlobalStreamOptions} class - */ - @Nonnull - public GlobalStreamOptions delimiters( @Nullable final List delimiters ) - { - this.delimiters = delimiters; - return this; - } - - /** - * Add one delimiters instance to this {@link GlobalStreamOptions}. - * - * @param delimitersItem - * The delimiters that should be added - * @return The same instance of type {@link GlobalStreamOptions} - */ - @Nonnull - public GlobalStreamOptions addDelimitersItem( @Nonnull final String delimitersItem ) - { - if( this.delimiters == null ) { - this.delimiters = new ArrayList<>(); - } - this.delimiters.add(delimitersItem); - return this; - } - - /** - * List of delimiters to split the input text into chunks.Please note, this is a required parameter when - * `input_translation_module_config` or `output_translation_module_config` are configured. - * - * @return delimiters The delimiters of this {@link GlobalStreamOptions} instance. - */ - @Nonnull - public List getDelimiters() - { - return delimiters; - } - - /** - * Set the delimiters of this {@link GlobalStreamOptions} instance. - * - * @param delimiters - * List of delimiters to split the input text into chunks.Please note, this is a required parameter when - * `input_translation_module_config` or `output_translation_module_config` are - * configured. - */ - public void setDelimiters( @Nullable final List delimiters ) - { - this.delimiters = delimiters; - } - - /** - * Get the names of the unrecognizable properties of the {@link GlobalStreamOptions}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GlobalStreamOptions} 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("GlobalStreamOptions has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GlobalStreamOptions} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( enabled != null ) - declaredFields.put("enabled", enabled); - if( chunkSize != null ) - declaredFields.put("chunkSize", chunkSize); - if( delimiters != null ) - declaredFields.put("delimiters", delimiters); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GlobalStreamOptions} 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 GlobalStreamOptions globalStreamOptions = (GlobalStreamOptions) o; - return Objects.equals(this.cloudSdkCustomFields, globalStreamOptions.cloudSdkCustomFields) - && Objects.equals(this.enabled, globalStreamOptions.enabled) - && Objects.equals(this.chunkSize, globalStreamOptions.chunkSize) - && Objects.equals(this.delimiters, globalStreamOptions.delimiters); - } - - @Override - public int hashCode() - { - return Objects.hash(enabled, chunkSize, delimiters, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class GlobalStreamOptions {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" chunkSize: ").append(toIndentedString(chunkSize)).append("\n"); - sb.append(" delimiters: ").append(toIndentedString(delimiters)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java deleted file mode 100644 index 0027dac92..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingFilterSearchConfiguration.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * GroundingFilterSearchConfiguration - */ - -@Beta // CHECKSTYLE:OFF -public class GroundingFilterSearchConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty( "max_chunk_count" ) - private Integer maxChunkCount; - - @JsonProperty( "max_document_count" ) - private Integer maxDocumentCount; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for GroundingFilterSearchConfiguration. - */ - protected GroundingFilterSearchConfiguration() - { - } - - /** - * Set the maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance and return the same instance. - * - * @param maxChunkCount - * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. Minimum: 0 - * @return The same instance of this {@link GroundingFilterSearchConfiguration} class - */ - @Nonnull - public GroundingFilterSearchConfiguration maxChunkCount( @Nullable final Integer maxChunkCount ) - { - this.maxChunkCount = maxChunkCount; - return this; - } - - /** - * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. minimum: 0 - * - * @return maxChunkCount The maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance. - */ - @Nonnull - public Integer getMaxChunkCount() - { - return maxChunkCount; - } - - /** - * Set the maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance. - * - * @param maxChunkCount - * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. Minimum: 0 - */ - public void setMaxChunkCount( @Nullable final Integer maxChunkCount ) - { - this.maxChunkCount = maxChunkCount; - } - - /** - * Set the maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance and return the same - * instance. - * - * @param maxDocumentCount - * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. - * Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per - * document is returned. Minimum: 0 - * @return The same instance of this {@link GroundingFilterSearchConfiguration} class - */ - @Nonnull - public GroundingFilterSearchConfiguration maxDocumentCount( @Nullable final Integer maxDocumentCount ) - { - this.maxDocumentCount = maxDocumentCount; - return this; - } - - /** - * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used - * with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per document is returned. - * minimum: 0 - * - * @return maxDocumentCount The maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance. - */ - @Nonnull - public Integer getMaxDocumentCount() - { - return maxDocumentCount; - } - - /** - * Set the maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance. - * - * @param maxDocumentCount - * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. - * Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per - * document is returned. Minimum: 0 - */ - public void setMaxDocumentCount( @Nullable final Integer maxDocumentCount ) - { - this.maxDocumentCount = maxDocumentCount; - } - - /** - * Get the names of the unrecognizable properties of the {@link GroundingFilterSearchConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GroundingFilterSearchConfiguration} 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( - "GroundingFilterSearchConfiguration has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GroundingFilterSearchConfiguration} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( maxChunkCount != null ) - declaredFields.put("maxChunkCount", maxChunkCount); - if( maxDocumentCount != null ) - declaredFields.put("maxDocumentCount", maxDocumentCount); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GroundingFilterSearchConfiguration} 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 GroundingFilterSearchConfiguration groundingFilterSearchConfiguration = - (GroundingFilterSearchConfiguration) o; - return Objects.equals(this.cloudSdkCustomFields, groundingFilterSearchConfiguration.cloudSdkCustomFields) - && Objects.equals(this.maxChunkCount, groundingFilterSearchConfiguration.maxChunkCount) - && Objects.equals(this.maxDocumentCount, groundingFilterSearchConfiguration.maxDocumentCount); - } - - @Override - public int hashCode() - { - return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class GroundingFilterSearchConfiguration {\n"); - sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); - sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java deleted file mode 100644 index fe17aff6a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfig.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * GroundingModuleConfig - */ - -@Beta // CHECKSTYLE:OFF -public class GroundingModuleConfig -// CHECKSTYLE:ON -{ - /** - * Gets or Sets type - */ - public enum TypeEnum - { - /** - * The DOCUMENT_GROUNDING_SERVICE option of this GroundingModuleConfig - */ - DOCUMENT_GROUNDING_SERVICE("document_grounding_service"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this GroundingModuleConfig - */ - 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 GroundingModuleConfig - */ - @JsonCreator - @Nullable - public static TypeEnum fromValue( @Nonnull final String value ) - { - for( TypeEnum b : TypeEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return null; - } - } - - @JsonProperty( "type" ) - private TypeEnum type; - - @JsonProperty( "config" ) - private GroundingModuleConfigConfig config; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for GroundingModuleConfig. - */ - protected GroundingModuleConfig() - { - } - - /** - * Set the type of this {@link GroundingModuleConfig} instance and return the same instance. - * - * @param type - * The type of this {@link GroundingModuleConfig} - * @return The same instance of this {@link GroundingModuleConfig} class - */ - @Nonnull - public GroundingModuleConfig type( @Nullable final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link GroundingModuleConfig} instance. - */ - @Nullable - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link GroundingModuleConfig} instance. - * - * @param type - * The type of this {@link GroundingModuleConfig} - */ - public void setType( @Nullable final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the config of this {@link GroundingModuleConfig} instance and return the same instance. - * - * @param config - * The config of this {@link GroundingModuleConfig} - * @return The same instance of this {@link GroundingModuleConfig} class - */ - @Nonnull - public GroundingModuleConfig config( @Nonnull final GroundingModuleConfigConfig config ) - { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link GroundingModuleConfig} instance. - */ - @Nonnull - public GroundingModuleConfigConfig getConfig() - { - return config; - } - - /** - * Set the config of this {@link GroundingModuleConfig} instance. - * - * @param config - * The config of this {@link GroundingModuleConfig} - */ - public void setConfig( @Nonnull final GroundingModuleConfigConfig config ) - { - this.config = config; - } - - /** - * Get the names of the unrecognizable properties of the {@link GroundingModuleConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GroundingModuleConfig} 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("GroundingModuleConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GroundingModuleConfig} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( config != null ) - declaredFields.put("config", config); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GroundingModuleConfig} 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 GroundingModuleConfig groundingModuleConfig = (GroundingModuleConfig) o; - return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfig.cloudSdkCustomFields) - && Objects.equals(this.type, groundingModuleConfig.type) - && Objects.equals(this.config, groundingModuleConfig.config); - } - - @Override - public int hashCode() - { - return Objects.hash(type, config, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class GroundingModuleConfig {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java deleted file mode 100644 index d51035d24..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfig.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * GroundingModuleConfigConfig - */ - -@Beta // CHECKSTYLE:OFF -public class GroundingModuleConfigConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "filters" ) - private List filters = new ArrayList<>(); - - @JsonProperty( "placeholders" ) - private GroundingModuleConfigConfigPlaceholders placeholders; - - @JsonProperty( "metadata_params" ) - private List metadataParams = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for GroundingModuleConfigConfig. - */ - protected GroundingModuleConfigConfig() - { - } - - /** - * Set the filters of this {@link GroundingModuleConfigConfig} instance and return the same instance. - * - * @param filters - * Document grounding service filters to be used - * @return The same instance of this {@link GroundingModuleConfigConfig} class - */ - @Nonnull - public GroundingModuleConfigConfig filters( @Nullable final List filters ) - { - this.filters = filters; - return this; - } - - /** - * Add one filters instance to this {@link GroundingModuleConfigConfig}. - * - * @param filtersItem - * The filters that should be added - * @return The same instance of type {@link GroundingModuleConfigConfig} - */ - @Nonnull - public GroundingModuleConfigConfig addFiltersItem( - @Nonnull final GroundingModuleConfigConfigFiltersInner filtersItem ) - { - if( this.filters == null ) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - - /** - * Document grounding service filters to be used - * - * @return filters The filters of this {@link GroundingModuleConfigConfig} instance. - */ - @Nonnull - public List getFilters() - { - return filters; - } - - /** - * Set the filters of this {@link GroundingModuleConfigConfig} instance. - * - * @param filters - * Document grounding service filters to be used - */ - public void setFilters( @Nullable final List filters ) - { - this.filters = filters; - } - - /** - * Set the placeholders of this {@link GroundingModuleConfigConfig} instance and return the same instance. - * - * @param placeholders - * The placeholders of this {@link GroundingModuleConfigConfig} - * @return The same instance of this {@link GroundingModuleConfigConfig} class - */ - @Nonnull - public GroundingModuleConfigConfig placeholders( - @Nonnull final GroundingModuleConfigConfigPlaceholders placeholders ) - { - this.placeholders = placeholders; - return this; - } - - /** - * Get placeholders - * - * @return placeholders The placeholders of this {@link GroundingModuleConfigConfig} instance. - */ - @Nonnull - public GroundingModuleConfigConfigPlaceholders getPlaceholders() - { - return placeholders; - } - - /** - * Set the placeholders of this {@link GroundingModuleConfigConfig} instance. - * - * @param placeholders - * The placeholders of this {@link GroundingModuleConfigConfig} - */ - public void setPlaceholders( @Nonnull final GroundingModuleConfigConfigPlaceholders placeholders ) - { - this.placeholders = placeholders; - } - - /** - * Set the metadataParams of this {@link GroundingModuleConfigConfig} instance and return the same instance. - * - * @param metadataParams - * Parameter name used for specifying metadata parameters - * @return The same instance of this {@link GroundingModuleConfigConfig} class - */ - @Nonnull - public GroundingModuleConfigConfig metadataParams( @Nullable final List metadataParams ) - { - this.metadataParams = metadataParams; - return this; - } - - /** - * Add one metadataParams instance to this {@link GroundingModuleConfigConfig}. - * - * @param metadataParamsItem - * The metadataParams that should be added - * @return The same instance of type {@link GroundingModuleConfigConfig} - */ - @Nonnull - public GroundingModuleConfigConfig addMetadataParamsItem( @Nonnull final String metadataParamsItem ) - { - if( this.metadataParams == null ) { - this.metadataParams = new ArrayList<>(); - } - this.metadataParams.add(metadataParamsItem); - return this; - } - - /** - * Parameter name used for specifying metadata parameters - * - * @return metadataParams The metadataParams of this {@link GroundingModuleConfigConfig} instance. - */ - @Nonnull - public List getMetadataParams() - { - return metadataParams; - } - - /** - * Set the metadataParams of this {@link GroundingModuleConfigConfig} instance. - * - * @param metadataParams - * Parameter name used for specifying metadata parameters - */ - public void setMetadataParams( @Nullable final List metadataParams ) - { - this.metadataParams = metadataParams; - } - - /** - * Get the names of the unrecognizable properties of the {@link GroundingModuleConfigConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GroundingModuleConfigConfig} 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("GroundingModuleConfigConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GroundingModuleConfigConfig} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( filters != null ) - declaredFields.put("filters", filters); - if( placeholders != null ) - declaredFields.put("placeholders", placeholders); - if( metadataParams != null ) - declaredFields.put("metadataParams", metadataParams); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GroundingModuleConfigConfig} 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 GroundingModuleConfigConfig groundingModuleConfigConfig = (GroundingModuleConfigConfig) o; - return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfigConfig.cloudSdkCustomFields) - && Objects.equals(this.filters, groundingModuleConfigConfig.filters) - && Objects.equals(this.placeholders, groundingModuleConfigConfig.placeholders) - && Objects.equals(this.metadataParams, groundingModuleConfigConfig.metadataParams); - } - - @Override - public int hashCode() - { - return Objects.hash(filters, placeholders, metadataParams, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class GroundingModuleConfigConfig {\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" placeholders: ").append(toIndentedString(placeholders)).append("\n"); - sb.append(" metadataParams: ").append(toIndentedString(metadataParams)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java deleted file mode 100644 index 7108206c9..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigFiltersInner.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * GroundingModuleConfigConfigFiltersInner - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { @JsonSubTypes.Type( value = DocumentGroundingFilter.class ), } ) - -public interface GroundingModuleConfigConfigFiltersInner -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java deleted file mode 100644 index 19d4b31fc..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/GroundingModuleConfigConfigPlaceholders.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Placeholders to be used for grounding input questions and output - */ - -@Beta // CHECKSTYLE:OFF -public class GroundingModuleConfigConfigPlaceholders -// CHECKSTYLE:ON -{ - @JsonProperty( "input" ) - private List input = new ArrayList<>(); - - @JsonProperty( "output" ) - private String output; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for GroundingModuleConfigConfigPlaceholders. - */ - protected GroundingModuleConfigConfigPlaceholders() - { - } - - /** - * Set the input of this {@link GroundingModuleConfigConfigPlaceholders} instance and return the same instance. - * - * @param input - * Contains the input parameters used for grounding input questions - * @return The same instance of this {@link GroundingModuleConfigConfigPlaceholders} class - */ - @Nonnull - public GroundingModuleConfigConfigPlaceholders input( @Nonnull final List input ) - { - this.input = input; - return this; - } - - /** - * Add one input instance to this {@link GroundingModuleConfigConfigPlaceholders}. - * - * @param inputItem - * The input that should be added - * @return The same instance of type {@link GroundingModuleConfigConfigPlaceholders} - */ - @Nonnull - public GroundingModuleConfigConfigPlaceholders addInputItem( @Nonnull final String inputItem ) - { - if( this.input == null ) { - this.input = new ArrayList<>(); - } - this.input.add(inputItem); - return this; - } - - /** - * Contains the input parameters used for grounding input questions - * - * @return input The input of this {@link GroundingModuleConfigConfigPlaceholders} instance. - */ - @Nonnull - public List getInput() - { - return input; - } - - /** - * Set the input of this {@link GroundingModuleConfigConfigPlaceholders} instance. - * - * @param input - * Contains the input parameters used for grounding input questions - */ - public void setInput( @Nonnull final List input ) - { - this.input = input; - } - - /** - * Set the output of this {@link GroundingModuleConfigConfigPlaceholders} instance and return the same instance. - * - * @param output - * Placeholder name for grounding output - * @return The same instance of this {@link GroundingModuleConfigConfigPlaceholders} class - */ - @Nonnull - public GroundingModuleConfigConfigPlaceholders output( @Nonnull final String output ) - { - this.output = output; - return this; - } - - /** - * Placeholder name for grounding output - * - * @return output The output of this {@link GroundingModuleConfigConfigPlaceholders} instance. - */ - @Nonnull - public String getOutput() - { - return output; - } - - /** - * Set the output of this {@link GroundingModuleConfigConfigPlaceholders} instance. - * - * @param output - * Placeholder name for grounding output - */ - public void setOutput( @Nonnull final String output ) - { - this.output = output; - } - - /** - * Get the names of the unrecognizable properties of the {@link GroundingModuleConfigConfigPlaceholders}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GroundingModuleConfigConfigPlaceholders} 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( - "GroundingModuleConfigConfigPlaceholders has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GroundingModuleConfigConfigPlaceholders} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( input != null ) - declaredFields.put("input", input); - if( output != null ) - declaredFields.put("output", output); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GroundingModuleConfigConfigPlaceholders} 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 GroundingModuleConfigConfigPlaceholders groundingModuleConfigConfigPlaceholders = - (GroundingModuleConfigConfigPlaceholders) o; - return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfigConfigPlaceholders.cloudSdkCustomFields) - && Objects.equals(this.input, groundingModuleConfigConfigPlaceholders.input) - && Objects.equals(this.output, groundingModuleConfigConfigPlaceholders.output); - } - - @Override - public int hashCode() - { - return Objects.hash(input, output, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class GroundingModuleConfigConfigPlaceholders {\n"); - sb.append(" input: ").append(toIndentedString(input)).append("\n"); - sb.append(" output: ").append(toIndentedString(output)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java deleted file mode 100644 index a36f2d705..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContent.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * ImageContent - */ - -@Beta // CHECKSTYLE:OFF -public class ImageContent implements MultiChatContent -// CHECKSTYLE:ON -{ - /** - * Gets or Sets type - */ - public enum TypeEnum - { - /** - * The IMAGE_URL option of this ImageContent - */ - IMAGE_URL("image_url"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this ImageContent - */ - 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 ImageContent - */ - @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( "image_url" ) - private ImageContentImageUrl imageUrl; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ImageContent. - */ - protected ImageContent() - { - } - - /** - * Set the type of this {@link ImageContent} instance and return the same instance. - * - * @param type - * The type of this {@link ImageContent} - * @return The same instance of this {@link ImageContent} class - */ - @Nonnull - public ImageContent type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link ImageContent} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link ImageContent} instance. - * - * @param type - * The type of this {@link ImageContent} - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the imageUrl of this {@link ImageContent} instance and return the same instance. - * - * @param imageUrl - * The imageUrl of this {@link ImageContent} - * @return The same instance of this {@link ImageContent} class - */ - @Nonnull - public ImageContent imageUrl( @Nonnull final ImageContentImageUrl imageUrl ) - { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get imageUrl - * - * @return imageUrl The imageUrl of this {@link ImageContent} instance. - */ - @Nonnull - public ImageContentImageUrl getImageUrl() - { - return imageUrl; - } - - /** - * Set the imageUrl of this {@link ImageContent} instance. - * - * @param imageUrl - * The imageUrl of this {@link ImageContent} - */ - public void setImageUrl( @Nonnull final ImageContentImageUrl imageUrl ) - { - this.imageUrl = imageUrl; - } - - /** - * Get the names of the unrecognizable properties of the {@link ImageContent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ImageContent} 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("ImageContent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ImageContent} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( imageUrl != null ) - declaredFields.put("imageUrl", imageUrl); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ImageContent} 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 ImageContent imageContent = (ImageContent) o; - return Objects.equals(this.cloudSdkCustomFields, imageContent.cloudSdkCustomFields) - && Objects.equals(this.type, imageContent.type) - && Objects.equals(this.imageUrl, imageContent.imageUrl); - } - - @Override - public int hashCode() - { - return Objects.hash(type, imageUrl, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ImageContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java deleted file mode 100644 index dcfd9bc5f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ImageContentImageUrl.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * ImageContentImageUrl - */ - -@Beta // CHECKSTYLE:OFF -public class ImageContentImageUrl -// CHECKSTYLE:ON -{ - @JsonProperty( "url" ) - private String url; - - @JsonProperty( "detail" ) - private String detail = "auto"; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ImageContentImageUrl. - */ - protected ImageContentImageUrl() - { - } - - /** - * Set the url of this {@link ImageContentImageUrl} instance and return the same instance. - * - * @param url - * The url of this {@link ImageContentImageUrl} - * @return The same instance of this {@link ImageContentImageUrl} class - */ - @Nonnull - public ImageContentImageUrl url( @Nonnull final String url ) - { - this.url = url; - return this; - } - - /** - * Get url - * - * @return url The url of this {@link ImageContentImageUrl} instance. - */ - @Nonnull - public String getUrl() - { - return url; - } - - /** - * Set the url of this {@link ImageContentImageUrl} instance. - * - * @param url - * The url of this {@link ImageContentImageUrl} - */ - public void setUrl( @Nonnull final String url ) - { - this.url = url; - } - - /** - * Set the detail of this {@link ImageContentImageUrl} instance and return the same instance. - * - * @param detail - * The detail of this {@link ImageContentImageUrl} - * @return The same instance of this {@link ImageContentImageUrl} class - */ - @Nonnull - public ImageContentImageUrl detail( @Nullable final String detail ) - { - this.detail = detail; - return this; - } - - /** - * Get detail - * - * @return detail The detail of this {@link ImageContentImageUrl} instance. - */ - @Nonnull - public String getDetail() - { - return detail; - } - - /** - * Set the detail of this {@link ImageContentImageUrl} instance. - * - * @param detail - * The detail of this {@link ImageContentImageUrl} - */ - public void setDetail( @Nullable final String detail ) - { - this.detail = detail; - } - - /** - * Get the names of the unrecognizable properties of the {@link ImageContentImageUrl}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ImageContentImageUrl} 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("ImageContentImageUrl has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ImageContentImageUrl} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( url != null ) - declaredFields.put("url", url); - if( detail != null ) - declaredFields.put("detail", detail); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ImageContentImageUrl} 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 ImageContentImageUrl imageContentImageUrl = (ImageContentImageUrl) o; - return Objects.equals(this.cloudSdkCustomFields, imageContentImageUrl.cloudSdkCustomFields) - && Objects.equals(this.url, imageContentImageUrl.url) - && Objects.equals(this.detail, imageContentImageUrl.detail); - } - - @Override - public int hashCode() - { - return Objects.hash(url, detail, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ImageContentImageUrl {\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java deleted file mode 100644 index 66a973504..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilteringConfig.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * InputFilteringConfig - */ - -@Beta // CHECKSTYLE:OFF -public class InputFilteringConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "filters" ) - private List filters = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for InputFilteringConfig. - */ - protected InputFilteringConfig() - { - } - - /** - * Set the filters of this {@link InputFilteringConfig} instance and return the same instance. - * - * @param filters - * Configuration for content filtering services that should be used for the given filtering step (input - * filtering). - * @return The same instance of this {@link InputFilteringConfig} class - */ - @Nonnull - public InputFilteringConfig filters( @Nonnull final List filters ) - { - this.filters = filters; - return this; - } - - /** - * Add one filters instance to this {@link InputFilteringConfig}. - * - * @param filtersItem - * The filters that should be added - * @return The same instance of type {@link InputFilteringConfig} - */ - @Nonnull - public InputFilteringConfig addFiltersItem( @Nonnull final InputFilterConfig filtersItem ) - { - if( this.filters == null ) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - - /** - * Configuration for content filtering services that should be used for the given filtering step (input filtering). - * - * @return filters The filters of this {@link InputFilteringConfig} instance. - */ - @Nonnull - public List getFilters() - { - return filters; - } - - /** - * Set the filters of this {@link InputFilteringConfig} instance. - * - * @param filters - * Configuration for content filtering services that should be used for the given filtering step (input - * filtering). - */ - public void setFilters( @Nonnull final List filters ) - { - this.filters = filters; - } - - /** - * Get the names of the unrecognizable properties of the {@link InputFilteringConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link InputFilteringConfig} 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("InputFilteringConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link InputFilteringConfig} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( filters != null ) - declaredFields.put("filters", filters); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link InputFilteringConfig} 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 InputFilteringConfig inputFilteringConfig = (InputFilteringConfig) o; - return Objects.equals(this.cloudSdkCustomFields, inputFilteringConfig.cloudSdkCustomFields) - && Objects.equals(this.filters, inputFilteringConfig.filters); - } - - @Override - public int hashCode() - { - return Objects.hash(filters, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class InputFilteringConfig {\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java deleted file mode 100644 index c5ce5e330..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LLMModelDetails.java +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * The model and parameters to be used for the prompt templating. This is the model that will be used to generate the - * response. - */ - -@Beta // CHECKSTYLE:OFF -public class LLMModelDetails -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version = "latest"; - - @JsonProperty( "params" ) - private Map params = new HashMap<>(); - - @JsonProperty( "timeout" ) - private Integer timeout = 600; - - @JsonProperty( "max_retries" ) - private Integer maxRetries = 2; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for LLMModelDetails. - */ - protected LLMModelDetails() - { - } - - /** - * Set the name of this {@link LLMModelDetails} instance and return the same instance. - * - * @param name - * Name of the model as in LLM Access configuration - * @return The same instance of this {@link LLMModelDetails} class - */ - @Nonnull - public LLMModelDetails name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Name of the model as in LLM Access configuration - * - * @return name The name of this {@link LLMModelDetails} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link LLMModelDetails} instance. - * - * @param name - * Name of the model as in LLM Access configuration - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link LLMModelDetails} instance and return the same instance. - * - * @param version - * Version of the model to be used - * @return The same instance of this {@link LLMModelDetails} class - */ - @Nonnull - public LLMModelDetails version( @Nullable final String version ) - { - this.version = version; - return this; - } - - /** - * Version of the model to be used - * - * @return version The version of this {@link LLMModelDetails} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link LLMModelDetails} instance. - * - * @param version - * Version of the model to be used - */ - public void setVersion( @Nullable final String version ) - { - this.version = version; - } - - /** - * Set the params of this {@link LLMModelDetails} instance and return the same instance. - * - * @param params - * Additional parameters for the model. Default values are used for mandatory parameters. - * @return The same instance of this {@link LLMModelDetails} class - */ - @Nonnull - public LLMModelDetails params( @Nullable final Map params ) - { - this.params = params; - return this; - } - - /** - * Put one params instance to this {@link LLMModelDetails} instance. - * - * @param key - * The String key of this params instance - * @param paramsItem - * The params that should be added under the given key - * @return The same instance of type {@link LLMModelDetails} - */ - @Nonnull - public LLMModelDetails putparamsItem( @Nonnull final String key, @Nullable final Object paramsItem ) - { - if( this.params == null ) { - this.params = new HashMap<>(); - } - this.params.put(key, paramsItem); - return this; - } - - /** - * Additional parameters for the model. Default values are used for mandatory parameters. - * - * @return params The params of this {@link LLMModelDetails} instance. - */ - @Nonnull - public Map getParams() - { - return params; - } - - /** - * Set the params of this {@link LLMModelDetails} instance. - * - * @param params - * Additional parameters for the model. Default values are used for mandatory parameters. - */ - public void setParams( @Nullable final Map params ) - { - this.params = params; - } - - /** - * Set the timeout of this {@link LLMModelDetails} instance and return the same instance. - * - * @param timeout - * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. - * Minimum: 1 Maximum: 600 - * @return The same instance of this {@link LLMModelDetails} class - */ - @Nonnull - public LLMModelDetails timeout( @Nullable final Integer timeout ) - { - this.timeout = timeout; - return this; - } - - /** - * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. minimum: 1 - * maximum: 600 - * - * @return timeout The timeout of this {@link LLMModelDetails} instance. - */ - @Nonnull - public Integer getTimeout() - { - return timeout; - } - - /** - * Set the timeout of this {@link LLMModelDetails} instance. - * - * @param timeout - * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. - * Minimum: 1 Maximum: 600 - */ - public void setTimeout( @Nullable final Integer timeout ) - { - this.timeout = timeout; - } - - /** - * Set the maxRetries of this {@link LLMModelDetails} instance and return the same instance. - * - * @param maxRetries - * Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI - * models. Minimum: 0 Maximum: 5 - * @return The same instance of this {@link LLMModelDetails} class - */ - @Nonnull - public LLMModelDetails maxRetries( @Nullable final Integer maxRetries ) - { - this.maxRetries = maxRetries; - return this; - } - - /** - * Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI models. minimum: - * 0 maximum: 5 - * - * @return maxRetries The maxRetries of this {@link LLMModelDetails} instance. - */ - @Nonnull - public Integer getMaxRetries() - { - return maxRetries; - } - - /** - * Set the maxRetries of this {@link LLMModelDetails} instance. - * - * @param maxRetries - * Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI - * models. Minimum: 0 Maximum: 5 - */ - public void setMaxRetries( @Nullable final Integer maxRetries ) - { - this.maxRetries = maxRetries; - } - - /** - * Get the names of the unrecognizable properties of the {@link LLMModelDetails}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link LLMModelDetails} 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("LLMModelDetails has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link LLMModelDetails} 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( version != null ) - declaredFields.put("version", version); - if( params != null ) - declaredFields.put("params", params); - if( timeout != null ) - declaredFields.put("timeout", timeout); - if( maxRetries != null ) - declaredFields.put("maxRetries", maxRetries); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link LLMModelDetails} 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 LLMModelDetails llMModelDetails = (LLMModelDetails) o; - return Objects.equals(this.cloudSdkCustomFields, llMModelDetails.cloudSdkCustomFields) - && Objects.equals(this.name, llMModelDetails.name) - && Objects.equals(this.version, llMModelDetails.version) - && Objects.equals(this.params, llMModelDetails.params) - && Objects.equals(this.timeout, llMModelDetails.timeout) - && Objects.equals(this.maxRetries, llMModelDetails.maxRetries); - } - - @Override - public int hashCode() - { - return Objects.hash(name, version, params, timeout, maxRetries, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class LLMModelDetails {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); - sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java deleted file mode 100644 index 8d2a41130..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38b.java +++ /dev/null @@ -1,773 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Filter configuration for Llama Guard 3 8B - */ - -@Beta // CHECKSTYLE:OFF -public class LlamaGuard38b -// CHECKSTYLE:ON -{ - @JsonProperty( "violent_crimes" ) - private Boolean violentCrimes; - - @JsonProperty( "non_violent_crimes" ) - private Boolean nonViolentCrimes; - - @JsonProperty( "sex_crimes" ) - private Boolean sexCrimes; - - @JsonProperty( "child_exploitation" ) - private Boolean childExploitation; - - @JsonProperty( "defamation" ) - private Boolean defamation; - - @JsonProperty( "specialized_advice" ) - private Boolean specializedAdvice; - - @JsonProperty( "privacy" ) - private Boolean privacy; - - @JsonProperty( "intellectual_property" ) - private Boolean intellectualProperty; - - @JsonProperty( "indiscriminate_weapons" ) - private Boolean indiscriminateWeapons; - - @JsonProperty( "hate" ) - private Boolean hate; - - @JsonProperty( "self_harm" ) - private Boolean selfHarm; - - @JsonProperty( "sexual_content" ) - private Boolean sexualContent; - - @JsonProperty( "elections" ) - private Boolean elections; - - @JsonProperty( "code_interpreter_abuse" ) - private Boolean codeInterpreterAbuse; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for LlamaGuard38b. - */ - protected LlamaGuard38b() - { - } - - /** - * Set the violentCrimes of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param violentCrimes - * The violentCrimes of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b violentCrimes( @Nullable final Boolean violentCrimes ) - { - this.violentCrimes = violentCrimes; - return this; - } - - /** - * Get violentCrimes - * - * @return violentCrimes The violentCrimes of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isViolentCrimes() - { - return violentCrimes; - } - - /** - * Set the violentCrimes of this {@link LlamaGuard38b} instance. - * - * @param violentCrimes - * The violentCrimes of this {@link LlamaGuard38b} - */ - public void setViolentCrimes( @Nullable final Boolean violentCrimes ) - { - this.violentCrimes = violentCrimes; - } - - /** - * Set the nonViolentCrimes of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param nonViolentCrimes - * The nonViolentCrimes of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b nonViolentCrimes( @Nullable final Boolean nonViolentCrimes ) - { - this.nonViolentCrimes = nonViolentCrimes; - return this; - } - - /** - * Get nonViolentCrimes - * - * @return nonViolentCrimes The nonViolentCrimes of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isNonViolentCrimes() - { - return nonViolentCrimes; - } - - /** - * Set the nonViolentCrimes of this {@link LlamaGuard38b} instance. - * - * @param nonViolentCrimes - * The nonViolentCrimes of this {@link LlamaGuard38b} - */ - public void setNonViolentCrimes( @Nullable final Boolean nonViolentCrimes ) - { - this.nonViolentCrimes = nonViolentCrimes; - } - - /** - * Set the sexCrimes of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param sexCrimes - * The sexCrimes of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b sexCrimes( @Nullable final Boolean sexCrimes ) - { - this.sexCrimes = sexCrimes; - return this; - } - - /** - * Get sexCrimes - * - * @return sexCrimes The sexCrimes of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isSexCrimes() - { - return sexCrimes; - } - - /** - * Set the sexCrimes of this {@link LlamaGuard38b} instance. - * - * @param sexCrimes - * The sexCrimes of this {@link LlamaGuard38b} - */ - public void setSexCrimes( @Nullable final Boolean sexCrimes ) - { - this.sexCrimes = sexCrimes; - } - - /** - * Set the childExploitation of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param childExploitation - * The childExploitation of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b childExploitation( @Nullable final Boolean childExploitation ) - { - this.childExploitation = childExploitation; - return this; - } - - /** - * Get childExploitation - * - * @return childExploitation The childExploitation of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isChildExploitation() - { - return childExploitation; - } - - /** - * Set the childExploitation of this {@link LlamaGuard38b} instance. - * - * @param childExploitation - * The childExploitation of this {@link LlamaGuard38b} - */ - public void setChildExploitation( @Nullable final Boolean childExploitation ) - { - this.childExploitation = childExploitation; - } - - /** - * Set the defamation of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param defamation - * The defamation of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b defamation( @Nullable final Boolean defamation ) - { - this.defamation = defamation; - return this; - } - - /** - * Get defamation - * - * @return defamation The defamation of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isDefamation() - { - return defamation; - } - - /** - * Set the defamation of this {@link LlamaGuard38b} instance. - * - * @param defamation - * The defamation of this {@link LlamaGuard38b} - */ - public void setDefamation( @Nullable final Boolean defamation ) - { - this.defamation = defamation; - } - - /** - * Set the specializedAdvice of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param specializedAdvice - * The specializedAdvice of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b specializedAdvice( @Nullable final Boolean specializedAdvice ) - { - this.specializedAdvice = specializedAdvice; - return this; - } - - /** - * Get specializedAdvice - * - * @return specializedAdvice The specializedAdvice of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isSpecializedAdvice() - { - return specializedAdvice; - } - - /** - * Set the specializedAdvice of this {@link LlamaGuard38b} instance. - * - * @param specializedAdvice - * The specializedAdvice of this {@link LlamaGuard38b} - */ - public void setSpecializedAdvice( @Nullable final Boolean specializedAdvice ) - { - this.specializedAdvice = specializedAdvice; - } - - /** - * Set the privacy of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param privacy - * The privacy of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b privacy( @Nullable final Boolean privacy ) - { - this.privacy = privacy; - return this; - } - - /** - * Get privacy - * - * @return privacy The privacy of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isPrivacy() - { - return privacy; - } - - /** - * Set the privacy of this {@link LlamaGuard38b} instance. - * - * @param privacy - * The privacy of this {@link LlamaGuard38b} - */ - public void setPrivacy( @Nullable final Boolean privacy ) - { - this.privacy = privacy; - } - - /** - * Set the intellectualProperty of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param intellectualProperty - * The intellectualProperty of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b intellectualProperty( @Nullable final Boolean intellectualProperty ) - { - this.intellectualProperty = intellectualProperty; - return this; - } - - /** - * Get intellectualProperty - * - * @return intellectualProperty The intellectualProperty of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isIntellectualProperty() - { - return intellectualProperty; - } - - /** - * Set the intellectualProperty of this {@link LlamaGuard38b} instance. - * - * @param intellectualProperty - * The intellectualProperty of this {@link LlamaGuard38b} - */ - public void setIntellectualProperty( @Nullable final Boolean intellectualProperty ) - { - this.intellectualProperty = intellectualProperty; - } - - /** - * Set the indiscriminateWeapons of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param indiscriminateWeapons - * The indiscriminateWeapons of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b indiscriminateWeapons( @Nullable final Boolean indiscriminateWeapons ) - { - this.indiscriminateWeapons = indiscriminateWeapons; - return this; - } - - /** - * Get indiscriminateWeapons - * - * @return indiscriminateWeapons The indiscriminateWeapons of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isIndiscriminateWeapons() - { - return indiscriminateWeapons; - } - - /** - * Set the indiscriminateWeapons of this {@link LlamaGuard38b} instance. - * - * @param indiscriminateWeapons - * The indiscriminateWeapons of this {@link LlamaGuard38b} - */ - public void setIndiscriminateWeapons( @Nullable final Boolean indiscriminateWeapons ) - { - this.indiscriminateWeapons = indiscriminateWeapons; - } - - /** - * Set the hate of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param hate - * The hate of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b hate( @Nullable final Boolean hate ) - { - this.hate = hate; - return this; - } - - /** - * Get hate - * - * @return hate The hate of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isHate() - { - return hate; - } - - /** - * Set the hate of this {@link LlamaGuard38b} instance. - * - * @param hate - * The hate of this {@link LlamaGuard38b} - */ - public void setHate( @Nullable final Boolean hate ) - { - this.hate = hate; - } - - /** - * Set the selfHarm of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param selfHarm - * The selfHarm of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b selfHarm( @Nullable final Boolean selfHarm ) - { - this.selfHarm = selfHarm; - return this; - } - - /** - * Get selfHarm - * - * @return selfHarm The selfHarm of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isSelfHarm() - { - return selfHarm; - } - - /** - * Set the selfHarm of this {@link LlamaGuard38b} instance. - * - * @param selfHarm - * The selfHarm of this {@link LlamaGuard38b} - */ - public void setSelfHarm( @Nullable final Boolean selfHarm ) - { - this.selfHarm = selfHarm; - } - - /** - * Set the sexualContent of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param sexualContent - * The sexualContent of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b sexualContent( @Nullable final Boolean sexualContent ) - { - this.sexualContent = sexualContent; - return this; - } - - /** - * Get sexualContent - * - * @return sexualContent The sexualContent of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isSexualContent() - { - return sexualContent; - } - - /** - * Set the sexualContent of this {@link LlamaGuard38b} instance. - * - * @param sexualContent - * The sexualContent of this {@link LlamaGuard38b} - */ - public void setSexualContent( @Nullable final Boolean sexualContent ) - { - this.sexualContent = sexualContent; - } - - /** - * Set the elections of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param elections - * The elections of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b elections( @Nullable final Boolean elections ) - { - this.elections = elections; - return this; - } - - /** - * Get elections - * - * @return elections The elections of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isElections() - { - return elections; - } - - /** - * Set the elections of this {@link LlamaGuard38b} instance. - * - * @param elections - * The elections of this {@link LlamaGuard38b} - */ - public void setElections( @Nullable final Boolean elections ) - { - this.elections = elections; - } - - /** - * Set the codeInterpreterAbuse of this {@link LlamaGuard38b} instance and return the same instance. - * - * @param codeInterpreterAbuse - * The codeInterpreterAbuse of this {@link LlamaGuard38b} - * @return The same instance of this {@link LlamaGuard38b} class - */ - @Nonnull - public LlamaGuard38b codeInterpreterAbuse( @Nullable final Boolean codeInterpreterAbuse ) - { - this.codeInterpreterAbuse = codeInterpreterAbuse; - return this; - } - - /** - * Get codeInterpreterAbuse - * - * @return codeInterpreterAbuse The codeInterpreterAbuse of this {@link LlamaGuard38b} instance. - */ - @Nonnull - public Boolean isCodeInterpreterAbuse() - { - return codeInterpreterAbuse; - } - - /** - * Set the codeInterpreterAbuse of this {@link LlamaGuard38b} instance. - * - * @param codeInterpreterAbuse - * The codeInterpreterAbuse of this {@link LlamaGuard38b} - */ - public void setCodeInterpreterAbuse( @Nullable final Boolean codeInterpreterAbuse ) - { - this.codeInterpreterAbuse = codeInterpreterAbuse; - } - - /** - * Get the names of the unrecognizable properties of the {@link LlamaGuard38b}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link LlamaGuard38b} 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("LlamaGuard38b has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link LlamaGuard38b} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( violentCrimes != null ) - declaredFields.put("violentCrimes", violentCrimes); - if( nonViolentCrimes != null ) - declaredFields.put("nonViolentCrimes", nonViolentCrimes); - if( sexCrimes != null ) - declaredFields.put("sexCrimes", sexCrimes); - if( childExploitation != null ) - declaredFields.put("childExploitation", childExploitation); - if( defamation != null ) - declaredFields.put("defamation", defamation); - if( specializedAdvice != null ) - declaredFields.put("specializedAdvice", specializedAdvice); - if( privacy != null ) - declaredFields.put("privacy", privacy); - if( intellectualProperty != null ) - declaredFields.put("intellectualProperty", intellectualProperty); - if( indiscriminateWeapons != null ) - declaredFields.put("indiscriminateWeapons", indiscriminateWeapons); - if( hate != null ) - declaredFields.put("hate", hate); - if( selfHarm != null ) - declaredFields.put("selfHarm", selfHarm); - if( sexualContent != null ) - declaredFields.put("sexualContent", sexualContent); - if( elections != null ) - declaredFields.put("elections", elections); - if( codeInterpreterAbuse != null ) - declaredFields.put("codeInterpreterAbuse", codeInterpreterAbuse); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link LlamaGuard38b} 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 LlamaGuard38b llamaGuard38b = (LlamaGuard38b) o; - return Objects.equals(this.cloudSdkCustomFields, llamaGuard38b.cloudSdkCustomFields) - && Objects.equals(this.violentCrimes, llamaGuard38b.violentCrimes) - && Objects.equals(this.nonViolentCrimes, llamaGuard38b.nonViolentCrimes) - && Objects.equals(this.sexCrimes, llamaGuard38b.sexCrimes) - && Objects.equals(this.childExploitation, llamaGuard38b.childExploitation) - && Objects.equals(this.defamation, llamaGuard38b.defamation) - && Objects.equals(this.specializedAdvice, llamaGuard38b.specializedAdvice) - && Objects.equals(this.privacy, llamaGuard38b.privacy) - && Objects.equals(this.intellectualProperty, llamaGuard38b.intellectualProperty) - && Objects.equals(this.indiscriminateWeapons, llamaGuard38b.indiscriminateWeapons) - && Objects.equals(this.hate, llamaGuard38b.hate) - && Objects.equals(this.selfHarm, llamaGuard38b.selfHarm) - && Objects.equals(this.sexualContent, llamaGuard38b.sexualContent) - && Objects.equals(this.elections, llamaGuard38b.elections) - && Objects.equals(this.codeInterpreterAbuse, llamaGuard38b.codeInterpreterAbuse); - } - - @Override - public int hashCode() - { - return Objects - .hash( - violentCrimes, - nonViolentCrimes, - sexCrimes, - childExploitation, - defamation, - specializedAdvice, - privacy, - intellectualProperty, - indiscriminateWeapons, - hate, - selfHarm, - sexualContent, - elections, - codeInterpreterAbuse, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class LlamaGuard38b {\n"); - sb.append(" violentCrimes: ").append(toIndentedString(violentCrimes)).append("\n"); - sb.append(" nonViolentCrimes: ").append(toIndentedString(nonViolentCrimes)).append("\n"); - sb.append(" sexCrimes: ").append(toIndentedString(sexCrimes)).append("\n"); - sb.append(" childExploitation: ").append(toIndentedString(childExploitation)).append("\n"); - sb.append(" defamation: ").append(toIndentedString(defamation)).append("\n"); - sb.append(" specializedAdvice: ").append(toIndentedString(specializedAdvice)).append("\n"); - sb.append(" privacy: ").append(toIndentedString(privacy)).append("\n"); - sb.append(" intellectualProperty: ").append(toIndentedString(intellectualProperty)).append("\n"); - sb.append(" indiscriminateWeapons: ").append(toIndentedString(indiscriminateWeapons)).append("\n"); - sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); - sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); - sb.append(" sexualContent: ").append(toIndentedString(sexualContent)).append("\n"); - sb.append(" elections: ").append(toIndentedString(elections)).append("\n"); - sb.append(" codeInterpreterAbuse: ").append(toIndentedString(codeInterpreterAbuse)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java deleted file mode 100644 index dcd3b3c94..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/LlamaGuard38bFilterConfig.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * LlamaGuard38bFilterConfig - */ - -@Beta // CHECKSTYLE:OFF -public class LlamaGuard38bFilterConfig implements InputFilterConfig, OutputFilterConfig -// CHECKSTYLE:ON -{ - /** - * Name of the filter provider type - */ - public enum TypeEnum - { - /** - * The LLAMA_GUARD_3_8B option of this LlamaGuard38bFilterConfig - */ - LLAMA_GUARD_3_8B("llama_guard_3_8b"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this LlamaGuard38bFilterConfig - */ - 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 LlamaGuard38bFilterConfig - */ - @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 LlamaGuard38b config; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for LlamaGuard38bFilterConfig. - */ - protected LlamaGuard38bFilterConfig() - { - } - - /** - * Set the type of this {@link LlamaGuard38bFilterConfig} instance and return the same instance. - * - * @param type - * Name of the filter provider type - * @return The same instance of this {@link LlamaGuard38bFilterConfig} class - */ - @Nonnull - public LlamaGuard38bFilterConfig type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Name of the filter provider type - * - * @return type The type of this {@link LlamaGuard38bFilterConfig} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link LlamaGuard38bFilterConfig} instance. - * - * @param type - * Name of the filter provider type - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the config of this {@link LlamaGuard38bFilterConfig} instance and return the same instance. - * - * @param config - * The config of this {@link LlamaGuard38bFilterConfig} - * @return The same instance of this {@link LlamaGuard38bFilterConfig} class - */ - @Nonnull - public LlamaGuard38bFilterConfig config( @Nonnull final LlamaGuard38b config ) - { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link LlamaGuard38bFilterConfig} instance. - */ - @Nonnull - public LlamaGuard38b getConfig() - { - return config; - } - - /** - * Set the config of this {@link LlamaGuard38bFilterConfig} instance. - * - * @param config - * The config of this {@link LlamaGuard38bFilterConfig} - */ - public void setConfig( @Nonnull final LlamaGuard38b config ) - { - this.config = config; - } - - /** - * Get the names of the unrecognizable properties of the {@link LlamaGuard38bFilterConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link LlamaGuard38bFilterConfig} 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("LlamaGuard38bFilterConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link LlamaGuard38bFilterConfig} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( config != null ) - declaredFields.put("config", config); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link LlamaGuard38bFilterConfig} 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 LlamaGuard38bFilterConfig llamaGuard38bFilterConfig = (LlamaGuard38bFilterConfig) o; - return Objects.equals(this.cloudSdkCustomFields, llamaGuard38bFilterConfig.cloudSdkCustomFields) - && Objects.equals(this.type, llamaGuard38bFilterConfig.type) - && Objects.equals(this.config, llamaGuard38bFilterConfig.config); - } - - @Override - public int hashCode() - { - return Objects.hash(type, config, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class LlamaGuard38bFilterConfig {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java deleted file mode 100644 index 6ec620150..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigMaskingProviders.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * MaskingModuleConfigMaskingProviders - */ - -@Beta // CHECKSTYLE:OFF -public class MaskingModuleConfigMaskingProviders implements MaskingModuleConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "masking_providers" ) - private List maskingProviders = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for MaskingModuleConfigMaskingProviders. - */ - protected MaskingModuleConfigMaskingProviders() - { - } - - /** - * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance and return the same - * instance. - * - * @param maskingProviders - * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use - * `providers` property instead. - * @return The same instance of this {@link MaskingModuleConfigMaskingProviders} class - */ - @Nonnull - public MaskingModuleConfigMaskingProviders maskingProviders( @Nonnull final List maskingProviders ) - { - this.maskingProviders = maskingProviders; - return this; - } - - /** - * Add one maskingProviders instance to this {@link MaskingModuleConfigMaskingProviders}. - * - * @param maskingProvidersItem - * The maskingProviders that should be added - * @return The same instance of type {@link MaskingModuleConfigMaskingProviders} - */ - @Nonnull - public MaskingModuleConfigMaskingProviders addMaskingProvidersItem( @Nonnull final DPIConfig maskingProvidersItem ) - { - if( this.maskingProviders == null ) { - this.maskingProviders = new ArrayList<>(); - } - this.maskingProviders.add(maskingProvidersItem); - return this; - } - - /** - * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` - * property instead. - * - * @return maskingProviders The maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. - * @deprecated - */ - @Deprecated - @Nonnull - public List getMaskingProviders() - { - return maskingProviders; - } - - /** - * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. - * - * @param maskingProviders - * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use - * `providers` property instead. - */ - public void setMaskingProviders( @Nonnull final List maskingProviders ) - { - this.maskingProviders = maskingProviders; - } - - /** - * Get the names of the unrecognizable properties of the {@link MaskingModuleConfigMaskingProviders}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link MaskingModuleConfigMaskingProviders} 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( - "MaskingModuleConfigMaskingProviders has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link MaskingModuleConfigMaskingProviders} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( maskingProviders != null ) - declaredFields.put("maskingProviders", maskingProviders); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link MaskingModuleConfigMaskingProviders} 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 MaskingModuleConfigMaskingProviders maskingModuleConfigMaskingProviders = - (MaskingModuleConfigMaskingProviders) o; - return Objects.equals(this.cloudSdkCustomFields, maskingModuleConfigMaskingProviders.cloudSdkCustomFields) - && Objects.equals(this.maskingProviders, maskingModuleConfigMaskingProviders.maskingProviders); - } - - @Override - public int hashCode() - { - return Objects.hash(maskingProviders, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class MaskingModuleConfigMaskingProviders {\n"); - sb.append(" maskingProviders: ").append(toIndentedString(maskingProviders)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java deleted file mode 100644 index 8465d3086..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfigProviders.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * MaskingModuleConfigProviders - */ - -@Beta // CHECKSTYLE:OFF -public class MaskingModuleConfigProviders implements MaskingModuleConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "providers" ) - private List providers = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for MaskingModuleConfigProviders. - */ - protected MaskingModuleConfigProviders() - { - } - - /** - * Set the providers of this {@link MaskingModuleConfigProviders} instance and return the same instance. - * - * @param providers - * List of masking service providers - * @return The same instance of this {@link MaskingModuleConfigProviders} class - */ - @Nonnull - public MaskingModuleConfigProviders providers( @Nonnull final List providers ) - { - this.providers = providers; - return this; - } - - /** - * Add one providers instance to this {@link MaskingModuleConfigProviders}. - * - * @param providersItem - * The providers that should be added - * @return The same instance of type {@link MaskingModuleConfigProviders} - */ - @Nonnull - public MaskingModuleConfigProviders addProvidersItem( @Nonnull final DPIConfig providersItem ) - { - if( this.providers == null ) { - this.providers = new ArrayList<>(); - } - this.providers.add(providersItem); - return this; - } - - /** - * List of masking service providers - * - * @return providers The providers of this {@link MaskingModuleConfigProviders} instance. - */ - @Nonnull - public List getProviders() - { - return providers; - } - - /** - * Set the providers of this {@link MaskingModuleConfigProviders} instance. - * - * @param providers - * List of masking service providers - */ - public void setProviders( @Nonnull final List providers ) - { - this.providers = providers; - } - - /** - * Get the names of the unrecognizable properties of the {@link MaskingModuleConfigProviders}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link MaskingModuleConfigProviders} 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("MaskingModuleConfigProviders has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link MaskingModuleConfigProviders} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( providers != null ) - declaredFields.put("providers", providers); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link MaskingModuleConfigProviders} 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 MaskingModuleConfigProviders maskingModuleConfigProviders = (MaskingModuleConfigProviders) o; - return Objects.equals(this.cloudSdkCustomFields, maskingModuleConfigProviders.cloudSdkCustomFields) - && Objects.equals(this.providers, maskingModuleConfigProviders.providers); - } - - @Override - public int hashCode() - { - return Objects.hash(providers, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class MaskingModuleConfigProviders {\n"); - sb.append(" providers: ").append(toIndentedString(providers)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java deleted file mode 100644 index 54c929f92..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCall.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * MessageToolCall - */ - -@Beta // CHECKSTYLE:OFF -public class MessageToolCall -// CHECKSTYLE:ON -{ - @JsonProperty( "id" ) - private String id; - - /** - * The type of the tool. Currently, only `function` is supported. - */ - public enum TypeEnum - { - /** - * The FUNCTION option of this MessageToolCall - */ - FUNCTION("function"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this MessageToolCall - */ - 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 MessageToolCall - */ - @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( "function" ) - private MessageToolCallFunction function; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for MessageToolCall. - */ - protected MessageToolCall() - { - } - - /** - * Set the id of this {@link MessageToolCall} instance and return the same instance. - * - * @param id - * The ID of the tool call. - * @return The same instance of this {@link MessageToolCall} class - */ - @Nonnull - public MessageToolCall id( @Nonnull final String id ) - { - this.id = id; - return this; - } - - /** - * The ID of the tool call. - * - * @return id The id of this {@link MessageToolCall} instance. - */ - @Nonnull - public String getId() - { - return id; - } - - /** - * Set the id of this {@link MessageToolCall} instance. - * - * @param id - * The ID of the tool call. - */ - public void setId( @Nonnull final String id ) - { - this.id = id; - } - - /** - * Set the type of this {@link MessageToolCall} instance and return the same instance. - * - * @param type - * The type of the tool. Currently, only `function` is supported. - * @return The same instance of this {@link MessageToolCall} class - */ - @Nonnull - public MessageToolCall type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * The type of the tool. Currently, only `function` is supported. - * - * @return type The type of this {@link MessageToolCall} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link MessageToolCall} instance. - * - * @param type - * The type of the tool. Currently, only `function` is supported. - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the function of this {@link MessageToolCall} instance and return the same instance. - * - * @param function - * The function of this {@link MessageToolCall} - * @return The same instance of this {@link MessageToolCall} class - */ - @Nonnull - public MessageToolCall function( @Nonnull final MessageToolCallFunction function ) - { - this.function = function; - return this; - } - - /** - * Get function - * - * @return function The function of this {@link MessageToolCall} instance. - */ - @Nonnull - public MessageToolCallFunction getFunction() - { - return function; - } - - /** - * Set the function of this {@link MessageToolCall} instance. - * - * @param function - * The function of this {@link MessageToolCall} - */ - public void setFunction( @Nonnull final MessageToolCallFunction function ) - { - this.function = function; - } - - /** - * Get the names of the unrecognizable properties of the {@link MessageToolCall}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link MessageToolCall} 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("MessageToolCall has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link MessageToolCall} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( id != null ) - declaredFields.put("id", id); - if( type != null ) - declaredFields.put("type", type); - if( function != null ) - declaredFields.put("function", function); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link MessageToolCall} 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 MessageToolCall messageToolCall = (MessageToolCall) o; - return Objects.equals(this.cloudSdkCustomFields, messageToolCall.cloudSdkCustomFields) - && Objects.equals(this.id, messageToolCall.id) - && Objects.equals(this.type, messageToolCall.type) - && Objects.equals(this.function, messageToolCall.function); - } - - @Override - public int hashCode() - { - return Objects.hash(id, type, function, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class MessageToolCall {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" function: ").append(toIndentedString(function)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java deleted file mode 100644 index e6bd2178a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MessageToolCallFunction.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * The function that the model called. - */ - -@Beta // CHECKSTYLE:OFF -public class MessageToolCallFunction -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "arguments" ) - private String arguments; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for MessageToolCallFunction. - */ - protected MessageToolCallFunction() - { - } - - /** - * Set the name of this {@link MessageToolCallFunction} instance and return the same instance. - * - * @param name - * The name of the function to call. - * @return The same instance of this {@link MessageToolCallFunction} class - */ - @Nonnull - public MessageToolCallFunction name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * The name of the function to call. - * - * @return name The name of this {@link MessageToolCallFunction} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link MessageToolCallFunction} instance. - * - * @param name - * The name of the function to call. - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the arguments of this {@link MessageToolCallFunction} instance and return the same instance. - * - * @param arguments - * The arguments to call the function with, as generated by the model in JSON format. Note that the model - * does not always generate valid JSON, and may hallucinate parameters not defined by your function - * schema. Validate the arguments in your code before calling your function. - * @return The same instance of this {@link MessageToolCallFunction} class - */ - @Nonnull - public MessageToolCallFunction arguments( @Nonnull final String arguments ) - { - this.arguments = arguments; - return this; - } - - /** - * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not - * always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. - * - * @return arguments The arguments of this {@link MessageToolCallFunction} instance. - */ - @Nonnull - public String getArguments() - { - return arguments; - } - - /** - * Set the arguments of this {@link MessageToolCallFunction} instance. - * - * @param arguments - * The arguments to call the function with, as generated by the model in JSON format. Note that the model - * does not always generate valid JSON, and may hallucinate parameters not defined by your function - * schema. Validate the arguments in your code before calling your function. - */ - public void setArguments( @Nonnull final String arguments ) - { - this.arguments = arguments; - } - - /** - * Get the names of the unrecognizable properties of the {@link MessageToolCallFunction}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link MessageToolCallFunction} 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("MessageToolCallFunction has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link MessageToolCallFunction} 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( arguments != null ) - declaredFields.put("arguments", arguments); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link MessageToolCallFunction} 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 MessageToolCallFunction messageToolCallFunction = (MessageToolCallFunction) o; - return Objects.equals(this.cloudSdkCustomFields, messageToolCallFunction.cloudSdkCustomFields) - && Objects.equals(this.name, messageToolCallFunction.name) - && Objects.equals(this.arguments, messageToolCallFunction.arguments); - } - - @Override - public int hashCode() - { - return Objects.hash(name, arguments, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class MessageToolCallFunction {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" arguments: ").append(toIndentedString(arguments)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java deleted file mode 100644 index 51809571b..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ModuleConfigs.java +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * ModuleConfigs - */ - -@Beta // CHECKSTYLE:OFF -public class ModuleConfigs -// CHECKSTYLE:ON -{ - @JsonProperty( "prompt_templating" ) - private PromptTemplatingModuleConfig promptTemplating; - - @JsonProperty( "filtering" ) - private FilteringModuleConfig filtering; - - @JsonProperty( "masking" ) - private MaskingModuleConfig masking; - - @JsonProperty( "grounding" ) - private GroundingModuleConfig grounding; - - @JsonProperty( "translation" ) - private TranslationModuleConfig translation; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ModuleConfigs. - */ - protected ModuleConfigs() - { - } - - /** - * Set the promptTemplating of this {@link ModuleConfigs} instance and return the same instance. - * - * @param promptTemplating - * The promptTemplating of this {@link ModuleConfigs} - * @return The same instance of this {@link ModuleConfigs} class - */ - @Nonnull - public ModuleConfigs promptTemplating( @Nonnull final PromptTemplatingModuleConfig promptTemplating ) - { - this.promptTemplating = promptTemplating; - return this; - } - - /** - * Get promptTemplating - * - * @return promptTemplating The promptTemplating of this {@link ModuleConfigs} instance. - */ - @Nonnull - public PromptTemplatingModuleConfig getPromptTemplating() - { - return promptTemplating; - } - - /** - * Set the promptTemplating of this {@link ModuleConfigs} instance. - * - * @param promptTemplating - * The promptTemplating of this {@link ModuleConfigs} - */ - public void setPromptTemplating( @Nonnull final PromptTemplatingModuleConfig promptTemplating ) - { - this.promptTemplating = promptTemplating; - } - - /** - * Set the filtering of this {@link ModuleConfigs} instance and return the same instance. - * - * @param filtering - * The filtering of this {@link ModuleConfigs} - * @return The same instance of this {@link ModuleConfigs} class - */ - @Nonnull - public ModuleConfigs filtering( @Nullable final FilteringModuleConfig filtering ) - { - this.filtering = filtering; - return this; - } - - /** - * Get filtering - * - * @return filtering The filtering of this {@link ModuleConfigs} instance. - */ - @Nonnull - public FilteringModuleConfig getFiltering() - { - return filtering; - } - - /** - * Set the filtering of this {@link ModuleConfigs} instance. - * - * @param filtering - * The filtering of this {@link ModuleConfigs} - */ - public void setFiltering( @Nullable final FilteringModuleConfig filtering ) - { - this.filtering = filtering; - } - - /** - * Set the masking of this {@link ModuleConfigs} instance and return the same instance. - * - * @param masking - * The masking of this {@link ModuleConfigs} - * @return The same instance of this {@link ModuleConfigs} class - */ - @Nonnull - public ModuleConfigs masking( @Nullable final MaskingModuleConfig masking ) - { - this.masking = masking; - return this; - } - - /** - * Get masking - * - * @return masking The masking of this {@link ModuleConfigs} instance. - */ - @Nonnull - public MaskingModuleConfig getMasking() - { - return masking; - } - - /** - * Set the masking of this {@link ModuleConfigs} instance. - * - * @param masking - * The masking of this {@link ModuleConfigs} - */ - public void setMasking( @Nullable final MaskingModuleConfig masking ) - { - this.masking = masking; - } - - /** - * Set the grounding of this {@link ModuleConfigs} instance and return the same instance. - * - * @param grounding - * The grounding of this {@link ModuleConfigs} - * @return The same instance of this {@link ModuleConfigs} class - */ - @Nonnull - public ModuleConfigs grounding( @Nullable final GroundingModuleConfig grounding ) - { - this.grounding = grounding; - return this; - } - - /** - * Get grounding - * - * @return grounding The grounding of this {@link ModuleConfigs} instance. - */ - @Nonnull - public GroundingModuleConfig getGrounding() - { - return grounding; - } - - /** - * Set the grounding of this {@link ModuleConfigs} instance. - * - * @param grounding - * The grounding of this {@link ModuleConfigs} - */ - public void setGrounding( @Nullable final GroundingModuleConfig grounding ) - { - this.grounding = grounding; - } - - /** - * Set the translation of this {@link ModuleConfigs} instance and return the same instance. - * - * @param translation - * The translation of this {@link ModuleConfigs} - * @return The same instance of this {@link ModuleConfigs} class - */ - @Nonnull - public ModuleConfigs translation( @Nullable final TranslationModuleConfig translation ) - { - this.translation = translation; - return this; - } - - /** - * Get translation - * - * @return translation The translation of this {@link ModuleConfigs} instance. - */ - @Nonnull - public TranslationModuleConfig getTranslation() - { - return translation; - } - - /** - * Set the translation of this {@link ModuleConfigs} instance. - * - * @param translation - * The translation of this {@link ModuleConfigs} - */ - public void setTranslation( @Nullable final TranslationModuleConfig translation ) - { - this.translation = translation; - } - - /** - * Get the names of the unrecognizable properties of the {@link ModuleConfigs}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ModuleConfigs} 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("ModuleConfigs has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ModuleConfigs} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( promptTemplating != null ) - declaredFields.put("promptTemplating", promptTemplating); - if( filtering != null ) - declaredFields.put("filtering", filtering); - if( masking != null ) - declaredFields.put("masking", masking); - if( grounding != null ) - declaredFields.put("grounding", grounding); - if( translation != null ) - declaredFields.put("translation", translation); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ModuleConfigs} 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 ModuleConfigs moduleConfigs = (ModuleConfigs) o; - return Objects.equals(this.cloudSdkCustomFields, moduleConfigs.cloudSdkCustomFields) - && Objects.equals(this.promptTemplating, moduleConfigs.promptTemplating) - && Objects.equals(this.filtering, moduleConfigs.filtering) - && Objects.equals(this.masking, moduleConfigs.masking) - && Objects.equals(this.grounding, moduleConfigs.grounding) - && Objects.equals(this.translation, moduleConfigs.translation); - } - - @Override - public int hashCode() - { - return Objects.hash(promptTemplating, filtering, masking, grounding, translation, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ModuleConfigs {\n"); - sb.append(" promptTemplating: ").append(toIndentedString(promptTemplating)).append("\n"); - sb.append(" filtering: ").append(toIndentedString(filtering)).append("\n"); - sb.append(" masking: ").append(toIndentedString(masking)).append("\n"); - sb.append(" grounding: ").append(toIndentedString(grounding)).append("\n"); - sb.append(" translation: ").append(toIndentedString(translation)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java deleted file mode 100644 index 63a5be7fd..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatTemplate.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * MultiChatTemplate - */ - -@Beta // CHECKSTYLE:OFF -public class MultiChatTemplate implements PromptTemplate -// CHECKSTYLE:ON -{ - @JsonProperty( "role" ) - private String role; - - @JsonProperty( "content" ) - private List content = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for MultiChatTemplate. - */ - protected MultiChatTemplate() - { - } - - /** - * Set the role of this {@link MultiChatTemplate} instance and return the same instance. - * - * @param role - * The role of this {@link MultiChatTemplate} - * @return The same instance of this {@link MultiChatTemplate} class - */ - @Nonnull - public MultiChatTemplate role( @Nonnull final String role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link MultiChatTemplate} instance. - */ - @Nonnull - public String getRole() - { - return role; - } - - /** - * Set the role of this {@link MultiChatTemplate} instance. - * - * @param role - * The role of this {@link MultiChatTemplate} - */ - public void setRole( @Nonnull final String role ) - { - this.role = role; - } - - /** - * Set the content of this {@link MultiChatTemplate} instance and return the same instance. - * - * @param content - * The content of this {@link MultiChatTemplate} - * @return The same instance of this {@link MultiChatTemplate} class - */ - @Nonnull - public MultiChatTemplate content( @Nonnull final List content ) - { - this.content = content; - return this; - } - - /** - * Add one content instance to this {@link MultiChatTemplate}. - * - * @param contentItem - * The content that should be added - * @return The same instance of type {@link MultiChatTemplate} - */ - @Nonnull - public MultiChatTemplate addContentItem( @Nonnull final MultiChatContent contentItem ) - { - if( this.content == null ) { - this.content = new ArrayList<>(); - } - this.content.add(contentItem); - return this; - } - - /** - * Get content - * - * @return content The content of this {@link MultiChatTemplate} instance. - */ - @Nonnull - public List getContent() - { - return content; - } - - /** - * Set the content of this {@link MultiChatTemplate} instance. - * - * @param content - * The content of this {@link MultiChatTemplate} - */ - public void setContent( @Nonnull final List content ) - { - this.content = content; - } - - /** - * Get the names of the unrecognizable properties of the {@link MultiChatTemplate}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link MultiChatTemplate} 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("MultiChatTemplate has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link MultiChatTemplate} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( role != null ) - declaredFields.put("role", role); - if( content != null ) - declaredFields.put("content", content); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link MultiChatTemplate} 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 MultiChatTemplate multiChatTemplate = (MultiChatTemplate) o; - return Objects.equals(this.cloudSdkCustomFields, multiChatTemplate.cloudSdkCustomFields) - && Objects.equals(this.role, multiChatTemplate.role) - && Objects.equals(this.content, multiChatTemplate.content); - } - - @Override - public int hashCode() - { - return Objects.hash(role, content, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class MultiChatTemplate {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java similarity index 67% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java index 1c48f4e11..491aeb64a 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MultiChatContent.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -20,12 +20,12 @@ import com.google.common.annotations.Beta; /** - * MultiChatContent + * OneOf */ @Beta @JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { @JsonSubTypes.Type( value = ImageContent.class ), @JsonSubTypes.Type( value = TextContent.class ), } ) +@JsonSubTypes( { @JsonSubTypes.Type( value = Cola.class ), @JsonSubTypes.Type( value = Fanta.class ), } ) -public interface MultiChatContent +public interface OneOf { } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java similarity index 57% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java index 2a4474192..f71818d41 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/MaskingModuleConfig.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -20,14 +20,15 @@ import com.google.common.annotations.Beta; /** - * MaskingModuleConfig + * OneOfWithDiscriminator */ @Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true ) @JsonSubTypes( { - @JsonSubTypes.Type( value = MaskingModuleConfigMaskingProviders.class ), - @JsonSubTypes.Type( value = MaskingModuleConfigProviders.class ), } ) + @JsonSubTypes.Type( value = Cola.class, name = "Cola" ), + @JsonSubTypes.Type( value = Fanta.class, name = "Fanta" ), } ) -public interface MaskingModuleConfig +public interface OneOfWithDiscriminator { + Object getSodaType(); } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java similarity index 55% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java index cf8526425..f9742cbd8 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/DPIEntityConfig.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -20,14 +20,15 @@ import com.google.common.annotations.Beta; /** - * DPIEntityConfig + * OneOfWithDiscriminatorAndMapping */ @Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true ) @JsonSubTypes( { - @JsonSubTypes.Type( value = DPICustomEntity.class ), - @JsonSubTypes.Type( value = DPIStandardEntity.class ), } ) + @JsonSubTypes.Type( value = Cola.class, name = "cool_cola" ), + @JsonSubTypes.Type( value = Fanta.class, name = "fancy_fanta" ), } ) -public interface DPIEntityConfig +public interface OneOfWithDiscriminatorAndMapping { + Object getSodaType(); } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java similarity index 57% rename from datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java rename to datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java index 3bb81df8e..c8657f4cb 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/InputFilterConfig.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java @@ -3,8 +3,8 @@ */ /* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. + * SodaStore API + * API for managing soda products and orders in SodaStore. * * * @@ -20,14 +20,15 @@ import com.google.common.annotations.Beta; /** - * InputFilterConfig + * OneOfWithEnumDiscriminator */ @Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) +@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "disc", visible = true ) @JsonSubTypes( { - @JsonSubTypes.Type( value = AzureContentSafetyInputFilterConfig.class ), - @JsonSubTypes.Type( value = LlamaGuard38bFilterConfig.class ), } ) + @JsonSubTypes.Type( value = Bar.class, name = "disc_bar" ), + @JsonSubTypes.Type( value = Foo.class, name = "disc_foo" ), } ) -public interface InputFilterConfig +public interface OneOfWithEnumDiscriminator { + Object getDisc(); } diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java deleted file mode 100644 index 41863b943..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfig.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfig - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "modules" ) - private ModuleConfigs modules; - - @JsonProperty( "stream" ) - private GlobalStreamOptions stream; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfig. - */ - protected OrchestrationConfig() - { - } - - /** - * Set the modules of this {@link OrchestrationConfig} instance and return the same instance. - * - * @param modules - * The modules of this {@link OrchestrationConfig} - * @return The same instance of this {@link OrchestrationConfig} class - */ - @Nonnull - public OrchestrationConfig modules( @Nonnull final ModuleConfigs modules ) - { - this.modules = modules; - return this; - } - - /** - * Get modules - * - * @return modules The modules of this {@link OrchestrationConfig} instance. - */ - @Nonnull - public ModuleConfigs getModules() - { - return modules; - } - - /** - * Set the modules of this {@link OrchestrationConfig} instance. - * - * @param modules - * The modules of this {@link OrchestrationConfig} - */ - public void setModules( @Nonnull final ModuleConfigs modules ) - { - this.modules = modules; - } - - /** - * Set the stream of this {@link OrchestrationConfig} instance and return the same instance. - * - * @param stream - * The stream of this {@link OrchestrationConfig} - * @return The same instance of this {@link OrchestrationConfig} class - */ - @Nonnull - public OrchestrationConfig stream( @Nullable final GlobalStreamOptions stream ) - { - this.stream = stream; - return this; - } - - /** - * Get stream - * - * @return stream The stream of this {@link OrchestrationConfig} instance. - */ - @Nonnull - public GlobalStreamOptions getStream() - { - return stream; - } - - /** - * Set the stream of this {@link OrchestrationConfig} instance. - * - * @param stream - * The stream of this {@link OrchestrationConfig} - */ - public void setStream( @Nullable final GlobalStreamOptions stream ) - { - this.stream = stream; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfig} 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("OrchestrationConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfig} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( modules != null ) - declaredFields.put("modules", modules); - if( stream != null ) - declaredFields.put("stream", stream); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfig} 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 OrchestrationConfig orchestrationConfig = (OrchestrationConfig) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfig.cloudSdkCustomFields) - && Objects.equals(this.modules, orchestrationConfig.modules) - && Objects.equals(this.stream, orchestrationConfig.stream); - } - - @Override - public int hashCode() - { - return Objects.hash(modules, stream, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfig {\n"); - sb.append(" modules: ").append(toIndentedString(modules)).append("\n"); - sb.append(" stream: ").append(toIndentedString(stream)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java deleted file mode 100644 index 220347c72..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigDeleteResponse.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfigDeleteResponse - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfigDeleteResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "message" ) - private String message; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfigDeleteResponse. - */ - protected OrchestrationConfigDeleteResponse() - { - } - - /** - * Set the message of this {@link OrchestrationConfigDeleteResponse} instance and return the same instance. - * - * @param message - * The message of this {@link OrchestrationConfigDeleteResponse} - * @return The same instance of this {@link OrchestrationConfigDeleteResponse} class - */ - @Nonnull - public OrchestrationConfigDeleteResponse message( @Nonnull final String message ) - { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link OrchestrationConfigDeleteResponse} instance. - */ - @Nonnull - public String getMessage() - { - return message; - } - - /** - * Set the message of this {@link OrchestrationConfigDeleteResponse} instance. - * - * @param message - * The message of this {@link OrchestrationConfigDeleteResponse} - */ - public void setMessage( @Nonnull final String message ) - { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfigDeleteResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfigDeleteResponse} 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( - "OrchestrationConfigDeleteResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfigDeleteResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( message != null ) - declaredFields.put("message", message); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfigDeleteResponse} 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 OrchestrationConfigDeleteResponse orchestrationConfigDeleteResponse = - (OrchestrationConfigDeleteResponse) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigDeleteResponse.cloudSdkCustomFields) - && Objects.equals(this.message, orchestrationConfigDeleteResponse.message); - } - - @Override - public int hashCode() - { - return Objects.hash(message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfigDeleteResponse {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java deleted file mode 100644 index 4981e48cc..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigGetResponse.java +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfigGetResponse - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfigGetResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "id" ) - private UUID id; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "creation_timestamp" ) - private String creationTimestamp; - - @JsonProperty( "managed_by" ) - private String managedBy; - - @JsonProperty( "is_version_head" ) - private Boolean isVersionHead; - - @JsonProperty( "resource_group_id" ) - private String resourceGroupId; - - @JsonProperty( "spec" ) - private OrchestrationConfig spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfigGetResponse. - */ - protected OrchestrationConfigGetResponse() - { - } - - /** - * Set the id of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param id - * The id of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse id( @Nullable final UUID id ) - { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public UUID getId() - { - return id; - } - - /** - * Set the id of this {@link OrchestrationConfigGetResponse} instance. - * - * @param id - * The id of this {@link OrchestrationConfigGetResponse} - */ - public void setId( @Nullable final UUID id ) - { - this.id = id; - } - - /** - * Set the name of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param name - * The name of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse name( @Nullable final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link OrchestrationConfigGetResponse} instance. - * - * @param name - * The name of this {@link OrchestrationConfigGetResponse} - */ - public void setName( @Nullable final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param version - * The version of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse version( @Nullable final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link OrchestrationConfigGetResponse} instance. - * - * @param version - * The version of this {@link OrchestrationConfigGetResponse} - */ - public void setVersion( @Nullable final String version ) - { - this.version = version; - } - - /** - * Set the scenario of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse scenario( @Nullable final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link OrchestrationConfigGetResponse} instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigGetResponse} - */ - public void setScenario( @Nullable final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the creationTimestamp of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param creationTimestamp - * The creationTimestamp of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse creationTimestamp( @Nullable final String creationTimestamp ) - { - this.creationTimestamp = creationTimestamp; - return this; - } - - /** - * Get creationTimestamp - * - * @return creationTimestamp The creationTimestamp of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public String getCreationTimestamp() - { - return creationTimestamp; - } - - /** - * Set the creationTimestamp of this {@link OrchestrationConfigGetResponse} instance. - * - * @param creationTimestamp - * The creationTimestamp of this {@link OrchestrationConfigGetResponse} - */ - public void setCreationTimestamp( @Nullable final String creationTimestamp ) - { - this.creationTimestamp = creationTimestamp; - } - - /** - * Set the managedBy of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param managedBy - * The managedBy of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse managedBy( @Nullable final String managedBy ) - { - this.managedBy = managedBy; - return this; - } - - /** - * Get managedBy - * - * @return managedBy The managedBy of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public String getManagedBy() - { - return managedBy; - } - - /** - * Set the managedBy of this {@link OrchestrationConfigGetResponse} instance. - * - * @param managedBy - * The managedBy of this {@link OrchestrationConfigGetResponse} - */ - public void setManagedBy( @Nullable final String managedBy ) - { - this.managedBy = managedBy; - } - - /** - * Set the isVersionHead of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param isVersionHead - * The isVersionHead of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse isVersionHead( @Nullable final Boolean isVersionHead ) - { - this.isVersionHead = isVersionHead; - return this; - } - - /** - * Get isVersionHead - * - * @return isVersionHead The isVersionHead of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public Boolean isIsVersionHead() - { - return isVersionHead; - } - - /** - * Set the isVersionHead of this {@link OrchestrationConfigGetResponse} instance. - * - * @param isVersionHead - * The isVersionHead of this {@link OrchestrationConfigGetResponse} - */ - public void setIsVersionHead( @Nullable final Boolean isVersionHead ) - { - this.isVersionHead = isVersionHead; - } - - /** - * Set the resourceGroupId of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param resourceGroupId - * The resourceGroupId of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse resourceGroupId( @Nullable final String resourceGroupId ) - { - this.resourceGroupId = resourceGroupId; - return this; - } - - /** - * Get resourceGroupId - * - * @return resourceGroupId The resourceGroupId of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public String getResourceGroupId() - { - return resourceGroupId; - } - - /** - * Set the resourceGroupId of this {@link OrchestrationConfigGetResponse} instance. - * - * @param resourceGroupId - * The resourceGroupId of this {@link OrchestrationConfigGetResponse} - */ - public void setResourceGroupId( @Nullable final String resourceGroupId ) - { - this.resourceGroupId = resourceGroupId; - } - - /** - * Set the spec of this {@link OrchestrationConfigGetResponse} instance and return the same instance. - * - * @param spec - * The spec of this {@link OrchestrationConfigGetResponse} - * @return The same instance of this {@link OrchestrationConfigGetResponse} class - */ - @Nonnull - public OrchestrationConfigGetResponse spec( @Nullable final OrchestrationConfig spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link OrchestrationConfigGetResponse} instance. - */ - @Nonnull - public OrchestrationConfig getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link OrchestrationConfigGetResponse} instance. - * - * @param spec - * The spec of this {@link OrchestrationConfigGetResponse} - */ - public void setSpec( @Nullable final OrchestrationConfig spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfigGetResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfigGetResponse} 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("OrchestrationConfigGetResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfigGetResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( id != null ) - declaredFields.put("id", id); - if( name != null ) - declaredFields.put("name", name); - if( version != null ) - declaredFields.put("version", version); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( creationTimestamp != null ) - declaredFields.put("creationTimestamp", creationTimestamp); - if( managedBy != null ) - declaredFields.put("managedBy", managedBy); - if( isVersionHead != null ) - declaredFields.put("isVersionHead", isVersionHead); - if( resourceGroupId != null ) - declaredFields.put("resourceGroupId", resourceGroupId); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfigGetResponse} 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 OrchestrationConfigGetResponse orchestrationConfigGetResponse = (OrchestrationConfigGetResponse) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigGetResponse.cloudSdkCustomFields) - && Objects.equals(this.id, orchestrationConfigGetResponse.id) - && Objects.equals(this.name, orchestrationConfigGetResponse.name) - && Objects.equals(this.version, orchestrationConfigGetResponse.version) - && Objects.equals(this.scenario, orchestrationConfigGetResponse.scenario) - && Objects.equals(this.creationTimestamp, orchestrationConfigGetResponse.creationTimestamp) - && Objects.equals(this.managedBy, orchestrationConfigGetResponse.managedBy) - && Objects.equals(this.isVersionHead, orchestrationConfigGetResponse.isVersionHead) - && Objects.equals(this.resourceGroupId, orchestrationConfigGetResponse.resourceGroupId) - && Objects.equals(this.spec, orchestrationConfigGetResponse.spec); - } - - @Override - public int hashCode() - { - return Objects - .hash( - id, - name, - version, - scenario, - creationTimestamp, - managedBy, - isVersionHead, - resourceGroupId, - spec, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfigGetResponse {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); - sb.append(" managedBy: ").append(toIndentedString(managedBy)).append("\n"); - sb.append(" isVersionHead: ").append(toIndentedString(isVersionHead)).append("\n"); - sb.append(" resourceGroupId: ").append(toIndentedString(resourceGroupId)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java deleted file mode 100644 index bbb96af9f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigListResponse.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfigListResponse - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfigListResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "count" ) - private Integer count; - - @JsonProperty( "resources" ) - private List resources = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfigListResponse. - */ - protected OrchestrationConfigListResponse() - { - } - - /** - * Set the count of this {@link OrchestrationConfigListResponse} instance and return the same instance. - * - * @param count - * The count of this {@link OrchestrationConfigListResponse} - * @return The same instance of this {@link OrchestrationConfigListResponse} class - */ - @Nonnull - public OrchestrationConfigListResponse count( @Nonnull final Integer count ) - { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link OrchestrationConfigListResponse} instance. - */ - @Nonnull - public Integer getCount() - { - return count; - } - - /** - * Set the count of this {@link OrchestrationConfigListResponse} instance. - * - * @param count - * The count of this {@link OrchestrationConfigListResponse} - */ - public void setCount( @Nonnull final Integer count ) - { - this.count = count; - } - - /** - * Set the resources of this {@link OrchestrationConfigListResponse} instance and return the same instance. - * - * @param resources - * The resources of this {@link OrchestrationConfigListResponse} - * @return The same instance of this {@link OrchestrationConfigListResponse} class - */ - @Nonnull - public OrchestrationConfigListResponse resources( @Nonnull final List resources ) - { - this.resources = resources; - return this; - } - - /** - * Add one resources instance to this {@link OrchestrationConfigListResponse}. - * - * @param resourcesItem - * The resources that should be added - * @return The same instance of type {@link OrchestrationConfigListResponse} - */ - @Nonnull - public OrchestrationConfigListResponse addResourcesItem( - @Nonnull final OrchestrationConfigGetResponse resourcesItem ) - { - if( this.resources == null ) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * - * @return resources The resources of this {@link OrchestrationConfigListResponse} instance. - */ - @Nonnull - public List getResources() - { - return resources; - } - - /** - * Set the resources of this {@link OrchestrationConfigListResponse} instance. - * - * @param resources - * The resources of this {@link OrchestrationConfigListResponse} - */ - public void setResources( @Nonnull final List resources ) - { - this.resources = resources; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfigListResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfigListResponse} 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("OrchestrationConfigListResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfigListResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( count != null ) - declaredFields.put("count", count); - if( resources != null ) - declaredFields.put("resources", resources); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfigListResponse} 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 OrchestrationConfigListResponse orchestrationConfigListResponse = (OrchestrationConfigListResponse) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigListResponse.cloudSdkCustomFields) - && Objects.equals(this.count, orchestrationConfigListResponse.count) - && Objects.equals(this.resources, orchestrationConfigListResponse.resources); - } - - @Override - public int hashCode() - { - return Objects.hash(count, resources, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfigListResponse {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java deleted file mode 100644 index 3d13ac2ac..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostRequest.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfigPostRequest - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfigPostRequest -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "spec" ) - private OrchestrationConfig spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfigPostRequest. - */ - protected OrchestrationConfigPostRequest() - { - } - - /** - * Set the name of this {@link OrchestrationConfigPostRequest} instance and return the same instance. - * - * @param name - * The name of this {@link OrchestrationConfigPostRequest} - * @return The same instance of this {@link OrchestrationConfigPostRequest} class - */ - @Nonnull - public OrchestrationConfigPostRequest name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link OrchestrationConfigPostRequest} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link OrchestrationConfigPostRequest} instance. - * - * @param name - * The name of this {@link OrchestrationConfigPostRequest} - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link OrchestrationConfigPostRequest} instance and return the same instance. - * - * @param version - * The version of this {@link OrchestrationConfigPostRequest} - * @return The same instance of this {@link OrchestrationConfigPostRequest} class - */ - @Nonnull - public OrchestrationConfigPostRequest version( @Nonnull final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link OrchestrationConfigPostRequest} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link OrchestrationConfigPostRequest} instance. - * - * @param version - * The version of this {@link OrchestrationConfigPostRequest} - */ - public void setVersion( @Nonnull final String version ) - { - this.version = version; - } - - /** - * Set the scenario of this {@link OrchestrationConfigPostRequest} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigPostRequest} - * @return The same instance of this {@link OrchestrationConfigPostRequest} class - */ - @Nonnull - public OrchestrationConfigPostRequest scenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link OrchestrationConfigPostRequest} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link OrchestrationConfigPostRequest} instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigPostRequest} - */ - public void setScenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the spec of this {@link OrchestrationConfigPostRequest} instance and return the same instance. - * - * @param spec - * The spec of this {@link OrchestrationConfigPostRequest} - * @return The same instance of this {@link OrchestrationConfigPostRequest} class - */ - @Nonnull - public OrchestrationConfigPostRequest spec( @Nonnull final OrchestrationConfig spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link OrchestrationConfigPostRequest} instance. - */ - @Nonnull - public OrchestrationConfig getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link OrchestrationConfigPostRequest} instance. - * - * @param spec - * The spec of this {@link OrchestrationConfigPostRequest} - */ - public void setSpec( @Nonnull final OrchestrationConfig spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfigPostRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfigPostRequest} 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("OrchestrationConfigPostRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfigPostRequest} 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( version != null ) - declaredFields.put("version", version); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfigPostRequest} 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 OrchestrationConfigPostRequest orchestrationConfigPostRequest = (OrchestrationConfigPostRequest) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigPostRequest.cloudSdkCustomFields) - && Objects.equals(this.name, orchestrationConfigPostRequest.name) - && Objects.equals(this.version, orchestrationConfigPostRequest.version) - && Objects.equals(this.scenario, orchestrationConfigPostRequest.scenario) - && Objects.equals(this.spec, orchestrationConfigPostRequest.spec); - } - - @Override - public int hashCode() - { - return Objects.hash(name, version, scenario, spec, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfigPostRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java deleted file mode 100644 index 55b98baba..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigPostResponse.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfigPostResponse - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfigPostResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "message" ) - private String message; - - @JsonProperty( "id" ) - private UUID id; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfigPostResponse. - */ - protected OrchestrationConfigPostResponse() - { - } - - /** - * Set the message of this {@link OrchestrationConfigPostResponse} instance and return the same instance. - * - * @param message - * The message of this {@link OrchestrationConfigPostResponse} - * @return The same instance of this {@link OrchestrationConfigPostResponse} class - */ - @Nonnull - public OrchestrationConfigPostResponse message( @Nonnull final String message ) - { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link OrchestrationConfigPostResponse} instance. - */ - @Nonnull - public String getMessage() - { - return message; - } - - /** - * Set the message of this {@link OrchestrationConfigPostResponse} instance. - * - * @param message - * The message of this {@link OrchestrationConfigPostResponse} - */ - public void setMessage( @Nonnull final String message ) - { - this.message = message; - } - - /** - * Set the id of this {@link OrchestrationConfigPostResponse} instance and return the same instance. - * - * @param id - * The id of this {@link OrchestrationConfigPostResponse} - * @return The same instance of this {@link OrchestrationConfigPostResponse} class - */ - @Nonnull - public OrchestrationConfigPostResponse id( @Nonnull final UUID id ) - { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link OrchestrationConfigPostResponse} instance. - */ - @Nonnull - public UUID getId() - { - return id; - } - - /** - * Set the id of this {@link OrchestrationConfigPostResponse} instance. - * - * @param id - * The id of this {@link OrchestrationConfigPostResponse} - */ - public void setId( @Nonnull final UUID id ) - { - this.id = id; - } - - /** - * Set the scenario of this {@link OrchestrationConfigPostResponse} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigPostResponse} - * @return The same instance of this {@link OrchestrationConfigPostResponse} class - */ - @Nonnull - public OrchestrationConfigPostResponse scenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link OrchestrationConfigPostResponse} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link OrchestrationConfigPostResponse} instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigPostResponse} - */ - public void setScenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the name of this {@link OrchestrationConfigPostResponse} instance and return the same instance. - * - * @param name - * The name of this {@link OrchestrationConfigPostResponse} - * @return The same instance of this {@link OrchestrationConfigPostResponse} class - */ - @Nonnull - public OrchestrationConfigPostResponse name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link OrchestrationConfigPostResponse} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link OrchestrationConfigPostResponse} instance. - * - * @param name - * The name of this {@link OrchestrationConfigPostResponse} - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link OrchestrationConfigPostResponse} instance and return the same instance. - * - * @param version - * The version of this {@link OrchestrationConfigPostResponse} - * @return The same instance of this {@link OrchestrationConfigPostResponse} class - */ - @Nonnull - public OrchestrationConfigPostResponse version( @Nonnull final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link OrchestrationConfigPostResponse} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link OrchestrationConfigPostResponse} instance. - * - * @param version - * The version of this {@link OrchestrationConfigPostResponse} - */ - public void setVersion( @Nonnull final String version ) - { - this.version = version; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfigPostResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfigPostResponse} 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("OrchestrationConfigPostResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfigPostResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( message != null ) - declaredFields.put("message", message); - if( id != null ) - declaredFields.put("id", id); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( name != null ) - declaredFields.put("name", name); - if( version != null ) - declaredFields.put("version", version); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfigPostResponse} 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 OrchestrationConfigPostResponse orchestrationConfigPostResponse = (OrchestrationConfigPostResponse) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigPostResponse.cloudSdkCustomFields) - && Objects.equals(this.message, orchestrationConfigPostResponse.message) - && Objects.equals(this.id, orchestrationConfigPostResponse.id) - && Objects.equals(this.scenario, orchestrationConfigPostResponse.scenario) - && Objects.equals(this.name, orchestrationConfigPostResponse.name) - && Objects.equals(this.version, orchestrationConfigPostResponse.version); - } - - @Override - public int hashCode() - { - return Objects.hash(message, id, scenario, name, version, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfigPostResponse {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java deleted file mode 100644 index a5850409a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrchestrationConfigResource.java +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OrchestrationConfigResource - */ - -@Beta // CHECKSTYLE:OFF -public class OrchestrationConfigResource -// CHECKSTYLE:ON -{ - @JsonProperty( "id" ) - private UUID id; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "creation_timestamp" ) - private String creationTimestamp; - - @JsonProperty( "managed_by" ) - private String managedBy; - - @JsonProperty( "is_version_head" ) - private Boolean isVersionHead; - - @JsonProperty( "resource_group_id" ) - private String resourceGroupId; - - @JsonProperty( "spec" ) - private OrchestrationConfig spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OrchestrationConfigResource. - */ - protected OrchestrationConfigResource() - { - } - - /** - * Set the id of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param id - * The id of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource id( @Nullable final UUID id ) - { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public UUID getId() - { - return id; - } - - /** - * Set the id of this {@link OrchestrationConfigResource} instance. - * - * @param id - * The id of this {@link OrchestrationConfigResource} - */ - public void setId( @Nullable final UUID id ) - { - this.id = id; - } - - /** - * Set the name of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param name - * The name of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource name( @Nullable final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link OrchestrationConfigResource} instance. - * - * @param name - * The name of this {@link OrchestrationConfigResource} - */ - public void setName( @Nullable final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param version - * The version of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource version( @Nullable final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link OrchestrationConfigResource} instance. - * - * @param version - * The version of this {@link OrchestrationConfigResource} - */ - public void setVersion( @Nullable final String version ) - { - this.version = version; - } - - /** - * Set the scenario of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource scenario( @Nullable final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link OrchestrationConfigResource} instance. - * - * @param scenario - * The scenario of this {@link OrchestrationConfigResource} - */ - public void setScenario( @Nullable final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the creationTimestamp of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param creationTimestamp - * The creationTimestamp of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource creationTimestamp( @Nullable final String creationTimestamp ) - { - this.creationTimestamp = creationTimestamp; - return this; - } - - /** - * Get creationTimestamp - * - * @return creationTimestamp The creationTimestamp of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public String getCreationTimestamp() - { - return creationTimestamp; - } - - /** - * Set the creationTimestamp of this {@link OrchestrationConfigResource} instance. - * - * @param creationTimestamp - * The creationTimestamp of this {@link OrchestrationConfigResource} - */ - public void setCreationTimestamp( @Nullable final String creationTimestamp ) - { - this.creationTimestamp = creationTimestamp; - } - - /** - * Set the managedBy of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param managedBy - * The managedBy of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource managedBy( @Nullable final String managedBy ) - { - this.managedBy = managedBy; - return this; - } - - /** - * Get managedBy - * - * @return managedBy The managedBy of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public String getManagedBy() - { - return managedBy; - } - - /** - * Set the managedBy of this {@link OrchestrationConfigResource} instance. - * - * @param managedBy - * The managedBy of this {@link OrchestrationConfigResource} - */ - public void setManagedBy( @Nullable final String managedBy ) - { - this.managedBy = managedBy; - } - - /** - * Set the isVersionHead of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param isVersionHead - * The isVersionHead of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource isVersionHead( @Nullable final Boolean isVersionHead ) - { - this.isVersionHead = isVersionHead; - return this; - } - - /** - * Get isVersionHead - * - * @return isVersionHead The isVersionHead of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public Boolean isIsVersionHead() - { - return isVersionHead; - } - - /** - * Set the isVersionHead of this {@link OrchestrationConfigResource} instance. - * - * @param isVersionHead - * The isVersionHead of this {@link OrchestrationConfigResource} - */ - public void setIsVersionHead( @Nullable final Boolean isVersionHead ) - { - this.isVersionHead = isVersionHead; - } - - /** - * Set the resourceGroupId of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param resourceGroupId - * The resourceGroupId of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource resourceGroupId( @Nullable final String resourceGroupId ) - { - this.resourceGroupId = resourceGroupId; - return this; - } - - /** - * Get resourceGroupId - * - * @return resourceGroupId The resourceGroupId of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public String getResourceGroupId() - { - return resourceGroupId; - } - - /** - * Set the resourceGroupId of this {@link OrchestrationConfigResource} instance. - * - * @param resourceGroupId - * The resourceGroupId of this {@link OrchestrationConfigResource} - */ - public void setResourceGroupId( @Nullable final String resourceGroupId ) - { - this.resourceGroupId = resourceGroupId; - } - - /** - * Set the spec of this {@link OrchestrationConfigResource} instance and return the same instance. - * - * @param spec - * The spec of this {@link OrchestrationConfigResource} - * @return The same instance of this {@link OrchestrationConfigResource} class - */ - @Nonnull - public OrchestrationConfigResource spec( @Nullable final OrchestrationConfig spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link OrchestrationConfigResource} instance. - */ - @Nonnull - public OrchestrationConfig getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link OrchestrationConfigResource} instance. - * - * @param spec - * The spec of this {@link OrchestrationConfigResource} - */ - public void setSpec( @Nullable final OrchestrationConfig spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link OrchestrationConfigResource}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OrchestrationConfigResource} 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("OrchestrationConfigResource has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OrchestrationConfigResource} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( id != null ) - declaredFields.put("id", id); - if( name != null ) - declaredFields.put("name", name); - if( version != null ) - declaredFields.put("version", version); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( creationTimestamp != null ) - declaredFields.put("creationTimestamp", creationTimestamp); - if( managedBy != null ) - declaredFields.put("managedBy", managedBy); - if( isVersionHead != null ) - declaredFields.put("isVersionHead", isVersionHead); - if( resourceGroupId != null ) - declaredFields.put("resourceGroupId", resourceGroupId); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OrchestrationConfigResource} 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 OrchestrationConfigResource orchestrationConfigResource = (OrchestrationConfigResource) o; - return Objects.equals(this.cloudSdkCustomFields, orchestrationConfigResource.cloudSdkCustomFields) - && Objects.equals(this.id, orchestrationConfigResource.id) - && Objects.equals(this.name, orchestrationConfigResource.name) - && Objects.equals(this.version, orchestrationConfigResource.version) - && Objects.equals(this.scenario, orchestrationConfigResource.scenario) - && Objects.equals(this.creationTimestamp, orchestrationConfigResource.creationTimestamp) - && Objects.equals(this.managedBy, orchestrationConfigResource.managedBy) - && Objects.equals(this.isVersionHead, orchestrationConfigResource.isVersionHead) - && Objects.equals(this.resourceGroupId, orchestrationConfigResource.resourceGroupId) - && Objects.equals(this.spec, orchestrationConfigResource.spec); - } - - @Override - public int hashCode() - { - return Objects - .hash( - id, - name, - version, - scenario, - creationTimestamp, - managedBy, - isVersionHead, - resourceGroupId, - spec, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationConfigResource {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); - sb.append(" managedBy: ").append(toIndentedString(managedBy)).append("\n"); - sb.append(" isVersionHead: ").append(toIndentedString(isVersionHead)).append("\n"); - sb.append(" resourceGroupId: ").append(toIndentedString(resourceGroupId)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java new file mode 100644 index 000000000..dfae11431 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * Order + */ + +@Beta // CHECKSTYLE:OFF +public class Order +// CHECKSTYLE:ON +{ + @JsonProperty( "productId" ) + private Long productId; + + @JsonProperty( "quantity" ) + private Integer quantity; + + @JsonProperty( "totalPrice" ) + private Float totalPrice; + + @JsonProperty( "typelessProperty" ) + private Object typelessProperty = null; + + @JsonProperty( "nullableProperty" ) + private String nullableProperty; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for Order. + */ + protected Order() + { + } + + /** + * Set the productId of this {@link Order} instance and return the same instance. + * + * @param productId + * The productId of this {@link Order} + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order productId( @Nonnull final Long productId ) + { + this.productId = productId; + return this; + } + + /** + * Get productId + * + * @return productId The productId of this {@link Order} instance. + */ + @Nonnull + public Long getProductId() + { + return productId; + } + + /** + * Set the productId of this {@link Order} instance. + * + * @param productId + * The productId of this {@link Order} + */ + public void setProductId( @Nonnull final Long productId ) + { + this.productId = productId; + } + + /** + * Set the quantity of this {@link Order} instance and return the same instance. + * + * @param quantity + * The quantity of this {@link Order} + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order quantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link Order} instance. + */ + @Nonnull + public Integer getQuantity() + { + return quantity; + } + + /** + * Set the quantity of this {@link Order} instance. + * + * @param quantity + * The quantity of this {@link Order} + */ + public void setQuantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + } + + /** + * Set the totalPrice of this {@link Order} instance and return the same instance. + * + * @param totalPrice + * The totalPrice of this {@link Order} + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order totalPrice( @Nullable final Float totalPrice ) + { + this.totalPrice = totalPrice; + return this; + } + + /** + * Get totalPrice + * + * @return totalPrice The totalPrice of this {@link Order} instance. + */ + @Nonnull + public Float getTotalPrice() + { + return totalPrice; + } + + /** + * Set the totalPrice of this {@link Order} instance. + * + * @param totalPrice + * The totalPrice of this {@link Order} + */ + public void setTotalPrice( @Nullable final Float totalPrice ) + { + this.totalPrice = totalPrice; + } + + /** + * Set the typelessProperty of this {@link Order} instance and return the same instance. + * + * @param typelessProperty + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order typelessProperty( @Nullable final Object typelessProperty ) + { + this.typelessProperty = typelessProperty; + return this; + } + + /** + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + * + * @return typelessProperty The typelessProperty of this {@link Order} instance. + */ + @Nullable + public Object getTypelessProperty() + { + return typelessProperty; + } + + /** + * Set the typelessProperty of this {@link Order} instance. + * + * @param typelessProperty + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + */ + public void setTypelessProperty( @Nullable final Object typelessProperty ) + { + this.typelessProperty = typelessProperty; + } + + /** + * Set the nullableProperty of this {@link Order} instance and return the same instance. + * + * @param nullableProperty + * Some typed property that is deliberately made nullable + * @return The same instance of this {@link Order} class + */ + @Nonnull + public Order nullableProperty( @Nullable final String nullableProperty ) + { + this.nullableProperty = nullableProperty; + return this; + } + + /** + * Some typed property that is deliberately made nullable + * + * @return nullableProperty The nullableProperty of this {@link Order} instance. + */ + @Nullable + public String getNullableProperty() + { + return nullableProperty; + } + + /** + * Set the nullableProperty of this {@link Order} instance. + * + * @param nullableProperty + * Some typed property that is deliberately made nullable + */ + public void setNullableProperty( @Nullable final String nullableProperty ) + { + this.nullableProperty = nullableProperty; + } + + /** + * Get the names of the unrecognizable properties of the {@link Order}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Order} instance. + * + * @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("Order has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link Order} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( productId != null ) + declaredFields.put("productId", productId); + if( quantity != null ) + declaredFields.put("quantity", quantity); + if( totalPrice != null ) + declaredFields.put("totalPrice", totalPrice); + if( typelessProperty != null ) + declaredFields.put("typelessProperty", typelessProperty); + if( nullableProperty != null ) + declaredFields.put("nullableProperty", nullableProperty); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link Order} instance. If the map previously contained a mapping for the + * key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final Order order = (Order) o; + return Objects.equals(this.cloudSdkCustomFields, order.cloudSdkCustomFields) + && Objects.equals(this.productId, order.productId) + && Objects.equals(this.quantity, order.quantity) + && Objects.equals(this.totalPrice, order.totalPrice) + && Objects.equals(this.typelessProperty, order.typelessProperty) + && Objects.equals(this.nullableProperty, order.nullableProperty); + } + + @Override + public int hashCode() + { + return Objects.hash(productId, quantity, totalPrice, typelessProperty, nullableProperty, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); + sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java new file mode 100644 index 000000000..709b90bb9 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java @@ -0,0 +1,415 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +import java.time.OffsetDateTime; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; + +/** + * OrderWithTimestamp + */ + +@Beta // CHECKSTYLE:OFF +public class OrderWithTimestamp +// CHECKSTYLE:ON +{ + @JsonProperty( "productId" ) + private Long productId; + + @JsonProperty( "quantity" ) + private Integer quantity; + + @JsonProperty( "totalPrice" ) + private Float totalPrice; + + @JsonProperty( "typelessProperty" ) + private Object typelessProperty; + + @JsonProperty( "nullableProperty" ) + private String nullableProperty; + + @JsonProperty( "timestamp" ) + private OffsetDateTime timestamp; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for OrderWithTimestamp. + */ + protected OrderWithTimestamp() + { + } + + /** + * Set the productId of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param productId + * The productId of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp productId( @Nonnull final Long productId ) + { + this.productId = productId; + return this; + } + + /** + * Get productId + * + * @return productId The productId of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public Long getProductId() + { + return productId; + } + + /** + * Set the productId of this {@link OrderWithTimestamp} instance. + * + * @param productId + * The productId of this {@link OrderWithTimestamp} + */ + public void setProductId( @Nonnull final Long productId ) + { + this.productId = productId; + } + + /** + * Set the quantity of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param quantity + * The quantity of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp quantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public Integer getQuantity() + { + return quantity; + } + + /** + * Set the quantity of this {@link OrderWithTimestamp} instance. + * + * @param quantity + * The quantity of this {@link OrderWithTimestamp} + */ + public void setQuantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + } + + /** + * Set the totalPrice of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param totalPrice + * The totalPrice of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp totalPrice( @Nullable final Float totalPrice ) + { + this.totalPrice = totalPrice; + return this; + } + + /** + * Get totalPrice + * + * @return totalPrice The totalPrice of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public Float getTotalPrice() + { + return totalPrice; + } + + /** + * Set the totalPrice of this {@link OrderWithTimestamp} instance. + * + * @param totalPrice + * The totalPrice of this {@link OrderWithTimestamp} + */ + public void setTotalPrice( @Nullable final Float totalPrice ) + { + this.totalPrice = totalPrice; + } + + /** + * Set the typelessProperty of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param typelessProperty + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp typelessProperty( @Nullable final Object typelessProperty ) + { + this.typelessProperty = typelessProperty; + return this; + } + + /** + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + * + * @return typelessProperty The typelessProperty of this {@link OrderWithTimestamp} instance. + */ + @Nullable + public Object getTypelessProperty() + { + return typelessProperty; + } + + /** + * Set the typelessProperty of this {@link OrderWithTimestamp} instance. + * + * @param typelessProperty + * Some typeless property, interpreted by the generator as nullable by default (because typeless) + */ + public void setTypelessProperty( @Nullable final Object typelessProperty ) + { + this.typelessProperty = typelessProperty; + } + + /** + * Set the nullableProperty of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param nullableProperty + * Some typed property that is deliberately made nullable + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp nullableProperty( @Nullable final String nullableProperty ) + { + this.nullableProperty = nullableProperty; + return this; + } + + /** + * Some typed property that is deliberately made nullable + * + * @return nullableProperty The nullableProperty of this {@link OrderWithTimestamp} instance. + */ + @Nullable + public String getNullableProperty() + { + return nullableProperty; + } + + /** + * Set the nullableProperty of this {@link OrderWithTimestamp} instance. + * + * @param nullableProperty + * Some typed property that is deliberately made nullable + */ + public void setNullableProperty( @Nullable final String nullableProperty ) + { + this.nullableProperty = nullableProperty; + } + + /** + * Set the timestamp of this {@link OrderWithTimestamp} instance and return the same instance. + * + * @param timestamp + * The timestamp of this {@link OrderWithTimestamp} + * @return The same instance of this {@link OrderWithTimestamp} class + */ + @Nonnull + public OrderWithTimestamp timestamp( @Nullable final OffsetDateTime timestamp ) + { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp The timestamp of this {@link OrderWithTimestamp} instance. + */ + @Nonnull + public OffsetDateTime getTimestamp() + { + return timestamp; + } + + /** + * Set the timestamp of this {@link OrderWithTimestamp} instance. + * + * @param timestamp + * The timestamp of this {@link OrderWithTimestamp} + */ + public void setTimestamp( @Nullable final OffsetDateTime timestamp ) + { + this.timestamp = timestamp; + } + + /** + * Get the names of the unrecognizable properties of the {@link OrderWithTimestamp}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OrderWithTimestamp} instance. + * + * @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("OrderWithTimestamp has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OrderWithTimestamp} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() + { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if( productId != null ) + declaredFields.put("productId", productId); + if( quantity != null ) + declaredFields.put("quantity", quantity); + if( totalPrice != null ) + declaredFields.put("totalPrice", totalPrice); + if( typelessProperty != null ) + declaredFields.put("typelessProperty", typelessProperty); + if( nullableProperty != null ) + declaredFields.put("nullableProperty", nullableProperty); + if( timestamp != null ) + declaredFields.put("timestamp", timestamp); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OrderWithTimestamp} instance. If the map previously contained a + * mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final OrderWithTimestamp orderWithTimestamp = (OrderWithTimestamp) o; + return Objects.equals(this.cloudSdkCustomFields, orderWithTimestamp.cloudSdkCustomFields) + && Objects.equals(this.productId, orderWithTimestamp.productId) + && Objects.equals(this.quantity, orderWithTimestamp.quantity) + && Objects.equals(this.totalPrice, orderWithTimestamp.totalPrice) + && Objects.equals(this.typelessProperty, orderWithTimestamp.typelessProperty) + && Objects.equals(this.nullableProperty, orderWithTimestamp.nullableProperty) + && Objects.equals(this.timestamp, orderWithTimestamp.timestamp); + } + + @Override + public int hashCode() + { + return Objects + .hash(productId, quantity, totalPrice, typelessProperty, nullableProperty, timestamp, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class OrderWithTimestamp {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" totalPrice: ").append(toIndentedString(totalPrice)).append("\n"); + sb.append(" typelessProperty: ").append(toIndentedString(typelessProperty)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java deleted file mode 100644 index ee970066b..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilterConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * OutputFilterConfig - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = AzureContentSafetyOutputFilterConfig.class ), - @JsonSubTypes.Type( value = LlamaGuard38bFilterConfig.class ), } ) - -public interface OutputFilterConfig -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java deleted file mode 100644 index e36747309..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OutputFilteringConfig.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * OutputFilteringConfig - */ - -@Beta // CHECKSTYLE:OFF -public class OutputFilteringConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "filters" ) - private List filters = new ArrayList<>(); - - @JsonProperty( "stream_options" ) - private FilteringStreamOptions streamOptions; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for OutputFilteringConfig. - */ - protected OutputFilteringConfig() - { - } - - /** - * Set the filters of this {@link OutputFilteringConfig} instance and return the same instance. - * - * @param filters - * Configuration for content filtering services that should be used for the given filtering step (output - * filtering). - * @return The same instance of this {@link OutputFilteringConfig} class - */ - @Nonnull - public OutputFilteringConfig filters( @Nonnull final List filters ) - { - this.filters = filters; - return this; - } - - /** - * Add one filters instance to this {@link OutputFilteringConfig}. - * - * @param filtersItem - * The filters that should be added - * @return The same instance of type {@link OutputFilteringConfig} - */ - @Nonnull - public OutputFilteringConfig addFiltersItem( @Nonnull final OutputFilterConfig filtersItem ) - { - if( this.filters == null ) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - - /** - * Configuration for content filtering services that should be used for the given filtering step (output filtering). - * - * @return filters The filters of this {@link OutputFilteringConfig} instance. - */ - @Nonnull - public List getFilters() - { - return filters; - } - - /** - * Set the filters of this {@link OutputFilteringConfig} instance. - * - * @param filters - * Configuration for content filtering services that should be used for the given filtering step (output - * filtering). - */ - public void setFilters( @Nonnull final List filters ) - { - this.filters = filters; - } - - /** - * Set the streamOptions of this {@link OutputFilteringConfig} instance and return the same instance. - * - * @param streamOptions - * The streamOptions of this {@link OutputFilteringConfig} - * @return The same instance of this {@link OutputFilteringConfig} class - */ - @Nonnull - public OutputFilteringConfig streamOptions( @Nullable final FilteringStreamOptions streamOptions ) - { - this.streamOptions = streamOptions; - return this; - } - - /** - * Get streamOptions - * - * @return streamOptions The streamOptions of this {@link OutputFilteringConfig} instance. - */ - @Nonnull - public FilteringStreamOptions getStreamOptions() - { - return streamOptions; - } - - /** - * Set the streamOptions of this {@link OutputFilteringConfig} instance. - * - * @param streamOptions - * The streamOptions of this {@link OutputFilteringConfig} - */ - public void setStreamOptions( @Nullable final FilteringStreamOptions streamOptions ) - { - this.streamOptions = streamOptions; - } - - /** - * Get the names of the unrecognizable properties of the {@link OutputFilteringConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OutputFilteringConfig} 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("OutputFilteringConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OutputFilteringConfig} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( filters != null ) - declaredFields.put("filters", filters); - if( streamOptions != null ) - declaredFields.put("streamOptions", streamOptions); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OutputFilteringConfig} 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 OutputFilteringConfig outputFilteringConfig = (OutputFilteringConfig) o; - return Objects.equals(this.cloudSdkCustomFields, outputFilteringConfig.cloudSdkCustomFields) - && Objects.equals(this.filters, outputFilteringConfig.filters) - && Objects.equals(this.streamOptions, outputFilteringConfig.streamOptions); - } - - @Override - public int hashCode() - { - return Objects.hash(filters, streamOptions, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class OutputFilteringConfig {\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java deleted file mode 100644 index 3f75bd4e6..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplate.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * PromptTemplate - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = MultiChatTemplate.class ), - @JsonSubTypes.Type( value = SingleChatTemplate.class ), } ) - -public interface PromptTemplate -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java deleted file mode 100644 index 8eab815bf..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateDeleteResponse.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplateDeleteResponse - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplateDeleteResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "message" ) - private String message; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplateDeleteResponse. - */ - protected PromptTemplateDeleteResponse() - { - } - - /** - * Set the message of this {@link PromptTemplateDeleteResponse} instance and return the same instance. - * - * @param message - * The message of this {@link PromptTemplateDeleteResponse} - * @return The same instance of this {@link PromptTemplateDeleteResponse} class - */ - @Nonnull - public PromptTemplateDeleteResponse message( @Nonnull final String message ) - { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link PromptTemplateDeleteResponse} instance. - */ - @Nonnull - public String getMessage() - { - return message; - } - - /** - * Set the message of this {@link PromptTemplateDeleteResponse} instance. - * - * @param message - * The message of this {@link PromptTemplateDeleteResponse} - */ - public void setMessage( @Nonnull final String message ) - { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplateDeleteResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplateDeleteResponse} 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("PromptTemplateDeleteResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplateDeleteResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( message != null ) - declaredFields.put("message", message); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplateDeleteResponse} 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 PromptTemplateDeleteResponse promptTemplateDeleteResponse = (PromptTemplateDeleteResponse) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplateDeleteResponse.cloudSdkCustomFields) - && Objects.equals(this.message, promptTemplateDeleteResponse.message); - } - - @Override - public int hashCode() - { - return Objects.hash(message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplateDeleteResponse {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java deleted file mode 100644 index 62eb8761d..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateGetResponse.java +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplateGetResponse - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplateGetResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "id" ) - private UUID id; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "creationTimestamp" ) - private String creationTimestamp; - - @JsonProperty( "managedBy" ) - private String managedBy; - - @JsonProperty( "isVersionHead" ) - private Boolean isVersionHead; - - @JsonProperty( "resourceGroupId" ) - private String resourceGroupId; - - @JsonProperty( "spec" ) - private PromptTemplateSpec spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplateGetResponse. - */ - protected PromptTemplateGetResponse() - { - } - - /** - * Set the id of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param id - * The id of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse id( @Nullable final UUID id ) - { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public UUID getId() - { - return id; - } - - /** - * Set the id of this {@link PromptTemplateGetResponse} instance. - * - * @param id - * The id of this {@link PromptTemplateGetResponse} - */ - public void setId( @Nullable final UUID id ) - { - this.id = id; - } - - /** - * Set the name of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param name - * The name of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse name( @Nullable final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link PromptTemplateGetResponse} instance. - * - * @param name - * The name of this {@link PromptTemplateGetResponse} - */ - public void setName( @Nullable final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param version - * The version of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse version( @Nullable final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link PromptTemplateGetResponse} instance. - * - * @param version - * The version of this {@link PromptTemplateGetResponse} - */ - public void setVersion( @Nullable final String version ) - { - this.version = version; - } - - /** - * Set the scenario of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse scenario( @Nullable final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link PromptTemplateGetResponse} instance. - * - * @param scenario - * The scenario of this {@link PromptTemplateGetResponse} - */ - public void setScenario( @Nullable final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the creationTimestamp of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param creationTimestamp - * The creationTimestamp of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse creationTimestamp( @Nullable final String creationTimestamp ) - { - this.creationTimestamp = creationTimestamp; - return this; - } - - /** - * Get creationTimestamp - * - * @return creationTimestamp The creationTimestamp of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public String getCreationTimestamp() - { - return creationTimestamp; - } - - /** - * Set the creationTimestamp of this {@link PromptTemplateGetResponse} instance. - * - * @param creationTimestamp - * The creationTimestamp of this {@link PromptTemplateGetResponse} - */ - public void setCreationTimestamp( @Nullable final String creationTimestamp ) - { - this.creationTimestamp = creationTimestamp; - } - - /** - * Set the managedBy of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param managedBy - * The managedBy of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse managedBy( @Nullable final String managedBy ) - { - this.managedBy = managedBy; - return this; - } - - /** - * Get managedBy - * - * @return managedBy The managedBy of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public String getManagedBy() - { - return managedBy; - } - - /** - * Set the managedBy of this {@link PromptTemplateGetResponse} instance. - * - * @param managedBy - * The managedBy of this {@link PromptTemplateGetResponse} - */ - public void setManagedBy( @Nullable final String managedBy ) - { - this.managedBy = managedBy; - } - - /** - * Set the isVersionHead of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param isVersionHead - * The isVersionHead of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse isVersionHead( @Nullable final Boolean isVersionHead ) - { - this.isVersionHead = isVersionHead; - return this; - } - - /** - * Get isVersionHead - * - * @return isVersionHead The isVersionHead of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public Boolean isIsVersionHead() - { - return isVersionHead; - } - - /** - * Set the isVersionHead of this {@link PromptTemplateGetResponse} instance. - * - * @param isVersionHead - * The isVersionHead of this {@link PromptTemplateGetResponse} - */ - public void setIsVersionHead( @Nullable final Boolean isVersionHead ) - { - this.isVersionHead = isVersionHead; - } - - /** - * Set the resourceGroupId of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param resourceGroupId - * The resourceGroupId of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse resourceGroupId( @Nullable final String resourceGroupId ) - { - this.resourceGroupId = resourceGroupId; - return this; - } - - /** - * Get resourceGroupId - * - * @return resourceGroupId The resourceGroupId of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public String getResourceGroupId() - { - return resourceGroupId; - } - - /** - * Set the resourceGroupId of this {@link PromptTemplateGetResponse} instance. - * - * @param resourceGroupId - * The resourceGroupId of this {@link PromptTemplateGetResponse} - */ - public void setResourceGroupId( @Nullable final String resourceGroupId ) - { - this.resourceGroupId = resourceGroupId; - } - - /** - * Set the spec of this {@link PromptTemplateGetResponse} instance and return the same instance. - * - * @param spec - * The spec of this {@link PromptTemplateGetResponse} - * @return The same instance of this {@link PromptTemplateGetResponse} class - */ - @Nonnull - public PromptTemplateGetResponse spec( @Nullable final PromptTemplateSpec spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link PromptTemplateGetResponse} instance. - */ - @Nonnull - public PromptTemplateSpec getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link PromptTemplateGetResponse} instance. - * - * @param spec - * The spec of this {@link PromptTemplateGetResponse} - */ - public void setSpec( @Nullable final PromptTemplateSpec spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplateGetResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplateGetResponse} 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("PromptTemplateGetResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplateGetResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( id != null ) - declaredFields.put("id", id); - if( name != null ) - declaredFields.put("name", name); - if( version != null ) - declaredFields.put("version", version); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( creationTimestamp != null ) - declaredFields.put("creationTimestamp", creationTimestamp); - if( managedBy != null ) - declaredFields.put("managedBy", managedBy); - if( isVersionHead != null ) - declaredFields.put("isVersionHead", isVersionHead); - if( resourceGroupId != null ) - declaredFields.put("resourceGroupId", resourceGroupId); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplateGetResponse} 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 PromptTemplateGetResponse promptTemplateGetResponse = (PromptTemplateGetResponse) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplateGetResponse.cloudSdkCustomFields) - && Objects.equals(this.id, promptTemplateGetResponse.id) - && Objects.equals(this.name, promptTemplateGetResponse.name) - && Objects.equals(this.version, promptTemplateGetResponse.version) - && Objects.equals(this.scenario, promptTemplateGetResponse.scenario) - && Objects.equals(this.creationTimestamp, promptTemplateGetResponse.creationTimestamp) - && Objects.equals(this.managedBy, promptTemplateGetResponse.managedBy) - && Objects.equals(this.isVersionHead, promptTemplateGetResponse.isVersionHead) - && Objects.equals(this.resourceGroupId, promptTemplateGetResponse.resourceGroupId) - && Objects.equals(this.spec, promptTemplateGetResponse.spec); - } - - @Override - public int hashCode() - { - return Objects - .hash( - id, - name, - version, - scenario, - creationTimestamp, - managedBy, - isVersionHead, - resourceGroupId, - spec, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplateGetResponse {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); - sb.append(" managedBy: ").append(toIndentedString(managedBy)).append("\n"); - sb.append(" isVersionHead: ").append(toIndentedString(isVersionHead)).append("\n"); - sb.append(" resourceGroupId: ").append(toIndentedString(resourceGroupId)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java deleted file mode 100644 index 52fb91df9..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateListResponse.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplateListResponse - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplateListResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "count" ) - private Integer count; - - @JsonProperty( "resources" ) - private List resources = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplateListResponse. - */ - protected PromptTemplateListResponse() - { - } - - /** - * Set the count of this {@link PromptTemplateListResponse} instance and return the same instance. - * - * @param count - * The count of this {@link PromptTemplateListResponse} - * @return The same instance of this {@link PromptTemplateListResponse} class - */ - @Nonnull - public PromptTemplateListResponse count( @Nonnull final Integer count ) - { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link PromptTemplateListResponse} instance. - */ - @Nonnull - public Integer getCount() - { - return count; - } - - /** - * Set the count of this {@link PromptTemplateListResponse} instance. - * - * @param count - * The count of this {@link PromptTemplateListResponse} - */ - public void setCount( @Nonnull final Integer count ) - { - this.count = count; - } - - /** - * Set the resources of this {@link PromptTemplateListResponse} instance and return the same instance. - * - * @param resources - * The resources of this {@link PromptTemplateListResponse} - * @return The same instance of this {@link PromptTemplateListResponse} class - */ - @Nonnull - public PromptTemplateListResponse resources( @Nonnull final List resources ) - { - this.resources = resources; - return this; - } - - /** - * Add one resources instance to this {@link PromptTemplateListResponse}. - * - * @param resourcesItem - * The resources that should be added - * @return The same instance of type {@link PromptTemplateListResponse} - */ - @Nonnull - public PromptTemplateListResponse addResourcesItem( @Nonnull final PromptTemplateGetResponse resourcesItem ) - { - if( this.resources == null ) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * - * @return resources The resources of this {@link PromptTemplateListResponse} instance. - */ - @Nonnull - public List getResources() - { - return resources; - } - - /** - * Set the resources of this {@link PromptTemplateListResponse} instance. - * - * @param resources - * The resources of this {@link PromptTemplateListResponse} - */ - public void setResources( @Nonnull final List resources ) - { - this.resources = resources; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplateListResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplateListResponse} 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("PromptTemplateListResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplateListResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( count != null ) - declaredFields.put("count", count); - if( resources != null ) - declaredFields.put("resources", resources); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplateListResponse} 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 PromptTemplateListResponse promptTemplateListResponse = (PromptTemplateListResponse) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplateListResponse.cloudSdkCustomFields) - && Objects.equals(this.count, promptTemplateListResponse.count) - && Objects.equals(this.resources, promptTemplateListResponse.resources); - } - - @Override - public int hashCode() - { - return Objects.hash(count, resources, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplateListResponse {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java deleted file mode 100644 index dde36cd5d..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostRequest.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplatePostRequest - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplatePostRequest -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "spec" ) - private PromptTemplateSpec spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplatePostRequest. - */ - protected PromptTemplatePostRequest() - { - } - - /** - * Set the name of this {@link PromptTemplatePostRequest} instance and return the same instance. - * - * @param name - * The name of this {@link PromptTemplatePostRequest} - * @return The same instance of this {@link PromptTemplatePostRequest} class - */ - @Nonnull - public PromptTemplatePostRequest name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link PromptTemplatePostRequest} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link PromptTemplatePostRequest} instance. - * - * @param name - * The name of this {@link PromptTemplatePostRequest} - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link PromptTemplatePostRequest} instance and return the same instance. - * - * @param version - * The version of this {@link PromptTemplatePostRequest} - * @return The same instance of this {@link PromptTemplatePostRequest} class - */ - @Nonnull - public PromptTemplatePostRequest version( @Nonnull final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link PromptTemplatePostRequest} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link PromptTemplatePostRequest} instance. - * - * @param version - * The version of this {@link PromptTemplatePostRequest} - */ - public void setVersion( @Nonnull final String version ) - { - this.version = version; - } - - /** - * Set the scenario of this {@link PromptTemplatePostRequest} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link PromptTemplatePostRequest} - * @return The same instance of this {@link PromptTemplatePostRequest} class - */ - @Nonnull - public PromptTemplatePostRequest scenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link PromptTemplatePostRequest} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link PromptTemplatePostRequest} instance. - * - * @param scenario - * The scenario of this {@link PromptTemplatePostRequest} - */ - public void setScenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the spec of this {@link PromptTemplatePostRequest} instance and return the same instance. - * - * @param spec - * The spec of this {@link PromptTemplatePostRequest} - * @return The same instance of this {@link PromptTemplatePostRequest} class - */ - @Nonnull - public PromptTemplatePostRequest spec( @Nonnull final PromptTemplateSpec spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link PromptTemplatePostRequest} instance. - */ - @Nonnull - public PromptTemplateSpec getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link PromptTemplatePostRequest} instance. - * - * @param spec - * The spec of this {@link PromptTemplatePostRequest} - */ - public void setSpec( @Nonnull final PromptTemplateSpec spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplatePostRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplatePostRequest} 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("PromptTemplatePostRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplatePostRequest} 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( version != null ) - declaredFields.put("version", version); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplatePostRequest} 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 PromptTemplatePostRequest promptTemplatePostRequest = (PromptTemplatePostRequest) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplatePostRequest.cloudSdkCustomFields) - && Objects.equals(this.name, promptTemplatePostRequest.name) - && Objects.equals(this.version, promptTemplatePostRequest.version) - && Objects.equals(this.scenario, promptTemplatePostRequest.scenario) - && Objects.equals(this.spec, promptTemplatePostRequest.spec); - } - - @Override - public int hashCode() - { - return Objects.hash(name, version, scenario, spec, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplatePostRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java deleted file mode 100644 index 11507bb3f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatePostResponse.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import java.util.UUID; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplatePostResponse - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplatePostResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "message" ) - private String message; - - @JsonProperty( "id" ) - private UUID id; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplatePostResponse. - */ - protected PromptTemplatePostResponse() - { - } - - /** - * Set the message of this {@link PromptTemplatePostResponse} instance and return the same instance. - * - * @param message - * The message of this {@link PromptTemplatePostResponse} - * @return The same instance of this {@link PromptTemplatePostResponse} class - */ - @Nonnull - public PromptTemplatePostResponse message( @Nonnull final String message ) - { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link PromptTemplatePostResponse} instance. - */ - @Nonnull - public String getMessage() - { - return message; - } - - /** - * Set the message of this {@link PromptTemplatePostResponse} instance. - * - * @param message - * The message of this {@link PromptTemplatePostResponse} - */ - public void setMessage( @Nonnull final String message ) - { - this.message = message; - } - - /** - * Set the id of this {@link PromptTemplatePostResponse} instance and return the same instance. - * - * @param id - * The id of this {@link PromptTemplatePostResponse} - * @return The same instance of this {@link PromptTemplatePostResponse} class - */ - @Nonnull - public PromptTemplatePostResponse id( @Nonnull final UUID id ) - { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link PromptTemplatePostResponse} instance. - */ - @Nonnull - public UUID getId() - { - return id; - } - - /** - * Set the id of this {@link PromptTemplatePostResponse} instance. - * - * @param id - * The id of this {@link PromptTemplatePostResponse} - */ - public void setId( @Nonnull final UUID id ) - { - this.id = id; - } - - /** - * Set the scenario of this {@link PromptTemplatePostResponse} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link PromptTemplatePostResponse} - * @return The same instance of this {@link PromptTemplatePostResponse} class - */ - @Nonnull - public PromptTemplatePostResponse scenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link PromptTemplatePostResponse} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link PromptTemplatePostResponse} instance. - * - * @param scenario - * The scenario of this {@link PromptTemplatePostResponse} - */ - public void setScenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the name of this {@link PromptTemplatePostResponse} instance and return the same instance. - * - * @param name - * The name of this {@link PromptTemplatePostResponse} - * @return The same instance of this {@link PromptTemplatePostResponse} class - */ - @Nonnull - public PromptTemplatePostResponse name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link PromptTemplatePostResponse} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link PromptTemplatePostResponse} instance. - * - * @param name - * The name of this {@link PromptTemplatePostResponse} - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link PromptTemplatePostResponse} instance and return the same instance. - * - * @param version - * The version of this {@link PromptTemplatePostResponse} - * @return The same instance of this {@link PromptTemplatePostResponse} class - */ - @Nonnull - public PromptTemplatePostResponse version( @Nonnull final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link PromptTemplatePostResponse} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link PromptTemplatePostResponse} instance. - * - * @param version - * The version of this {@link PromptTemplatePostResponse} - */ - public void setVersion( @Nonnull final String version ) - { - this.version = version; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplatePostResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplatePostResponse} 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("PromptTemplatePostResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplatePostResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( message != null ) - declaredFields.put("message", message); - if( id != null ) - declaredFields.put("id", id); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( name != null ) - declaredFields.put("name", name); - if( version != null ) - declaredFields.put("version", version); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplatePostResponse} 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 PromptTemplatePostResponse promptTemplatePostResponse = (PromptTemplatePostResponse) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplatePostResponse.cloudSdkCustomFields) - && Objects.equals(this.message, promptTemplatePostResponse.message) - && Objects.equals(this.id, promptTemplatePostResponse.id) - && Objects.equals(this.scenario, promptTemplatePostResponse.scenario) - && Objects.equals(this.name, promptTemplatePostResponse.name) - && Objects.equals(this.version, promptTemplatePostResponse.version); - } - - @Override - public int hashCode() - { - return Objects.hash(message, id, scenario, name, version, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplatePostResponse {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java deleted file mode 100644 index fc354f94c..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpec.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplateSpec - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplateSpec -// CHECKSTYLE:ON -{ - @JsonProperty( "template" ) - private List template = new ArrayList<>(); - - @JsonProperty( "defaults" ) - private Object defaults; - - @JsonProperty( "additionalFields" ) - private Object additionalFields; - - @JsonProperty( "response_format" ) - private PromptTemplateSpecResponseFormat responseFormat; - - @JsonProperty( "tools" ) - private List tools = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplateSpec. - */ - protected PromptTemplateSpec() - { - } - - /** - * Set the template of this {@link PromptTemplateSpec} instance and return the same instance. - * - * @param template - * The template of this {@link PromptTemplateSpec} - * @return The same instance of this {@link PromptTemplateSpec} class - */ - @Nonnull - public PromptTemplateSpec template( @Nonnull final List template ) - { - this.template = template; - return this; - } - - /** - * Add one template instance to this {@link PromptTemplateSpec}. - * - * @param templateItem - * The template that should be added - * @return The same instance of type {@link PromptTemplateSpec} - */ - @Nonnull - public PromptTemplateSpec addTemplateItem( @Nonnull final PromptTemplate templateItem ) - { - if( this.template == null ) { - this.template = new ArrayList<>(); - } - this.template.add(templateItem); - return this; - } - - /** - * Get template - * - * @return template The template of this {@link PromptTemplateSpec} instance. - */ - @Nonnull - public List getTemplate() - { - return template; - } - - /** - * Set the template of this {@link PromptTemplateSpec} instance. - * - * @param template - * The template of this {@link PromptTemplateSpec} - */ - public void setTemplate( @Nonnull final List template ) - { - this.template = template; - } - - /** - * Set the defaults of this {@link PromptTemplateSpec} instance and return the same instance. - * - * @param defaults - * The defaults of this {@link PromptTemplateSpec} - * @return The same instance of this {@link PromptTemplateSpec} class - */ - @Nonnull - public PromptTemplateSpec defaults( @Nullable final Object defaults ) - { - this.defaults = defaults; - return this; - } - - /** - * Get defaults - * - * @return defaults The defaults of this {@link PromptTemplateSpec} instance. - */ - @Nonnull - public Object getDefaults() - { - return defaults; - } - - /** - * Set the defaults of this {@link PromptTemplateSpec} instance. - * - * @param defaults - * The defaults of this {@link PromptTemplateSpec} - */ - public void setDefaults( @Nullable final Object defaults ) - { - this.defaults = defaults; - } - - /** - * Set the additionalFields of this {@link PromptTemplateSpec} instance and return the same instance. - * - * @param additionalFields - * DEPRECATED. Please use additional_fields instead. - * @return The same instance of this {@link PromptTemplateSpec} class - */ - @Nonnull - public PromptTemplateSpec additionalFields( @Nullable final Object additionalFields ) - { - this.additionalFields = additionalFields; - return this; - } - - /** - * DEPRECATED. Please use additional_fields instead. - * - * @return additionalFields The additionalFields of this {@link PromptTemplateSpec} instance. - * @deprecated - */ - @Deprecated - @Nonnull - public Object getAdditionalFields() - { - return additionalFields; - } - - /** - * Set the additionalFields of this {@link PromptTemplateSpec} instance. - * - * @param additionalFields - * DEPRECATED. Please use additional_fields instead. - */ - public void setAdditionalFields( @Nullable final Object additionalFields ) - { - this.additionalFields = additionalFields; - } - - /** - * Set the responseFormat of this {@link PromptTemplateSpec} instance and return the same instance. - * - * @param responseFormat - * The responseFormat of this {@link PromptTemplateSpec} - * @return The same instance of this {@link PromptTemplateSpec} class - */ - @Nonnull - public PromptTemplateSpec responseFormat( @Nullable final PromptTemplateSpecResponseFormat responseFormat ) - { - this.responseFormat = responseFormat; - return this; - } - - /** - * Get responseFormat - * - * @return responseFormat The responseFormat of this {@link PromptTemplateSpec} instance. - */ - @Nonnull - public PromptTemplateSpecResponseFormat getResponseFormat() - { - return responseFormat; - } - - /** - * Set the responseFormat of this {@link PromptTemplateSpec} instance. - * - * @param responseFormat - * The responseFormat of this {@link PromptTemplateSpec} - */ - public void setResponseFormat( @Nullable final PromptTemplateSpecResponseFormat responseFormat ) - { - this.responseFormat = responseFormat; - } - - /** - * Set the tools of this {@link PromptTemplateSpec} instance and return the same instance. - * - * @param tools - * A list of tools the model may call. Used to provide a list of functions the model may generate JSON - * inputs for. This is the same as the OpenAI definition. - * @return The same instance of this {@link PromptTemplateSpec} class - */ - @Nonnull - public PromptTemplateSpec tools( @Nullable final List tools ) - { - this.tools = tools; - return this; - } - - /** - * Add one tools instance to this {@link PromptTemplateSpec}. - * - * @param toolsItem - * The tools that should be added - * @return The same instance of type {@link PromptTemplateSpec} - */ - @Nonnull - public PromptTemplateSpec addToolsItem( @Nonnull final ChatCompletionTool toolsItem ) - { - if( this.tools == null ) { - this.tools = new ArrayList<>(); - } - this.tools.add(toolsItem); - return this; - } - - /** - * A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. - * This is the same as the OpenAI definition. - * - * @return tools The tools of this {@link PromptTemplateSpec} instance. - */ - @Nonnull - public List getTools() - { - return tools; - } - - /** - * Set the tools of this {@link PromptTemplateSpec} instance. - * - * @param tools - * A list of tools the model may call. Used to provide a list of functions the model may generate JSON - * inputs for. This is the same as the OpenAI definition. - */ - public void setTools( @Nullable final List tools ) - { - this.tools = tools; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplateSpec}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplateSpec} 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("PromptTemplateSpec has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplateSpec} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( template != null ) - declaredFields.put("template", template); - if( defaults != null ) - declaredFields.put("defaults", defaults); - if( additionalFields != null ) - declaredFields.put("additionalFields", additionalFields); - if( responseFormat != null ) - declaredFields.put("responseFormat", responseFormat); - if( tools != null ) - declaredFields.put("tools", tools); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplateSpec} 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 PromptTemplateSpec promptTemplateSpec = (PromptTemplateSpec) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplateSpec.cloudSdkCustomFields) - && Objects.equals(this.template, promptTemplateSpec.template) - && Objects.equals(this.defaults, promptTemplateSpec.defaults) - && Objects.equals(this.additionalFields, promptTemplateSpec.additionalFields) - && Objects.equals(this.responseFormat, promptTemplateSpec.responseFormat) - && Objects.equals(this.tools, promptTemplateSpec.tools); - } - - @Override - public int hashCode() - { - return Objects.hash(template, defaults, additionalFields, responseFormat, tools, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplateSpec {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); - sb.append(" additionalFields: ").append(toIndentedString(additionalFields)).append("\n"); - sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n"); - sb.append(" tools: ").append(toIndentedString(tools)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java deleted file mode 100644 index 0472f96ec..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSpecResponseFormat.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * Response format that the model output should adhere to. This is the same as the OpenAI definition. Compatible with - * GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = ResponseFormatJsonObject.class ), - @JsonSubTypes.Type( value = ResponseFormatJsonSchema.class ), - @JsonSubTypes.Type( value = ResponseFormatText.class ), } ) - -public interface PromptTemplateSpecResponseFormat -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java deleted file mode 100644 index dbd20f8ba..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionRequest.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplateSubstitutionRequest - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplateSubstitutionRequest -// CHECKSTYLE:ON -{ - @JsonProperty( "inputParams" ) - private Object inputParams; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplateSubstitutionRequest. - */ - protected PromptTemplateSubstitutionRequest() - { - } - - /** - * Set the inputParams of this {@link PromptTemplateSubstitutionRequest} instance and return the same instance. - * - * @param inputParams - * The inputParams of this {@link PromptTemplateSubstitutionRequest} - * @return The same instance of this {@link PromptTemplateSubstitutionRequest} class - */ - @Nonnull - public PromptTemplateSubstitutionRequest inputParams( @Nullable final Object inputParams ) - { - this.inputParams = inputParams; - return this; - } - - /** - * Get inputParams - * - * @return inputParams The inputParams of this {@link PromptTemplateSubstitutionRequest} instance. - */ - @Nonnull - public Object getInputParams() - { - return inputParams; - } - - /** - * Set the inputParams of this {@link PromptTemplateSubstitutionRequest} instance. - * - * @param inputParams - * The inputParams of this {@link PromptTemplateSubstitutionRequest} - */ - public void setInputParams( @Nullable final Object inputParams ) - { - this.inputParams = inputParams; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplateSubstitutionRequest}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplateSubstitutionRequest} 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( - "PromptTemplateSubstitutionRequest has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplateSubstitutionRequest} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( inputParams != null ) - declaredFields.put("inputParams", inputParams); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplateSubstitutionRequest} 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 PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest = - (PromptTemplateSubstitutionRequest) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplateSubstitutionRequest.cloudSdkCustomFields) - && Objects.equals(this.inputParams, promptTemplateSubstitutionRequest.inputParams); - } - - @Override - public int hashCode() - { - return Objects.hash(inputParams, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplateSubstitutionRequest {\n"); - sb.append(" inputParams: ").append(toIndentedString(inputParams)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java deleted file mode 100644 index dcf52de93..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplateSubstitutionResponse.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplateSubstitutionResponse - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplateSubstitutionResponse -// CHECKSTYLE:ON -{ - @JsonProperty( "parsedPrompt" ) - private List parsedPrompt = new ArrayList<>(); - - @JsonProperty( "resource" ) - private PromptTemplateGetResponse resource; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplateSubstitutionResponse. - */ - protected PromptTemplateSubstitutionResponse() - { - } - - /** - * Set the parsedPrompt of this {@link PromptTemplateSubstitutionResponse} instance and return the same instance. - * - * @param parsedPrompt - * The parsedPrompt of this {@link PromptTemplateSubstitutionResponse} - * @return The same instance of this {@link PromptTemplateSubstitutionResponse} class - */ - @Nonnull - public PromptTemplateSubstitutionResponse parsedPrompt( @Nullable final List parsedPrompt ) - { - this.parsedPrompt = parsedPrompt; - return this; - } - - /** - * Add one parsedPrompt instance to this {@link PromptTemplateSubstitutionResponse}. - * - * @param parsedPromptItem - * The parsedPrompt that should be added - * @return The same instance of type {@link PromptTemplateSubstitutionResponse} - */ - @Nonnull - public PromptTemplateSubstitutionResponse addParsedPromptItem( @Nonnull final PromptTemplate parsedPromptItem ) - { - if( this.parsedPrompt == null ) { - this.parsedPrompt = new ArrayList<>(); - } - this.parsedPrompt.add(parsedPromptItem); - return this; - } - - /** - * Get parsedPrompt - * - * @return parsedPrompt The parsedPrompt of this {@link PromptTemplateSubstitutionResponse} instance. - */ - @Nonnull - public List getParsedPrompt() - { - return parsedPrompt; - } - - /** - * Set the parsedPrompt of this {@link PromptTemplateSubstitutionResponse} instance. - * - * @param parsedPrompt - * The parsedPrompt of this {@link PromptTemplateSubstitutionResponse} - */ - public void setParsedPrompt( @Nullable final List parsedPrompt ) - { - this.parsedPrompt = parsedPrompt; - } - - /** - * Set the resource of this {@link PromptTemplateSubstitutionResponse} instance and return the same instance. - * - * @param resource - * The resource of this {@link PromptTemplateSubstitutionResponse} - * @return The same instance of this {@link PromptTemplateSubstitutionResponse} class - */ - @Nonnull - public PromptTemplateSubstitutionResponse resource( @Nullable final PromptTemplateGetResponse resource ) - { - this.resource = resource; - return this; - } - - /** - * Get resource - * - * @return resource The resource of this {@link PromptTemplateSubstitutionResponse} instance. - */ - @Nonnull - public PromptTemplateGetResponse getResource() - { - return resource; - } - - /** - * Set the resource of this {@link PromptTemplateSubstitutionResponse} instance. - * - * @param resource - * The resource of this {@link PromptTemplateSubstitutionResponse} - */ - public void setResource( @Nullable final PromptTemplateGetResponse resource ) - { - this.resource = resource; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplateSubstitutionResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplateSubstitutionResponse} 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( - "PromptTemplateSubstitutionResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplateSubstitutionResponse} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( parsedPrompt != null ) - declaredFields.put("parsedPrompt", parsedPrompt); - if( resource != null ) - declaredFields.put("resource", resource); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplateSubstitutionResponse} 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 PromptTemplateSubstitutionResponse promptTemplateSubstitutionResponse = - (PromptTemplateSubstitutionResponse) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplateSubstitutionResponse.cloudSdkCustomFields) - && Objects.equals(this.parsedPrompt, promptTemplateSubstitutionResponse.parsedPrompt) - && Objects.equals(this.resource, promptTemplateSubstitutionResponse.resource); - } - - @Override - public int hashCode() - { - return Objects.hash(parsedPrompt, resource, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplateSubstitutionResponse {\n"); - sb.append(" parsedPrompt: ").append(toIndentedString(parsedPrompt)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java deleted file mode 100644 index 926da7f49..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfig.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * PromptTemplatingModuleConfig - */ - -@Beta // CHECKSTYLE:OFF -public class PromptTemplatingModuleConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "prompt" ) - private PromptTemplatingModuleConfigPrompt prompt; - - @JsonProperty( "model" ) - private LLMModelDetails model; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for PromptTemplatingModuleConfig. - */ - protected PromptTemplatingModuleConfig() - { - } - - /** - * Set the prompt of this {@link PromptTemplatingModuleConfig} instance and return the same instance. - * - * @param prompt - * The prompt of this {@link PromptTemplatingModuleConfig} - * @return The same instance of this {@link PromptTemplatingModuleConfig} class - */ - @Nonnull - public PromptTemplatingModuleConfig prompt( @Nonnull final PromptTemplatingModuleConfigPrompt prompt ) - { - this.prompt = prompt; - return this; - } - - /** - * Get prompt - * - * @return prompt The prompt of this {@link PromptTemplatingModuleConfig} instance. - */ - @Nonnull - public PromptTemplatingModuleConfigPrompt getPrompt() - { - return prompt; - } - - /** - * Set the prompt of this {@link PromptTemplatingModuleConfig} instance. - * - * @param prompt - * The prompt of this {@link PromptTemplatingModuleConfig} - */ - public void setPrompt( @Nonnull final PromptTemplatingModuleConfigPrompt prompt ) - { - this.prompt = prompt; - } - - /** - * Set the model of this {@link PromptTemplatingModuleConfig} instance and return the same instance. - * - * @param model - * The model of this {@link PromptTemplatingModuleConfig} - * @return The same instance of this {@link PromptTemplatingModuleConfig} class - */ - @Nonnull - public PromptTemplatingModuleConfig model( @Nonnull final LLMModelDetails model ) - { - this.model = model; - return this; - } - - /** - * Get model - * - * @return model The model of this {@link PromptTemplatingModuleConfig} instance. - */ - @Nonnull - public LLMModelDetails getModel() - { - return model; - } - - /** - * Set the model of this {@link PromptTemplatingModuleConfig} instance. - * - * @param model - * The model of this {@link PromptTemplatingModuleConfig} - */ - public void setModel( @Nonnull final LLMModelDetails model ) - { - this.model = model; - } - - /** - * Get the names of the unrecognizable properties of the {@link PromptTemplatingModuleConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PromptTemplatingModuleConfig} 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("PromptTemplatingModuleConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PromptTemplatingModuleConfig} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( prompt != null ) - declaredFields.put("prompt", prompt); - if( model != null ) - declaredFields.put("model", model); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PromptTemplatingModuleConfig} 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 PromptTemplatingModuleConfig promptTemplatingModuleConfig = (PromptTemplatingModuleConfig) o; - return Objects.equals(this.cloudSdkCustomFields, promptTemplatingModuleConfig.cloudSdkCustomFields) - && Objects.equals(this.prompt, promptTemplatingModuleConfig.prompt) - && Objects.equals(this.model, promptTemplatingModuleConfig.model); - } - - @Override - public int hashCode() - { - return Objects.hash(prompt, model, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class PromptTemplatingModuleConfig {\n"); - sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); - sb.append(" model: ").append(toIndentedString(model)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java deleted file mode 100644 index 63cdc26e7..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/PromptTemplatingModuleConfigPrompt.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt - * registry. - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { @JsonSubTypes.Type( value = Template.class ), @JsonSubTypes.Type( value = TemplateRef.class ), } ) - -public interface PromptTemplatingModuleConfigPrompt -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java deleted file mode 100644 index f43b74801..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchema.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * ResponseFormatJsonSchema - */ - -@Beta // CHECKSTYLE:OFF -public class ResponseFormatJsonSchema implements PromptTemplateSpecResponseFormat, TemplateResponseFormat -// CHECKSTYLE:ON -{ - /** - * The type of response format being defined: `json_schema` - */ - public enum TypeEnum - { - /** - * The JSON_SCHEMA option of this ResponseFormatJsonSchema - */ - JSON_SCHEMA("json_schema"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatJsonSchema - */ - 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 ResponseFormatJsonSchema - */ - @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( "json_schema" ) - private ResponseFormatJsonSchemaJsonSchema jsonSchema; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ResponseFormatJsonSchema. - */ - protected ResponseFormatJsonSchema() - { - } - - /** - * Set the type of this {@link ResponseFormatJsonSchema} instance and return the same instance. - * - * @param type - * The type of response format being defined: `json_schema` - * @return The same instance of this {@link ResponseFormatJsonSchema} class - */ - @Nonnull - public ResponseFormatJsonSchema type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * The type of response format being defined: `json_schema` - * - * @return type The type of this {@link ResponseFormatJsonSchema} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link ResponseFormatJsonSchema} instance. - * - * @param type - * The type of response format being defined: `json_schema` - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance and return the same instance. - * - * @param jsonSchema - * The jsonSchema of this {@link ResponseFormatJsonSchema} - * @return The same instance of this {@link ResponseFormatJsonSchema} class - */ - @Nonnull - public ResponseFormatJsonSchema jsonSchema( @Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema ) - { - this.jsonSchema = jsonSchema; - return this; - } - - /** - * Get jsonSchema - * - * @return jsonSchema The jsonSchema of this {@link ResponseFormatJsonSchema} instance. - */ - @Nonnull - public ResponseFormatJsonSchemaJsonSchema getJsonSchema() - { - return jsonSchema; - } - - /** - * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance. - * - * @param jsonSchema - * The jsonSchema of this {@link ResponseFormatJsonSchema} - */ - public void setJsonSchema( @Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema ) - { - this.jsonSchema = jsonSchema; - } - - /** - * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonSchema}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchema} 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("ResponseFormatJsonSchema has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ResponseFormatJsonSchema} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( jsonSchema != null ) - declaredFields.put("jsonSchema", jsonSchema); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ResponseFormatJsonSchema} 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 ResponseFormatJsonSchema responseFormatJsonSchema = (ResponseFormatJsonSchema) o; - return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonSchema.cloudSdkCustomFields) - && Objects.equals(this.type, responseFormatJsonSchema.type) - && Objects.equals(this.jsonSchema, responseFormatJsonSchema.jsonSchema); - } - - @Override - public int hashCode() - { - return Objects.hash(type, jsonSchema, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ResponseFormatJsonSchema {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java deleted file mode 100644 index 37f9ed0c9..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ResponseFormatJsonSchemaJsonSchema.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * ResponseFormatJsonSchemaJsonSchema - */ - -@Beta // CHECKSTYLE:OFF -public class ResponseFormatJsonSchemaJsonSchema -// CHECKSTYLE:ON -{ - @JsonProperty( "description" ) - private String description; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "schema" ) - private Map schema = new HashMap<>(); - - @JsonProperty( "strict" ) - private Boolean strict = false; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ResponseFormatJsonSchemaJsonSchema. - */ - protected ResponseFormatJsonSchemaJsonSchema() - { - } - - /** - * Set the description of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. - * - * @param description - * A description of what the response format is for, used by the model to determine how to respond in the - * format. - * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class - */ - @Nonnull - public ResponseFormatJsonSchemaJsonSchema description( @Nullable final String description ) - { - this.description = description; - return this; - } - - /** - * A description of what the response format is for, used by the model to determine how to respond in the format. - * - * @return description The description of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - */ - @Nonnull - public String getDescription() - { - return description; - } - - /** - * Set the description of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - * - * @param description - * A description of what the response format is for, used by the model to determine how to respond in the - * format. - */ - public void setDescription( @Nullable final String description ) - { - this.description = description; - } - - /** - * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. - * - * @param name - * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a - * maximum length of 64. - * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class - */ - @Nonnull - public ResponseFormatJsonSchemaJsonSchema name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length - * of 64. - * - * @return name The name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - * - * @param name - * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a - * maximum length of 64. - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. - * - * @param schema - * The schema for the response format, described as a JSON Schema object. - * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class - */ - @Nonnull - public ResponseFormatJsonSchemaJsonSchema schema( @Nullable final Map schema ) - { - this.schema = schema; - return this; - } - - /** - * Put one schema instance to this {@link ResponseFormatJsonSchemaJsonSchema} instance. - * - * @param key - * The String key of this schema instance - * @param schemaItem - * The schema that should be added under the given key - * @return The same instance of type {@link ResponseFormatJsonSchemaJsonSchema} - */ - @Nonnull - public - ResponseFormatJsonSchemaJsonSchema - putschemaItem( @Nonnull final String key, @Nullable final Object schemaItem ) - { - if( this.schema == null ) { - this.schema = new HashMap<>(); - } - this.schema.put(key, schemaItem); - return this; - } - - /** - * The schema for the response format, described as a JSON Schema object. - * - * @return schema The schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - */ - @Nonnull - public Map getSchema() - { - return schema; - } - - /** - * Set the schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - * - * @param schema - * The schema for the response format, described as a JSON Schema object. - */ - public void setSchema( @Nullable final Map schema ) - { - this.schema = schema; - } - - /** - * Set the strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same instance. - * - * @param strict - * Whether to enable strict schema adherence when generating the output. If set to true, the model will - * always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema - * is supported when `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). - * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class - */ - @Nonnull - public ResponseFormatJsonSchemaJsonSchema strict( @Nullable final Boolean strict ) - { - this.strict = strict; - return this; - } - - /** - * Whether to enable strict schema adherence when generating the output. If set to true, the model will always - * follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when - * `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). - * - * @return strict The strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - */ - @Nullable - public Boolean isStrict() - { - return strict; - } - - /** - * Set the strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance. - * - * @param strict - * Whether to enable strict schema adherence when generating the output. If set to true, the model will - * always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema - * is supported when `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). - */ - public void setStrict( @Nullable final Boolean strict ) - { - this.strict = strict; - } - - /** - * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonSchemaJsonSchema}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} 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( - "ResponseFormatJsonSchemaJsonSchema has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ResponseFormatJsonSchemaJsonSchema} 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( name != null ) - declaredFields.put("name", name); - if( schema != null ) - declaredFields.put("schema", schema); - if( strict != null ) - declaredFields.put("strict", strict); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} 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 ResponseFormatJsonSchemaJsonSchema responseFormatJsonSchemaJsonSchema = - (ResponseFormatJsonSchemaJsonSchema) o; - return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonSchemaJsonSchema.cloudSdkCustomFields) - && Objects.equals(this.description, responseFormatJsonSchemaJsonSchema.description) - && Objects.equals(this.name, responseFormatJsonSchemaJsonSchema.name) - && Objects.equals(this.schema, responseFormatJsonSchemaJsonSchema.schema) - && Objects.equals(this.strict, responseFormatJsonSchemaJsonSchema.strict); - } - - @Override - public int hashCode() - { - return Objects.hash(description, name, schema, strict, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ResponseFormatJsonSchemaJsonSchema {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); - sb.append(" strict: ").append(toIndentedString(strict)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java deleted file mode 100644 index be9336af5..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimeOrchestrationConfigFile.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * RuntimeOrchestrationConfigFile - */ - -@Beta // CHECKSTYLE:OFF -public class RuntimeOrchestrationConfigFile -// CHECKSTYLE:ON -{ - @JsonProperty( "apiVersion" ) - private String apiVersion; - - @JsonProperty( "kind" ) - private String kind; - - @JsonProperty( "metadata" ) - private RuntimePromptTemplateFileMetadata metadata; - - @JsonProperty( "spec" ) - private OrchestrationConfig spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for RuntimeOrchestrationConfigFile. - */ - protected RuntimeOrchestrationConfigFile() - { - } - - /** - * Set the apiVersion of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. - * - * @param apiVersion - * The apiVersion of this {@link RuntimeOrchestrationConfigFile} - * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class - */ - @Nonnull - public RuntimeOrchestrationConfigFile apiVersion( @Nullable final String apiVersion ) - { - this.apiVersion = apiVersion; - return this; - } - - /** - * Get apiVersion - * - * @return apiVersion The apiVersion of this {@link RuntimeOrchestrationConfigFile} instance. - */ - @Nonnull - public String getApiVersion() - { - return apiVersion; - } - - /** - * Set the apiVersion of this {@link RuntimeOrchestrationConfigFile} instance. - * - * @param apiVersion - * The apiVersion of this {@link RuntimeOrchestrationConfigFile} - */ - public void setApiVersion( @Nullable final String apiVersion ) - { - this.apiVersion = apiVersion; - } - - /** - * Set the kind of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. - * - * @param kind - * The kind of this {@link RuntimeOrchestrationConfigFile} - * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class - */ - @Nonnull - public RuntimeOrchestrationConfigFile kind( @Nullable final String kind ) - { - this.kind = kind; - return this; - } - - /** - * Get kind - * - * @return kind The kind of this {@link RuntimeOrchestrationConfigFile} instance. - */ - @Nonnull - public String getKind() - { - return kind; - } - - /** - * Set the kind of this {@link RuntimeOrchestrationConfigFile} instance. - * - * @param kind - * The kind of this {@link RuntimeOrchestrationConfigFile} - */ - public void setKind( @Nullable final String kind ) - { - this.kind = kind; - } - - /** - * Set the metadata of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. - * - * @param metadata - * The metadata of this {@link RuntimeOrchestrationConfigFile} - * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class - */ - @Nonnull - public RuntimeOrchestrationConfigFile metadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) - { - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link RuntimeOrchestrationConfigFile} instance. - */ - @Nonnull - public RuntimePromptTemplateFileMetadata getMetadata() - { - return metadata; - } - - /** - * Set the metadata of this {@link RuntimeOrchestrationConfigFile} instance. - * - * @param metadata - * The metadata of this {@link RuntimeOrchestrationConfigFile} - */ - public void setMetadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) - { - this.metadata = metadata; - } - - /** - * Set the spec of this {@link RuntimeOrchestrationConfigFile} instance and return the same instance. - * - * @param spec - * The spec of this {@link RuntimeOrchestrationConfigFile} - * @return The same instance of this {@link RuntimeOrchestrationConfigFile} class - */ - @Nonnull - public RuntimeOrchestrationConfigFile spec( @Nullable final OrchestrationConfig spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link RuntimeOrchestrationConfigFile} instance. - */ - @Nonnull - public OrchestrationConfig getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link RuntimeOrchestrationConfigFile} instance. - * - * @param spec - * The spec of this {@link RuntimeOrchestrationConfigFile} - */ - public void setSpec( @Nullable final OrchestrationConfig spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link RuntimeOrchestrationConfigFile}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RuntimeOrchestrationConfigFile} 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("RuntimeOrchestrationConfigFile has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link RuntimeOrchestrationConfigFile} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( apiVersion != null ) - declaredFields.put("apiVersion", apiVersion); - if( kind != null ) - declaredFields.put("kind", kind); - if( metadata != null ) - declaredFields.put("metadata", metadata); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link RuntimeOrchestrationConfigFile} 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 RuntimeOrchestrationConfigFile runtimeOrchestrationConfigFile = (RuntimeOrchestrationConfigFile) o; - return Objects.equals(this.cloudSdkCustomFields, runtimeOrchestrationConfigFile.cloudSdkCustomFields) - && Objects.equals(this.apiVersion, runtimeOrchestrationConfigFile.apiVersion) - && Objects.equals(this.kind, runtimeOrchestrationConfigFile.kind) - && Objects.equals(this.metadata, runtimeOrchestrationConfigFile.metadata) - && Objects.equals(this.spec, runtimeOrchestrationConfigFile.spec); - } - - @Override - public int hashCode() - { - return Objects.hash(apiVersion, kind, metadata, spec, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class RuntimeOrchestrationConfigFile {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java deleted file mode 100644 index e83eb630b..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFile.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * RuntimePromptTemplateFile - */ - -@Beta // CHECKSTYLE:OFF -public class RuntimePromptTemplateFile -// CHECKSTYLE:ON -{ - @JsonProperty( "apiVersion" ) - private String apiVersion; - - @JsonProperty( "kind" ) - private String kind; - - @JsonProperty( "metadata" ) - private RuntimePromptTemplateFileMetadata metadata; - - @JsonProperty( "spec" ) - private PromptTemplateSpec spec; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for RuntimePromptTemplateFile. - */ - protected RuntimePromptTemplateFile() - { - } - - /** - * Set the apiVersion of this {@link RuntimePromptTemplateFile} instance and return the same instance. - * - * @param apiVersion - * The apiVersion of this {@link RuntimePromptTemplateFile} - * @return The same instance of this {@link RuntimePromptTemplateFile} class - */ - @Nonnull - public RuntimePromptTemplateFile apiVersion( @Nullable final String apiVersion ) - { - this.apiVersion = apiVersion; - return this; - } - - /** - * Get apiVersion - * - * @return apiVersion The apiVersion of this {@link RuntimePromptTemplateFile} instance. - */ - @Nonnull - public String getApiVersion() - { - return apiVersion; - } - - /** - * Set the apiVersion of this {@link RuntimePromptTemplateFile} instance. - * - * @param apiVersion - * The apiVersion of this {@link RuntimePromptTemplateFile} - */ - public void setApiVersion( @Nullable final String apiVersion ) - { - this.apiVersion = apiVersion; - } - - /** - * Set the kind of this {@link RuntimePromptTemplateFile} instance and return the same instance. - * - * @param kind - * The kind of this {@link RuntimePromptTemplateFile} - * @return The same instance of this {@link RuntimePromptTemplateFile} class - */ - @Nonnull - public RuntimePromptTemplateFile kind( @Nullable final String kind ) - { - this.kind = kind; - return this; - } - - /** - * Get kind - * - * @return kind The kind of this {@link RuntimePromptTemplateFile} instance. - */ - @Nonnull - public String getKind() - { - return kind; - } - - /** - * Set the kind of this {@link RuntimePromptTemplateFile} instance. - * - * @param kind - * The kind of this {@link RuntimePromptTemplateFile} - */ - public void setKind( @Nullable final String kind ) - { - this.kind = kind; - } - - /** - * Set the metadata of this {@link RuntimePromptTemplateFile} instance and return the same instance. - * - * @param metadata - * The metadata of this {@link RuntimePromptTemplateFile} - * @return The same instance of this {@link RuntimePromptTemplateFile} class - */ - @Nonnull - public RuntimePromptTemplateFile metadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) - { - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata The metadata of this {@link RuntimePromptTemplateFile} instance. - */ - @Nonnull - public RuntimePromptTemplateFileMetadata getMetadata() - { - return metadata; - } - - /** - * Set the metadata of this {@link RuntimePromptTemplateFile} instance. - * - * @param metadata - * The metadata of this {@link RuntimePromptTemplateFile} - */ - public void setMetadata( @Nullable final RuntimePromptTemplateFileMetadata metadata ) - { - this.metadata = metadata; - } - - /** - * Set the spec of this {@link RuntimePromptTemplateFile} instance and return the same instance. - * - * @param spec - * The spec of this {@link RuntimePromptTemplateFile} - * @return The same instance of this {@link RuntimePromptTemplateFile} class - */ - @Nonnull - public RuntimePromptTemplateFile spec( @Nullable final PromptTemplateSpec spec ) - { - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec The spec of this {@link RuntimePromptTemplateFile} instance. - */ - @Nonnull - public PromptTemplateSpec getSpec() - { - return spec; - } - - /** - * Set the spec of this {@link RuntimePromptTemplateFile} instance. - * - * @param spec - * The spec of this {@link RuntimePromptTemplateFile} - */ - public void setSpec( @Nullable final PromptTemplateSpec spec ) - { - this.spec = spec; - } - - /** - * Get the names of the unrecognizable properties of the {@link RuntimePromptTemplateFile}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RuntimePromptTemplateFile} 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("RuntimePromptTemplateFile has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link RuntimePromptTemplateFile} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( apiVersion != null ) - declaredFields.put("apiVersion", apiVersion); - if( kind != null ) - declaredFields.put("kind", kind); - if( metadata != null ) - declaredFields.put("metadata", metadata); - if( spec != null ) - declaredFields.put("spec", spec); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link RuntimePromptTemplateFile} 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 RuntimePromptTemplateFile runtimePromptTemplateFile = (RuntimePromptTemplateFile) o; - return Objects.equals(this.cloudSdkCustomFields, runtimePromptTemplateFile.cloudSdkCustomFields) - && Objects.equals(this.apiVersion, runtimePromptTemplateFile.apiVersion) - && Objects.equals(this.kind, runtimePromptTemplateFile.kind) - && Objects.equals(this.metadata, runtimePromptTemplateFile.metadata) - && Objects.equals(this.spec, runtimePromptTemplateFile.spec); - } - - @Override - public int hashCode() - { - return Objects.hash(apiVersion, kind, metadata, spec, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class RuntimePromptTemplateFile {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java deleted file mode 100644 index c9aff79ee..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/RuntimePromptTemplateFileMetadata.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * RuntimePromptTemplateFileMetadata - */ - -@Beta // CHECKSTYLE:OFF -public class RuntimePromptTemplateFileMetadata -// CHECKSTYLE:ON -{ - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - @JsonProperty( "scenario" ) - private String scenario; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for RuntimePromptTemplateFileMetadata. - */ - protected RuntimePromptTemplateFileMetadata() - { - } - - /** - * Set the name of this {@link RuntimePromptTemplateFileMetadata} instance and return the same instance. - * - * @param name - * The name of this {@link RuntimePromptTemplateFileMetadata} - * @return The same instance of this {@link RuntimePromptTemplateFileMetadata} class - */ - @Nonnull - public RuntimePromptTemplateFileMetadata name( @Nullable final String name ) - { - this.name = name; - return this; - } - - /** - * Get name - * - * @return name The name of this {@link RuntimePromptTemplateFileMetadata} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link RuntimePromptTemplateFileMetadata} instance. - * - * @param name - * The name of this {@link RuntimePromptTemplateFileMetadata} - */ - public void setName( @Nullable final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link RuntimePromptTemplateFileMetadata} instance and return the same instance. - * - * @param version - * The version of this {@link RuntimePromptTemplateFileMetadata} - * @return The same instance of this {@link RuntimePromptTemplateFileMetadata} class - */ - @Nonnull - public RuntimePromptTemplateFileMetadata version( @Nullable final String version ) - { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link RuntimePromptTemplateFileMetadata} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link RuntimePromptTemplateFileMetadata} instance. - * - * @param version - * The version of this {@link RuntimePromptTemplateFileMetadata} - */ - public void setVersion( @Nullable final String version ) - { - this.version = version; - } - - /** - * Set the scenario of this {@link RuntimePromptTemplateFileMetadata} instance and return the same instance. - * - * @param scenario - * The scenario of this {@link RuntimePromptTemplateFileMetadata} - * @return The same instance of this {@link RuntimePromptTemplateFileMetadata} class - */ - @Nonnull - public RuntimePromptTemplateFileMetadata scenario( @Nullable final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Get scenario - * - * @return scenario The scenario of this {@link RuntimePromptTemplateFileMetadata} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link RuntimePromptTemplateFileMetadata} instance. - * - * @param scenario - * The scenario of this {@link RuntimePromptTemplateFileMetadata} - */ - public void setScenario( @Nullable final String scenario ) - { - this.scenario = scenario; - } - - /** - * Get the names of the unrecognizable properties of the {@link RuntimePromptTemplateFileMetadata}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RuntimePromptTemplateFileMetadata} 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( - "RuntimePromptTemplateFileMetadata has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link RuntimePromptTemplateFileMetadata} 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( version != null ) - declaredFields.put("version", version); - if( scenario != null ) - declaredFields.put("scenario", scenario); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link RuntimePromptTemplateFileMetadata} 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 RuntimePromptTemplateFileMetadata runtimePromptTemplateFileMetadata = - (RuntimePromptTemplateFileMetadata) o; - return Objects.equals(this.cloudSdkCustomFields, runtimePromptTemplateFileMetadata.cloudSdkCustomFields) - && Objects.equals(this.name, runtimePromptTemplateFileMetadata.name) - && Objects.equals(this.version, runtimePromptTemplateFileMetadata.version) - && Objects.equals(this.scenario, runtimePromptTemplateFileMetadata.scenario); - } - - @Override - public int hashCode() - { - return Objects.hash(name, version, scenario, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class RuntimePromptTemplateFileMetadata {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java deleted file mode 100644 index 9371a8ab2..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationApplyToSelector.java +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * This selector allows you to define the scope of translation, such as specific placeholders or messages with specific - * roles. For example, `{\"category\": \"placeholders\", \"items\": - * [\"user_input\"], \"source_language\": \"de-DE\"}` targets the value of - * \"user_input\" in `placeholder_values` specified in the request payload; and considers the value - * to be in German. - */ - -@Beta // CHECKSTYLE:OFF -public class SAPDocumentTranslationApplyToSelector -// CHECKSTYLE:ON -{ - /** - * Category to apply translation to. - */ - public enum CategoryEnum - { - /** - * The PLACEHOLDERS option of this SAPDocumentTranslationApplyToSelector - */ - PLACEHOLDERS("placeholders"), - - /** - * The TEMPLATE_ROLES option of this SAPDocumentTranslationApplyToSelector - */ - TEMPLATE_ROLES("template_roles"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this SAPDocumentTranslationApplyToSelector - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - CategoryEnum( 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 SAPDocumentTranslationApplyToSelector - */ - @JsonCreator - @Nonnull - public static CategoryEnum fromValue( @Nonnull final String value ) - { - for( CategoryEnum b : CategoryEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "category" ) - private CategoryEnum category; - - @JsonProperty( "items" ) - private List items = new ArrayList<>(); - - @JsonProperty( "source_language" ) - private String sourceLanguage; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SAPDocumentTranslationApplyToSelector. - */ - protected SAPDocumentTranslationApplyToSelector() - { - } - - /** - * Set the category of this {@link SAPDocumentTranslationApplyToSelector} instance and return the same instance. - * - * @param category - * Category to apply translation to. - * @return The same instance of this {@link SAPDocumentTranslationApplyToSelector} class - */ - @Nonnull - public SAPDocumentTranslationApplyToSelector category( @Nonnull final CategoryEnum category ) - { - this.category = category; - return this; - } - - /** - * Category to apply translation to. - * - * @return category The category of this {@link SAPDocumentTranslationApplyToSelector} instance. - */ - @Nonnull - public CategoryEnum getCategory() - { - return category; - } - - /** - * Set the category of this {@link SAPDocumentTranslationApplyToSelector} instance. - * - * @param category - * Category to apply translation to. - */ - public void setCategory( @Nonnull final CategoryEnum category ) - { - this.category = category; - } - - /** - * Set the items of this {@link SAPDocumentTranslationApplyToSelector} instance and return the same instance. - * - * @param items - * List of placeholders or roles to apply translation to - * @return The same instance of this {@link SAPDocumentTranslationApplyToSelector} class - */ - @Nonnull - public SAPDocumentTranslationApplyToSelector items( @Nonnull final List items ) - { - this.items = items; - return this; - } - - /** - * Add one items instance to this {@link SAPDocumentTranslationApplyToSelector}. - * - * @param itemsItem - * The items that should be added - * @return The same instance of type {@link SAPDocumentTranslationApplyToSelector} - */ - @Nonnull - public SAPDocumentTranslationApplyToSelector addItemsItem( @Nonnull final String itemsItem ) - { - if( this.items == null ) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * List of placeholders or roles to apply translation to - * - * @return items The items of this {@link SAPDocumentTranslationApplyToSelector} instance. - */ - @Nonnull - public List getItems() - { - return items; - } - - /** - * Set the items of this {@link SAPDocumentTranslationApplyToSelector} instance. - * - * @param items - * List of placeholders or roles to apply translation to - */ - public void setItems( @Nonnull final List items ) - { - this.items = items; - } - - /** - * Set the sourceLanguage of this {@link SAPDocumentTranslationApplyToSelector} instance and return the same - * instance. - * - * @param sourceLanguage - * Language of the text to be translated. - * @return The same instance of this {@link SAPDocumentTranslationApplyToSelector} class - */ - @Nonnull - public SAPDocumentTranslationApplyToSelector sourceLanguage( @Nullable final String sourceLanguage ) - { - this.sourceLanguage = sourceLanguage; - return this; - } - - /** - * Language of the text to be translated. - * - * @return sourceLanguage The sourceLanguage of this {@link SAPDocumentTranslationApplyToSelector} instance. - */ - @Nonnull - public String getSourceLanguage() - { - return sourceLanguage; - } - - /** - * Set the sourceLanguage of this {@link SAPDocumentTranslationApplyToSelector} instance. - * - * @param sourceLanguage - * Language of the text to be translated. - */ - public void setSourceLanguage( @Nullable final String sourceLanguage ) - { - this.sourceLanguage = sourceLanguage; - } - - /** - * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationApplyToSelector}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationApplyToSelector} 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( - "SAPDocumentTranslationApplyToSelector has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SAPDocumentTranslationApplyToSelector} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( category != null ) - declaredFields.put("category", category); - if( items != null ) - declaredFields.put("items", items); - if( sourceLanguage != null ) - declaredFields.put("sourceLanguage", sourceLanguage); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SAPDocumentTranslationApplyToSelector} 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 SAPDocumentTranslationApplyToSelector saPDocumentTranslationApplyToSelector = - (SAPDocumentTranslationApplyToSelector) o; - return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationApplyToSelector.cloudSdkCustomFields) - && Objects.equals(this.category, saPDocumentTranslationApplyToSelector.category) - && Objects.equals(this.items, saPDocumentTranslationApplyToSelector.items) - && Objects.equals(this.sourceLanguage, saPDocumentTranslationApplyToSelector.sourceLanguage); - } - - @Override - public int hashCode() - { - return Objects.hash(category, items, sourceLanguage, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SAPDocumentTranslationApplyToSelector {\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" sourceLanguage: ").append(toIndentedString(sourceLanguage)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java deleted file mode 100644 index b8cff778a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInput.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * SAPDocumentTranslationInput - */ - -@Beta // CHECKSTYLE:OFF -public class SAPDocumentTranslationInput -// CHECKSTYLE:ON -{ - /** - * Type of document translation provider - */ - public enum TypeEnum - { - /** - * The SAP_DOCUMENT_TRANSLATION option of this SAPDocumentTranslationInput - */ - SAP_DOCUMENT_TRANSLATION("sap_document_translation"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this SAPDocumentTranslationInput - */ - 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 SAPDocumentTranslationInput - */ - @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( "translate_messages_history" ) - private Boolean translateMessagesHistory = true; - - @JsonProperty( "config" ) - private SAPDocumentTranslationInputConfig config; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SAPDocumentTranslationInput. - */ - protected SAPDocumentTranslationInput() - { - } - - /** - * Set the type of this {@link SAPDocumentTranslationInput} instance and return the same instance. - * - * @param type - * Type of document translation provider - * @return The same instance of this {@link SAPDocumentTranslationInput} class - */ - @Nonnull - public SAPDocumentTranslationInput type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Type of document translation provider - * - * @return type The type of this {@link SAPDocumentTranslationInput} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link SAPDocumentTranslationInput} instance. - * - * @param type - * Type of document translation provider - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the translateMessagesHistory of this {@link SAPDocumentTranslationInput} instance and return the same - * instance. - * - * @param translateMessagesHistory - * If true, the messages history will be translated as well. - * @return The same instance of this {@link SAPDocumentTranslationInput} class - */ - @Nonnull - public SAPDocumentTranslationInput translateMessagesHistory( @Nullable final Boolean translateMessagesHistory ) - { - this.translateMessagesHistory = translateMessagesHistory; - return this; - } - - /** - * If true, the messages history will be translated as well. - * - * @return translateMessagesHistory The translateMessagesHistory of this {@link SAPDocumentTranslationInput} - * instance. - */ - @Nonnull - public Boolean isTranslateMessagesHistory() - { - return translateMessagesHistory; - } - - /** - * Set the translateMessagesHistory of this {@link SAPDocumentTranslationInput} instance. - * - * @param translateMessagesHistory - * If true, the messages history will be translated as well. - */ - public void setTranslateMessagesHistory( @Nullable final Boolean translateMessagesHistory ) - { - this.translateMessagesHistory = translateMessagesHistory; - } - - /** - * Set the config of this {@link SAPDocumentTranslationInput} instance and return the same instance. - * - * @param config - * The config of this {@link SAPDocumentTranslationInput} - * @return The same instance of this {@link SAPDocumentTranslationInput} class - */ - @Nonnull - public SAPDocumentTranslationInput config( @Nonnull final SAPDocumentTranslationInputConfig config ) - { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link SAPDocumentTranslationInput} instance. - */ - @Nonnull - public SAPDocumentTranslationInputConfig getConfig() - { - return config; - } - - /** - * Set the config of this {@link SAPDocumentTranslationInput} instance. - * - * @param config - * The config of this {@link SAPDocumentTranslationInput} - */ - public void setConfig( @Nonnull final SAPDocumentTranslationInputConfig config ) - { - this.config = config; - } - - /** - * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationInput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationInput} 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("SAPDocumentTranslationInput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SAPDocumentTranslationInput} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( translateMessagesHistory != null ) - declaredFields.put("translateMessagesHistory", translateMessagesHistory); - if( config != null ) - declaredFields.put("config", config); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SAPDocumentTranslationInput} 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 SAPDocumentTranslationInput saPDocumentTranslationInput = (SAPDocumentTranslationInput) o; - return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationInput.cloudSdkCustomFields) - && Objects.equals(this.type, saPDocumentTranslationInput.type) - && Objects.equals(this.translateMessagesHistory, saPDocumentTranslationInput.translateMessagesHistory) - && Objects.equals(this.config, saPDocumentTranslationInput.config); - } - - @Override - public int hashCode() - { - return Objects.hash(type, translateMessagesHistory, config, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SAPDocumentTranslationInput {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" translateMessagesHistory: ").append(toIndentedString(translateMessagesHistory)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java deleted file mode 100644 index a07a1cc70..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationInputConfig.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Configuration for `sap_document_translation` translation provider. - */ - -@Beta // CHECKSTYLE:OFF -public class SAPDocumentTranslationInputConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "source_language" ) - private String sourceLanguage; - - @JsonProperty( "apply_to" ) - private List applyTo = new ArrayList<>(); - - @JsonProperty( "target_language" ) - private String targetLanguage; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SAPDocumentTranslationInputConfig. - */ - protected SAPDocumentTranslationInputConfig() - { - } - - /** - * Set the sourceLanguage of this {@link SAPDocumentTranslationInputConfig} instance and return the same instance. - * - * @param sourceLanguage - * Language of the text to be translated. - * @return The same instance of this {@link SAPDocumentTranslationInputConfig} class - */ - @Nonnull - public SAPDocumentTranslationInputConfig sourceLanguage( @Nullable final String sourceLanguage ) - { - this.sourceLanguage = sourceLanguage; - return this; - } - - /** - * Language of the text to be translated. - * - * @return sourceLanguage The sourceLanguage of this {@link SAPDocumentTranslationInputConfig} instance. - */ - @Nonnull - public String getSourceLanguage() - { - return sourceLanguage; - } - - /** - * Set the sourceLanguage of this {@link SAPDocumentTranslationInputConfig} instance. - * - * @param sourceLanguage - * Language of the text to be translated. - */ - public void setSourceLanguage( @Nullable final String sourceLanguage ) - { - this.sourceLanguage = sourceLanguage; - } - - /** - * Set the applyTo of this {@link SAPDocumentTranslationInputConfig} instance and return the same instance. - * - * @param applyTo - * The applyTo of this {@link SAPDocumentTranslationInputConfig} - * @return The same instance of this {@link SAPDocumentTranslationInputConfig} class - */ - @Nonnull - public SAPDocumentTranslationInputConfig applyTo( - @Nullable final List applyTo ) - { - this.applyTo = applyTo; - return this; - } - - /** - * Add one applyTo instance to this {@link SAPDocumentTranslationInputConfig}. - * - * @param applyToItem - * The applyTo that should be added - * @return The same instance of type {@link SAPDocumentTranslationInputConfig} - */ - @Nonnull - public SAPDocumentTranslationInputConfig addApplyToItem( - @Nonnull final SAPDocumentTranslationApplyToSelector applyToItem ) - { - if( this.applyTo == null ) { - this.applyTo = new ArrayList<>(); - } - this.applyTo.add(applyToItem); - return this; - } - - /** - * Get applyTo - * - * @return applyTo The applyTo of this {@link SAPDocumentTranslationInputConfig} instance. - */ - @Nonnull - public List getApplyTo() - { - return applyTo; - } - - /** - * Set the applyTo of this {@link SAPDocumentTranslationInputConfig} instance. - * - * @param applyTo - * The applyTo of this {@link SAPDocumentTranslationInputConfig} - */ - public void setApplyTo( @Nullable final List applyTo ) - { - this.applyTo = applyTo; - } - - /** - * Set the targetLanguage of this {@link SAPDocumentTranslationInputConfig} instance and return the same instance. - * - * @param targetLanguage - * Language to which the text should be translated. - * @return The same instance of this {@link SAPDocumentTranslationInputConfig} class - */ - @Nonnull - public SAPDocumentTranslationInputConfig targetLanguage( @Nonnull final String targetLanguage ) - { - this.targetLanguage = targetLanguage; - return this; - } - - /** - * Language to which the text should be translated. - * - * @return targetLanguage The targetLanguage of this {@link SAPDocumentTranslationInputConfig} instance. - */ - @Nonnull - public String getTargetLanguage() - { - return targetLanguage; - } - - /** - * Set the targetLanguage of this {@link SAPDocumentTranslationInputConfig} instance. - * - * @param targetLanguage - * Language to which the text should be translated. - */ - public void setTargetLanguage( @Nonnull final String targetLanguage ) - { - this.targetLanguage = targetLanguage; - } - - /** - * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationInputConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationInputConfig} 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( - "SAPDocumentTranslationInputConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SAPDocumentTranslationInputConfig} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( sourceLanguage != null ) - declaredFields.put("sourceLanguage", sourceLanguage); - if( applyTo != null ) - declaredFields.put("applyTo", applyTo); - if( targetLanguage != null ) - declaredFields.put("targetLanguage", targetLanguage); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SAPDocumentTranslationInputConfig} 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 SAPDocumentTranslationInputConfig saPDocumentTranslationInputConfig = - (SAPDocumentTranslationInputConfig) o; - return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationInputConfig.cloudSdkCustomFields) - && Objects.equals(this.sourceLanguage, saPDocumentTranslationInputConfig.sourceLanguage) - && Objects.equals(this.applyTo, saPDocumentTranslationInputConfig.applyTo) - && Objects.equals(this.targetLanguage, saPDocumentTranslationInputConfig.targetLanguage); - } - - @Override - public int hashCode() - { - return Objects.hash(sourceLanguage, applyTo, targetLanguage, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SAPDocumentTranslationInputConfig {\n"); - sb.append(" sourceLanguage: ").append(toIndentedString(sourceLanguage)).append("\n"); - sb.append(" applyTo: ").append(toIndentedString(applyTo)).append("\n"); - sb.append(" targetLanguage: ").append(toIndentedString(targetLanguage)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java deleted file mode 100644 index a9fbe4525..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutput.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * SAPDocumentTranslationOutput - */ - -@Beta // CHECKSTYLE:OFF -public class SAPDocumentTranslationOutput -// CHECKSTYLE:ON -{ - /** - * Configuration for `sap_document_translation` translation provider. - */ - public enum TypeEnum - { - /** - * The SAP_DOCUMENT_TRANSLATION option of this SAPDocumentTranslationOutput - */ - SAP_DOCUMENT_TRANSLATION("sap_document_translation"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this SAPDocumentTranslationOutput - */ - 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 SAPDocumentTranslationOutput - */ - @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 SAPDocumentTranslationOutputConfig config; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SAPDocumentTranslationOutput. - */ - protected SAPDocumentTranslationOutput() - { - } - - /** - * Set the type of this {@link SAPDocumentTranslationOutput} instance and return the same instance. - * - * @param type - * Configuration for `sap_document_translation` translation provider. - * @return The same instance of this {@link SAPDocumentTranslationOutput} class - */ - @Nonnull - public SAPDocumentTranslationOutput type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Configuration for `sap_document_translation` translation provider. - * - * @return type The type of this {@link SAPDocumentTranslationOutput} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link SAPDocumentTranslationOutput} instance. - * - * @param type - * Configuration for `sap_document_translation` translation provider. - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the config of this {@link SAPDocumentTranslationOutput} instance and return the same instance. - * - * @param config - * The config of this {@link SAPDocumentTranslationOutput} - * @return The same instance of this {@link SAPDocumentTranslationOutput} class - */ - @Nonnull - public SAPDocumentTranslationOutput config( @Nonnull final SAPDocumentTranslationOutputConfig config ) - { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link SAPDocumentTranslationOutput} instance. - */ - @Nonnull - public SAPDocumentTranslationOutputConfig getConfig() - { - return config; - } - - /** - * Set the config of this {@link SAPDocumentTranslationOutput} instance. - * - * @param config - * The config of this {@link SAPDocumentTranslationOutput} - */ - public void setConfig( @Nonnull final SAPDocumentTranslationOutputConfig config ) - { - this.config = config; - } - - /** - * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationOutput}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationOutput} 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("SAPDocumentTranslationOutput has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SAPDocumentTranslationOutput} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( config != null ) - declaredFields.put("config", config); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SAPDocumentTranslationOutput} 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 SAPDocumentTranslationOutput saPDocumentTranslationOutput = (SAPDocumentTranslationOutput) o; - return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationOutput.cloudSdkCustomFields) - && Objects.equals(this.type, saPDocumentTranslationOutput.type) - && Objects.equals(this.config, saPDocumentTranslationOutput.config); - } - - @Override - public int hashCode() - { - return Objects.hash(type, config, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SAPDocumentTranslationOutput {\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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java deleted file mode 100644 index 15d1e1891..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputConfig.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * SAPDocumentTranslationOutputConfig - */ - -@Beta // CHECKSTYLE:OFF -public class SAPDocumentTranslationOutputConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "source_language" ) - private String sourceLanguage; - - @JsonProperty( "target_language" ) - private SAPDocumentTranslationOutputTargetLanguage targetLanguage; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SAPDocumentTranslationOutputConfig. - */ - protected SAPDocumentTranslationOutputConfig() - { - } - - /** - * Set the sourceLanguage of this {@link SAPDocumentTranslationOutputConfig} instance and return the same instance. - * - * @param sourceLanguage - * Language of the text to be translated. - * @return The same instance of this {@link SAPDocumentTranslationOutputConfig} class - */ - @Nonnull - public SAPDocumentTranslationOutputConfig sourceLanguage( @Nullable final String sourceLanguage ) - { - this.sourceLanguage = sourceLanguage; - return this; - } - - /** - * Language of the text to be translated. - * - * @return sourceLanguage The sourceLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. - */ - @Nonnull - public String getSourceLanguage() - { - return sourceLanguage; - } - - /** - * Set the sourceLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. - * - * @param sourceLanguage - * Language of the text to be translated. - */ - public void setSourceLanguage( @Nullable final String sourceLanguage ) - { - this.sourceLanguage = sourceLanguage; - } - - /** - * Set the targetLanguage of this {@link SAPDocumentTranslationOutputConfig} instance and return the same instance. - * - * @param targetLanguage - * The targetLanguage of this {@link SAPDocumentTranslationOutputConfig} - * @return The same instance of this {@link SAPDocumentTranslationOutputConfig} class - */ - @Nonnull - public SAPDocumentTranslationOutputConfig targetLanguage( - @Nonnull final SAPDocumentTranslationOutputTargetLanguage targetLanguage ) - { - this.targetLanguage = targetLanguage; - return this; - } - - /** - * Get targetLanguage - * - * @return targetLanguage The targetLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. - */ - @Nonnull - public SAPDocumentTranslationOutputTargetLanguage getTargetLanguage() - { - return targetLanguage; - } - - /** - * Set the targetLanguage of this {@link SAPDocumentTranslationOutputConfig} instance. - * - * @param targetLanguage - * The targetLanguage of this {@link SAPDocumentTranslationOutputConfig} - */ - public void setTargetLanguage( @Nonnull final SAPDocumentTranslationOutputTargetLanguage targetLanguage ) - { - this.targetLanguage = targetLanguage; - } - - /** - * Get the names of the unrecognizable properties of the {@link SAPDocumentTranslationOutputConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SAPDocumentTranslationOutputConfig} 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( - "SAPDocumentTranslationOutputConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SAPDocumentTranslationOutputConfig} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( sourceLanguage != null ) - declaredFields.put("sourceLanguage", sourceLanguage); - if( targetLanguage != null ) - declaredFields.put("targetLanguage", targetLanguage); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SAPDocumentTranslationOutputConfig} 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 SAPDocumentTranslationOutputConfig saPDocumentTranslationOutputConfig = - (SAPDocumentTranslationOutputConfig) o; - return Objects.equals(this.cloudSdkCustomFields, saPDocumentTranslationOutputConfig.cloudSdkCustomFields) - && Objects.equals(this.sourceLanguage, saPDocumentTranslationOutputConfig.sourceLanguage) - && Objects.equals(this.targetLanguage, saPDocumentTranslationOutputConfig.targetLanguage); - } - - @Override - public int hashCode() - { - return Objects.hash(sourceLanguage, targetLanguage, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SAPDocumentTranslationOutputConfig {\n"); - sb.append(" sourceLanguage: ").append(toIndentedString(sourceLanguage)).append("\n"); - sb.append(" targetLanguage: ").append(toIndentedString(targetLanguage)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java deleted file mode 100644 index d5996e42c..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SAPDocumentTranslationOutputTargetLanguage.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import javax.annotation.Nonnull; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * SAPDocumentTranslationOutputTargetLanguage - */ -@Beta -public interface SAPDocumentTranslationOutputTargetLanguage -{ - /** - * Helper class to create {@code String } that implements {@link SAPDocumentTranslationOutputTargetLanguage}. - */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements SAPDocumentTranslationOutputTargetLanguage {} - - /** - * 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 SAPDocumentTranslationApplyToSelector } that implements {@link SAPDocumentTranslationOutputTargetLanguage}. - */ - record InnerSAPDocumentTranslationApplyToSelector(@com.fasterxml.jackson.annotation.JsonValue @Nonnull SAPDocumentTranslationApplyToSelector value) implements SAPDocumentTranslationOutputTargetLanguage {} - - /** - * Creator to enable deserialization of {@code SAPDocumentTranslationApplyToSelector }. - * - * @param val - * the value to use - * @return a new instance of {@link InnerSAPDocumentTranslationApplyToSelector}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerSAPDocumentTranslationApplyToSelector createInnerSAPDocumentTranslationApplyToSelector( - @Nonnull final SAPDocumentTranslationApplyToSelector val ) - { - return new InnerSAPDocumentTranslationApplyToSelector(val); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java deleted file mode 100644 index 889ec4c43..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchDocumentKeyValueListPair.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * SearchDocumentKeyValueListPair - */ - -@Beta // CHECKSTYLE:OFF -public class SearchDocumentKeyValueListPair -// CHECKSTYLE:ON -{ - @JsonProperty( "key" ) - private String key; - - @JsonProperty( "value" ) - private List value = new ArrayList<>(); - - @JsonProperty( "select_mode" ) - private List selectMode = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SearchDocumentKeyValueListPair. - */ - protected SearchDocumentKeyValueListPair() - { - } - - /** - * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same instance. - * - * @param key - * The key of this {@link SearchDocumentKeyValueListPair} - * @return The same instance of this {@link SearchDocumentKeyValueListPair} class - */ - @Nonnull - public SearchDocumentKeyValueListPair key( @Nonnull final String key ) - { - this.key = key; - return this; - } - - /** - * Get key - * - * @return key The key of this {@link SearchDocumentKeyValueListPair} instance. - */ - @Nonnull - public String getKey() - { - return key; - } - - /** - * Set the key of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param key - * The key of this {@link SearchDocumentKeyValueListPair} - */ - public void setKey( @Nonnull final String key ) - { - this.key = key; - } - - /** - * Set the value of this {@link SearchDocumentKeyValueListPair} instance and return the same instance. - * - * @param value - * The value of this {@link SearchDocumentKeyValueListPair} - * @return The same instance of this {@link SearchDocumentKeyValueListPair} class - */ - @Nonnull - public SearchDocumentKeyValueListPair value( @Nonnull final List value ) - { - this.value = value; - return this; - } - - /** - * Add one value instance to this {@link SearchDocumentKeyValueListPair}. - * - * @param valueItem - * The value that should be added - * @return The same instance of type {@link SearchDocumentKeyValueListPair} - */ - @Nonnull - public SearchDocumentKeyValueListPair addValueItem( @Nonnull final String valueItem ) - { - if( this.value == null ) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); - return this; - } - - /** - * Get value - * - * @return value The value of this {@link SearchDocumentKeyValueListPair} instance. - */ - @Nonnull - public List getValue() - { - return value; - } - - /** - * Set the value of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param value - * The value of this {@link SearchDocumentKeyValueListPair} - */ - public void setValue( @Nonnull final List value ) - { - this.value = value; - } - - /** - * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance and return the same instance. - * - * @param selectMode - * Select mode for search filters - * @return The same instance of this {@link SearchDocumentKeyValueListPair} class - */ - @Nonnull - public SearchDocumentKeyValueListPair selectMode( @Nullable final List selectMode ) - { - this.selectMode = selectMode; - return this; - } - - /** - * Add one selectMode instance to this {@link SearchDocumentKeyValueListPair}. - * - * @param selectModeItem - * The selectMode that should be added - * @return The same instance of type {@link SearchDocumentKeyValueListPair} - */ - @Nonnull - public SearchDocumentKeyValueListPair addSelectModeItem( @Nonnull final SearchSelectOptionEnum selectModeItem ) - { - if( this.selectMode == null ) { - this.selectMode = new ArrayList<>(); - } - this.selectMode.add(selectModeItem); - return this; - } - - /** - * Select mode for search filters - * - * @return selectMode The selectMode of this {@link SearchDocumentKeyValueListPair} instance. - */ - @Nonnull - public List getSelectMode() - { - return selectMode; - } - - /** - * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance. - * - * @param selectMode - * Select mode for search filters - */ - public void setSelectMode( @Nullable final List selectMode ) - { - this.selectMode = selectMode; - } - - /** - * Get the names of the unrecognizable properties of the {@link SearchDocumentKeyValueListPair}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. - * - * @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("SearchDocumentKeyValueListPair has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SearchDocumentKeyValueListPair} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( key != null ) - declaredFields.put("key", key); - if( value != null ) - declaredFields.put("value", value); - if( selectMode != null ) - declaredFields.put("selectMode", selectMode); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName - * The name of the property - * @param customFieldValue - * The value of the property - */ - @JsonIgnore - public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) - { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals( @Nullable final java.lang.Object o ) - { - if( this == o ) { - return true; - } - if( o == null || getClass() != o.getClass() ) { - return false; - } - final SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = (SearchDocumentKeyValueListPair) o; - return Objects.equals(this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) - && Objects.equals(this.key, searchDocumentKeyValueListPair.key) - && Objects.equals(this.value, searchDocumentKeyValueListPair.value) - && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode); - } - - @Override - public int hashCode() - { - return Objects.hash(key, value, selectMode, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SearchDocumentKeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); - cloudSdkCustomFields - .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString( final java.lang.Object o ) - { - if( o == null ) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java deleted file mode 100644 index 32b7bbe38..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SearchSelectOptionEnum.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import javax.annotation.Nonnull; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * Gets or Sets SearchSelectOptionEnum - */ - -@Beta -public enum SearchSelectOptionEnum -{ - - IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - SearchSelectOptionEnum( String value ) - { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() - { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() - { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value - * The input value. - * - * @return The enum representation of the given value. - */ - @JsonCreator - public static SearchSelectOptionEnum fromValue( @Nonnull final String value ) - { - for( final SearchSelectOptionEnum b : SearchSelectOptionEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java deleted file mode 100644 index d8bac9d11..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SingleChatTemplate.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * SingleChatTemplate - */ - -@Beta // CHECKSTYLE:OFF -public class SingleChatTemplate implements PromptTemplate -// CHECKSTYLE:ON -{ - @JsonProperty( "role" ) - private String role; - - @JsonProperty( "content" ) - private String content; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SingleChatTemplate. - */ - protected SingleChatTemplate() - { - } - - /** - * Set the role of this {@link SingleChatTemplate} instance and return the same instance. - * - * @param role - * The role of this {@link SingleChatTemplate} - * @return The same instance of this {@link SingleChatTemplate} class - */ - @Nonnull - public SingleChatTemplate role( @Nonnull final String role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link SingleChatTemplate} instance. - */ - @Nonnull - public String getRole() - { - return role; - } - - /** - * Set the role of this {@link SingleChatTemplate} instance. - * - * @param role - * The role of this {@link SingleChatTemplate} - */ - public void setRole( @Nonnull final String role ) - { - this.role = role; - } - - /** - * Set the content of this {@link SingleChatTemplate} instance and return the same instance. - * - * @param content - * The content of this {@link SingleChatTemplate} - * @return The same instance of this {@link SingleChatTemplate} class - */ - @Nonnull - public SingleChatTemplate content( @Nonnull final String content ) - { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link SingleChatTemplate} instance. - */ - @Nonnull - public String getContent() - { - return content; - } - - /** - * Set the content of this {@link SingleChatTemplate} instance. - * - * @param content - * The content of this {@link SingleChatTemplate} - */ - public void setContent( @Nonnull final String content ) - { - this.content = content; - } - - /** - * Get the names of the unrecognizable properties of the {@link SingleChatTemplate}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SingleChatTemplate} 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("SingleChatTemplate has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SingleChatTemplate} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( role != null ) - declaredFields.put("role", role); - if( content != null ) - declaredFields.put("content", content); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SingleChatTemplate} 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 SingleChatTemplate singleChatTemplate = (SingleChatTemplate) o; - return Objects.equals(this.cloudSdkCustomFields, singleChatTemplate.cloudSdkCustomFields) - && Objects.equals(this.role, singleChatTemplate.role) - && Objects.equals(this.content, singleChatTemplate.content); - } - - @Override - public int hashCode() - { - return Objects.hash(role, content, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SingleChatTemplate {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java new file mode 100644 index 000000000..3f334cdf3 --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java @@ -0,0 +1,448 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * Soda + */ + +@Beta // CHECKSTYLE:OFF +public class Soda +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "brand" ) + private String brand; + + @JsonProperty( "quantity" ) + private Integer quantity; + + /** + * Gets or Sets packaging + */ + public enum PackagingEnum + { + /** + * The GLASS option of this Soda + */ + GLASS("glass"), + + /** + * The CARTON option of this Soda + */ + CARTON("carton"), + + /** + * The CAN option of this Soda + */ + CAN("can"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this Soda + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PackagingEnum( String value ) + { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() + { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() + { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value + * The String value + * @return The enum value of type Soda + */ + @JsonCreator + @Nonnull + public static PackagingEnum fromValue( @Nonnull final String value ) + { + for( PackagingEnum b : PackagingEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "packaging" ) + private PackagingEnum packaging; + + @JsonProperty( "price" ) + private Float price; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for Soda. + */ + protected Soda() + { + } + + /** + * Set the name of this {@link Soda} instance and return the same instance. + * + * @param name + * The name of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link Soda} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link Soda} instance. + * + * @param name + * The name of this {@link Soda} + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the brand of this {@link Soda} instance and return the same instance. + * + * @param brand + * The brand of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda brand( @Nonnull final String brand ) + { + this.brand = brand; + return this; + } + + /** + * Get brand + * + * @return brand The brand of this {@link Soda} instance. + */ + @Nonnull + public String getBrand() + { + return brand; + } + + /** + * Set the brand of this {@link Soda} instance. + * + * @param brand + * The brand of this {@link Soda} + */ + public void setBrand( @Nonnull final String brand ) + { + this.brand = brand; + } + + /** + * Set the quantity of this {@link Soda} instance and return the same instance. + * + * @param quantity + * The quantity of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda quantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link Soda} instance. + */ + @Nonnull + public Integer getQuantity() + { + return quantity; + } + + /** + * Set the quantity of this {@link Soda} instance. + * + * @param quantity + * The quantity of this {@link Soda} + */ + public void setQuantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + } + + /** + * Set the packaging of this {@link Soda} instance and return the same instance. + * + * @param packaging + * The packaging of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda packaging( @Nullable final PackagingEnum packaging ) + { + this.packaging = packaging; + return this; + } + + /** + * Get packaging + * + * @return packaging The packaging of this {@link Soda} instance. + */ + @Nonnull + public PackagingEnum getPackaging() + { + return packaging; + } + + /** + * Set the packaging of this {@link Soda} instance. + * + * @param packaging + * The packaging of this {@link Soda} + */ + public void setPackaging( @Nullable final PackagingEnum packaging ) + { + this.packaging = packaging; + } + + /** + * Set the price of this {@link Soda} instance and return the same instance. + * + * @param price + * The price of this {@link Soda} + * @return The same instance of this {@link Soda} class + */ + @Nonnull + public Soda price( @Nonnull final Float price ) + { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price The price of this {@link Soda} instance. + */ + @Nonnull + public Float getPrice() + { + return price; + } + + /** + * Set the price of this {@link Soda} instance. + * + * @param price + * The price of this {@link Soda} + */ + public void setPrice( @Nonnull final Float price ) + { + this.price = price; + } + + /** + * Get the names of the unrecognizable properties of the {@link Soda}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Soda} instance. + * + * @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("Soda has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link Soda} 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( brand != null ) + declaredFields.put("brand", brand); + if( quantity != null ) + declaredFields.put("quantity", quantity); + if( packaging != null ) + declaredFields.put("packaging", packaging); + if( price != null ) + declaredFields.put("price", price); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link Soda} instance. If the map previously contained a mapping for the + * key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final Soda soda = (Soda) o; + return Objects.equals(this.cloudSdkCustomFields, soda.cloudSdkCustomFields) + && Objects.equals(this.name, soda.name) + && Objects.equals(this.brand, soda.brand) + && Objects.equals(this.quantity, soda.quantity) + && Objects.equals(this.packaging, soda.packaging) + && Objects.equals(this.price, soda.price); + } + + @Override + public int hashCode() + { + return Objects.hash(name, brand, quantity, packaging, price, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class Soda {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java new file mode 100644 index 000000000..efe0b425e --- /dev/null +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. + */ + +/* + * SodaStore API + * API for managing soda products and orders in SodaStore. + * + * + * + * 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.cloud.sdk.datamodel.openapi.apache.sample.model; + +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; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; + +/** + * SodaWithId + */ + +@Beta // CHECKSTYLE:OFF +public class SodaWithId +// CHECKSTYLE:ON +{ + @JsonProperty( "name" ) + private String name; + + @JsonProperty( "brand" ) + private String brand; + + @JsonProperty( "quantity" ) + private Integer quantity; + + /** + * Gets or Sets packaging + */ + public enum PackagingEnum + { + /** + * The GLASS option of this SodaWithId + */ + GLASS("glass"), + + /** + * The CARTON option of this SodaWithId + */ + CARTON("carton"), + + /** + * The CAN option of this SodaWithId + */ + CAN("can"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this SodaWithId + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PackagingEnum( String value ) + { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() + { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() + { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value + * The String value + * @return The enum value of type SodaWithId + */ + @JsonCreator + @Nonnull + public static PackagingEnum fromValue( @Nonnull final String value ) + { + for( PackagingEnum b : PackagingEnum.values() ) { + if( b.value.equals(value) ) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty( "packaging" ) + private PackagingEnum packaging; + + @JsonProperty( "price" ) + private Float price; + + @JsonProperty( "id" ) + private Long id; + + @JsonAnySetter + @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** + * Default constructor for SodaWithId. + */ + protected SodaWithId() + { + } + + /** + * Set the name of this {@link SodaWithId} instance and return the same instance. + * + * @param name + * The name of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId name( @Nonnull final String name ) + { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name The name of this {@link SodaWithId} instance. + */ + @Nonnull + public String getName() + { + return name; + } + + /** + * Set the name of this {@link SodaWithId} instance. + * + * @param name + * The name of this {@link SodaWithId} + */ + public void setName( @Nonnull final String name ) + { + this.name = name; + } + + /** + * Set the brand of this {@link SodaWithId} instance and return the same instance. + * + * @param brand + * The brand of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId brand( @Nonnull final String brand ) + { + this.brand = brand; + return this; + } + + /** + * Get brand + * + * @return brand The brand of this {@link SodaWithId} instance. + */ + @Nonnull + public String getBrand() + { + return brand; + } + + /** + * Set the brand of this {@link SodaWithId} instance. + * + * @param brand + * The brand of this {@link SodaWithId} + */ + public void setBrand( @Nonnull final String brand ) + { + this.brand = brand; + } + + /** + * Set the quantity of this {@link SodaWithId} instance and return the same instance. + * + * @param quantity + * The quantity of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId quantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity The quantity of this {@link SodaWithId} instance. + */ + @Nonnull + public Integer getQuantity() + { + return quantity; + } + + /** + * Set the quantity of this {@link SodaWithId} instance. + * + * @param quantity + * The quantity of this {@link SodaWithId} + */ + public void setQuantity( @Nonnull final Integer quantity ) + { + this.quantity = quantity; + } + + /** + * Set the packaging of this {@link SodaWithId} instance and return the same instance. + * + * @param packaging + * The packaging of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId packaging( @Nullable final PackagingEnum packaging ) + { + this.packaging = packaging; + return this; + } + + /** + * Get packaging + * + * @return packaging The packaging of this {@link SodaWithId} instance. + */ + @Nonnull + public PackagingEnum getPackaging() + { + return packaging; + } + + /** + * Set the packaging of this {@link SodaWithId} instance. + * + * @param packaging + * The packaging of this {@link SodaWithId} + */ + public void setPackaging( @Nullable final PackagingEnum packaging ) + { + this.packaging = packaging; + } + + /** + * Set the price of this {@link SodaWithId} instance and return the same instance. + * + * @param price + * The price of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId price( @Nonnull final Float price ) + { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price The price of this {@link SodaWithId} instance. + */ + @Nonnull + public Float getPrice() + { + return price; + } + + /** + * Set the price of this {@link SodaWithId} instance. + * + * @param price + * The price of this {@link SodaWithId} + */ + public void setPrice( @Nonnull final Float price ) + { + this.price = price; + } + + /** + * Set the id of this {@link SodaWithId} instance and return the same instance. + * + * @param id + * The id of this {@link SodaWithId} + * @return The same instance of this {@link SodaWithId} class + */ + @Nonnull + public SodaWithId id( @Nullable final Long id ) + { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link SodaWithId} instance. + */ + @Nonnull + public Long getId() + { + return id; + } + + /** + * Set the id of this {@link SodaWithId} instance. + * + * @param id + * The id of this {@link SodaWithId} + */ + public void setId( @Nullable final Long id ) + { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link SodaWithId}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() + { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SodaWithId} instance. + * + * @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("SodaWithId has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SodaWithId} 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( brand != null ) + declaredFields.put("brand", brand); + if( quantity != null ) + declaredFields.put("quantity", quantity); + if( packaging != null ) + declaredFields.put("packaging", packaging); + if( price != null ) + declaredFields.put("price", price); + if( id != null ) + declaredFields.put("id", id); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SodaWithId} instance. If the map previously contained a mapping for + * the key, the old value is replaced by the specified value. + * + * @param customFieldName + * The name of the property + * @param customFieldValue + * The value of the property + */ + @JsonIgnore + public void setCustomField( @Nonnull String customFieldName, @Nullable Object customFieldValue ) + { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals( @Nullable final java.lang.Object o ) + { + if( this == o ) { + return true; + } + if( o == null || getClass() != o.getClass() ) { + return false; + } + final SodaWithId sodaWithId = (SodaWithId) o; + return Objects.equals(this.cloudSdkCustomFields, sodaWithId.cloudSdkCustomFields) + && Objects.equals(this.name, sodaWithId.name) + && Objects.equals(this.brand, sodaWithId.brand) + && Objects.equals(this.quantity, sodaWithId.quantity) + && Objects.equals(this.packaging, sodaWithId.packaging) + && Objects.equals(this.price, sodaWithId.price) + && Objects.equals(this.id, sodaWithId.id); + } + + @Override + public int hashCode() + { + return Objects.hash(name, brand, quantity, packaging, price, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append("class SodaWithId {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields + .forEach(( k, v ) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString( final java.lang.Object o ) + { + if( o == null ) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java deleted file mode 100644 index 5e9e203e2..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SystemChatMessage.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * SystemChatMessage - */ - -@Beta // CHECKSTYLE:OFF -public class SystemChatMessage implements ChatMessage -// CHECKSTYLE:ON -{ - /** - * Gets or Sets role - */ - public enum RoleEnum - { - /** - * The SYSTEM option of this SystemChatMessage - */ - SYSTEM("system"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this SystemChatMessage - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum( 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 SystemChatMessage - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue( @Nonnull final String value ) - { - for( RoleEnum b : RoleEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "role" ) - private RoleEnum role; - - @JsonProperty( "content" ) - private ChatMessageContent content; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for SystemChatMessage. - */ - protected SystemChatMessage() - { - } - - /** - * Set the role of this {@link SystemChatMessage} instance and return the same instance. - * - * @param role - * The role of this {@link SystemChatMessage} - * @return The same instance of this {@link SystemChatMessage} class - */ - @Nonnull - public SystemChatMessage role( @Nonnull final RoleEnum role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link SystemChatMessage} instance. - */ - @Nonnull - public RoleEnum getRole() - { - return role; - } - - /** - * Set the role of this {@link SystemChatMessage} instance. - * - * @param role - * The role of this {@link SystemChatMessage} - */ - public void setRole( @Nonnull final RoleEnum role ) - { - this.role = role; - } - - /** - * Set the content of this {@link SystemChatMessage} instance and return the same instance. - * - * @param content - * The content of this {@link SystemChatMessage} - * @return The same instance of this {@link SystemChatMessage} class - */ - @Nonnull - public SystemChatMessage content( @Nonnull final ChatMessageContent content ) - { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link SystemChatMessage} instance. - */ - @Nonnull - public ChatMessageContent getContent() - { - return content; - } - - /** - * Set the content of this {@link SystemChatMessage} instance. - * - * @param content - * The content of this {@link SystemChatMessage} - */ - public void setContent( @Nonnull final ChatMessageContent content ) - { - this.content = content; - } - - /** - * Get the names of the unrecognizable properties of the {@link SystemChatMessage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link SystemChatMessage} 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("SystemChatMessage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link SystemChatMessage} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( role != null ) - declaredFields.put("role", role); - if( content != null ) - declaredFields.put("content", content); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link SystemChatMessage} 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 SystemChatMessage systemChatMessage = (SystemChatMessage) o; - return Objects.equals(this.cloudSdkCustomFields, systemChatMessage.cloudSdkCustomFields) - && Objects.equals(this.role, systemChatMessage.role) - && Objects.equals(this.content, systemChatMessage.content); - } - - @Override - public int hashCode() - { - return Objects.hash(role, content, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class SystemChatMessage {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java deleted file mode 100644 index 7b39b3d5a..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Template.java +++ /dev/null @@ -1,389 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Template - */ - -@Beta // CHECKSTYLE:OFF -public class Template implements PromptTemplatingModuleConfigPrompt -// CHECKSTYLE:ON -{ - @JsonProperty( "template" ) - private List template; - - @JsonProperty( "defaults" ) - private Map defaults = new HashMap<>(); - - @JsonProperty( "response_format" ) - private TemplateResponseFormat responseFormat; - - @JsonProperty( "tools" ) - private List tools = new ArrayList<>(); - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for Template. - */ - protected Template() - { - } - - /** - * Set the template of this {@link Template} instance and return the same instance. - * - * @param template - * A chat message array to be formatted with values from placeholder_values. Both role and content can be - * templated. If messages_history is provided, the templated messages will be appended. - * @return The same instance of this {@link Template} class - */ - @Nonnull - public Template template( @Nonnull final List template ) - { - this.template = template; - return this; - } - - /** - * Add one template instance to this {@link Template}. - * - * @param templateItem - * The template that should be added - * @return The same instance of type {@link Template} - */ - @Nonnull - public Template addTemplateItem( @Nonnull final ChatMessage templateItem ) - { - if( this.template == null ) { - this.template = new ArrayList<>(); - } - this.template.add(templateItem); - return this; - } - - /** - * A chat message array to be formatted with values from placeholder_values. Both role and content can be templated. - * If messages_history is provided, the templated messages will be appended. - * - * @return template The template of this {@link Template} instance. - */ - @Nonnull - public List getTemplate() - { - return template; - } - - /** - * Set the template of this {@link Template} instance. - * - * @param template - * A chat message array to be formatted with values from placeholder_values. Both role and content can be - * templated. If messages_history is provided, the templated messages will be appended. - */ - public void setTemplate( @Nonnull final List template ) - { - this.template = template; - } - - /** - * Set the defaults of this {@link Template} instance and return the same instance. - * - * @param defaults - * Optional default values for the template. If a parameter has no default it is required. - * @return The same instance of this {@link Template} class - */ - @Nonnull - public Template defaults( @Nullable final Map defaults ) - { - this.defaults = defaults; - return this; - } - - /** - * Put one defaults instance to this {@link Template} instance. - * - * @param key - * The String key of this defaults instance - * @param defaultsItem - * The defaults that should be added under the given key - * @return The same instance of type {@link Template} - */ - @Nonnull - public Template putdefaultsItem( @Nonnull final String key, @Nonnull final String defaultsItem ) - { - if( this.defaults == null ) { - this.defaults = new HashMap<>(); - } - this.defaults.put(key, defaultsItem); - return this; - } - - /** - * Optional default values for the template. If a parameter has no default it is required. - * - * @return defaults The defaults of this {@link Template} instance. - */ - @Nonnull - public Map getDefaults() - { - return defaults; - } - - /** - * Set the defaults of this {@link Template} instance. - * - * @param defaults - * Optional default values for the template. If a parameter has no default it is required. - */ - public void setDefaults( @Nullable final Map defaults ) - { - this.defaults = defaults; - } - - /** - * Set the responseFormat of this {@link Template} instance and return the same instance. - * - * @param responseFormat - * The responseFormat of this {@link Template} - * @return The same instance of this {@link Template} class - */ - @Nonnull - public Template responseFormat( @Nullable final TemplateResponseFormat responseFormat ) - { - this.responseFormat = responseFormat; - return this; - } - - /** - * Get responseFormat - * - * @return responseFormat The responseFormat of this {@link Template} instance. - */ - @Nonnull - public TemplateResponseFormat getResponseFormat() - { - return responseFormat; - } - - /** - * Set the responseFormat of this {@link Template} instance. - * - * @param responseFormat - * The responseFormat of this {@link Template} - */ - public void setResponseFormat( @Nullable final TemplateResponseFormat responseFormat ) - { - this.responseFormat = responseFormat; - } - - /** - * Set the tools of this {@link Template} instance and return the same instance. - * - * @param tools - * A list of tools the model may call. Used to provide a list of functions the model may generate JSON - * inputs for. This is the same as the OpenAI definition. - * @return The same instance of this {@link Template} class - */ - @Nonnull - public Template tools( @Nullable final List tools ) - { - this.tools = tools; - return this; - } - - /** - * Add one tools instance to this {@link Template}. - * - * @param toolsItem - * The tools that should be added - * @return The same instance of type {@link Template} - */ - @Nonnull - public Template addToolsItem( @Nonnull final ChatCompletionTool toolsItem ) - { - if( this.tools == null ) { - this.tools = new ArrayList<>(); - } - this.tools.add(toolsItem); - return this; - } - - /** - * A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. - * This is the same as the OpenAI definition. - * - * @return tools The tools of this {@link Template} instance. - */ - @Nonnull - public List getTools() - { - return tools; - } - - /** - * Set the tools of this {@link Template} instance. - * - * @param tools - * A list of tools the model may call. Used to provide a list of functions the model may generate JSON - * inputs for. This is the same as the OpenAI definition. - */ - public void setTools( @Nullable final List tools ) - { - this.tools = tools; - } - - /** - * Get the names of the unrecognizable properties of the {@link Template}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Template} 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("Template has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Template} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( template != null ) - declaredFields.put("template", template); - if( defaults != null ) - declaredFields.put("defaults", defaults); - if( responseFormat != null ) - declaredFields.put("responseFormat", responseFormat); - if( tools != null ) - declaredFields.put("tools", tools); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Template} 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 Template template = (Template) o; - return Objects.equals(this.cloudSdkCustomFields, template.cloudSdkCustomFields) - && Objects.equals(this.template, template.template) - && Objects.equals(this.defaults, template.defaults) - && Objects.equals(this.responseFormat, template.responseFormat) - && Objects.equals(this.tools, template.tools); - } - - @Override - public int hashCode() - { - return Objects.hash(template, defaults, responseFormat, tools, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class Template {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); - sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n"); - sb.append(" tools: ").append(toIndentedString(tools)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java deleted file mode 100644 index 52cc602df..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRef.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * TemplateRef - */ - -@Beta // CHECKSTYLE:OFF -public class TemplateRef implements PromptTemplatingModuleConfigPrompt -// CHECKSTYLE:ON -{ - @JsonProperty( "template_ref" ) - private TemplateRefTemplateRef templateRef; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for TemplateRef. - */ - protected TemplateRef() - { - } - - /** - * Set the templateRef of this {@link TemplateRef} instance and return the same instance. - * - * @param templateRef - * The templateRef of this {@link TemplateRef} - * @return The same instance of this {@link TemplateRef} class - */ - @Nonnull - public TemplateRef templateRef( @Nonnull final TemplateRefTemplateRef templateRef ) - { - this.templateRef = templateRef; - return this; - } - - /** - * Get templateRef - * - * @return templateRef The templateRef of this {@link TemplateRef} instance. - */ - @Nonnull - public TemplateRefTemplateRef getTemplateRef() - { - return templateRef; - } - - /** - * Set the templateRef of this {@link TemplateRef} instance. - * - * @param templateRef - * The templateRef of this {@link TemplateRef} - */ - public void setTemplateRef( @Nonnull final TemplateRefTemplateRef templateRef ) - { - this.templateRef = templateRef; - } - - /** - * Get the names of the unrecognizable properties of the {@link TemplateRef}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TemplateRef} 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("TemplateRef has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link TemplateRef} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( templateRef != null ) - declaredFields.put("templateRef", templateRef); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link TemplateRef} 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 TemplateRef templateRef = (TemplateRef) o; - return Objects.equals(this.cloudSdkCustomFields, templateRef.cloudSdkCustomFields) - && Objects.equals(this.templateRef, templateRef.templateRef); - } - - @Override - public int hashCode() - { - return Objects.hash(templateRef, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRef {\n"); - sb.append(" templateRef: ").append(toIndentedString(templateRef)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java deleted file mode 100644 index 31764a273..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByID.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * TemplateRefByID - */ - -@Beta // CHECKSTYLE:OFF -public class TemplateRefByID implements TemplateRefTemplateRef -// CHECKSTYLE:ON -{ - @JsonProperty( "id" ) - private String id; - - /** - * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared - * across all resource groups within the tenant, while 'resource_group' indicates the template is only - * accessible within the specific resource group. - */ - public enum ScopeEnum - { - /** - * The RESOURCE_GROUP option of this TemplateRefByID - */ - RESOURCE_GROUP("resource_group"), - - /** - * The TENANT option of this TemplateRefByID - */ - TENANT("tenant"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this TemplateRefByID - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ScopeEnum( 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 TemplateRefByID - */ - @JsonCreator - @Nonnull - public static ScopeEnum fromValue( @Nonnull final String value ) - { - for( ScopeEnum b : ScopeEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "scope" ) - private ScopeEnum scope = ScopeEnum.TENANT; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for TemplateRefByID. - */ - protected TemplateRefByID() - { - } - - /** - * Set the id of this {@link TemplateRefByID} instance and return the same instance. - * - * @param id - * ID of the template in prompt registry - * @return The same instance of this {@link TemplateRefByID} class - */ - @Nonnull - public TemplateRefByID id( @Nonnull final String id ) - { - this.id = id; - return this; - } - - /** - * ID of the template in prompt registry - * - * @return id The id of this {@link TemplateRefByID} instance. - */ - @Nonnull - public String getId() - { - return id; - } - - /** - * Set the id of this {@link TemplateRefByID} instance. - * - * @param id - * ID of the template in prompt registry - */ - public void setId( @Nonnull final String id ) - { - this.id = id; - } - - /** - * Set the scope of this {@link TemplateRefByID} instance and return the same instance. - * - * @param scope - * Defines the scope that is searched for the referenced template. 'tenant' indicates the - * template is shared across all resource groups within the tenant, while 'resource_group' - * indicates the template is only accessible within the specific resource group. - * @return The same instance of this {@link TemplateRefByID} class - */ - @Nonnull - public TemplateRefByID scope( @Nullable final ScopeEnum scope ) - { - this.scope = scope; - return this; - } - - /** - * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared - * across all resource groups within the tenant, while 'resource_group' indicates the template is only - * accessible within the specific resource group. - * - * @return scope The scope of this {@link TemplateRefByID} instance. - */ - @Nonnull - public ScopeEnum getScope() - { - return scope; - } - - /** - * Set the scope of this {@link TemplateRefByID} instance. - * - * @param scope - * Defines the scope that is searched for the referenced template. 'tenant' indicates the - * template is shared across all resource groups within the tenant, while 'resource_group' - * indicates the template is only accessible within the specific resource group. - */ - public void setScope( @Nullable final ScopeEnum scope ) - { - this.scope = scope; - } - - /** - * Get the names of the unrecognizable properties of the {@link TemplateRefByID}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TemplateRefByID} 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("TemplateRefByID has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link TemplateRefByID} 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( scope != null ) - declaredFields.put("scope", scope); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link TemplateRefByID} 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 TemplateRefByID templateRefByID = (TemplateRefByID) o; - return Objects.equals(this.cloudSdkCustomFields, templateRefByID.cloudSdkCustomFields) - && Objects.equals(this.id, templateRefByID.id) - && Objects.equals(this.scope, templateRefByID.scope); - } - - @Override - public int hashCode() - { - return Objects.hash(id, scope, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRefByID {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java deleted file mode 100644 index 67ff64d40..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefByScenarioNameVersion.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * TemplateRefByScenarioNameVersion - */ - -@Beta // CHECKSTYLE:OFF -public class TemplateRefByScenarioNameVersion implements TemplateRefTemplateRef -// CHECKSTYLE:ON -{ - @JsonProperty( "scenario" ) - private String scenario; - - @JsonProperty( "name" ) - private String name; - - @JsonProperty( "version" ) - private String version; - - /** - * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared - * across all resource groups within the tenant, while 'resource_group' indicates the template is only - * accessible within the specific resource group. - */ - public enum ScopeEnum - { - /** - * The RESOURCE_GROUP option of this TemplateRefByScenarioNameVersion - */ - RESOURCE_GROUP("resource_group"), - - /** - * The TENANT option of this TemplateRefByScenarioNameVersion - */ - TENANT("tenant"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this TemplateRefByScenarioNameVersion - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ScopeEnum( 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 TemplateRefByScenarioNameVersion - */ - @JsonCreator - @Nonnull - public static ScopeEnum fromValue( @Nonnull final String value ) - { - for( ScopeEnum b : ScopeEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "scope" ) - private ScopeEnum scope = ScopeEnum.TENANT; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for TemplateRefByScenarioNameVersion. - */ - protected TemplateRefByScenarioNameVersion() - { - } - - /** - * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. - * - * @param scenario - * Scenario name - * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class - */ - @Nonnull - public TemplateRefByScenarioNameVersion scenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - return this; - } - - /** - * Scenario name - * - * @return scenario The scenario of this {@link TemplateRefByScenarioNameVersion} instance. - */ - @Nonnull - public String getScenario() - { - return scenario; - } - - /** - * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance. - * - * @param scenario - * Scenario name - */ - public void setScenario( @Nonnull final String scenario ) - { - this.scenario = scenario; - } - - /** - * Set the name of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. - * - * @param name - * Name of the template - * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class - */ - @Nonnull - public TemplateRefByScenarioNameVersion name( @Nonnull final String name ) - { - this.name = name; - return this; - } - - /** - * Name of the template - * - * @return name The name of this {@link TemplateRefByScenarioNameVersion} instance. - */ - @Nonnull - public String getName() - { - return name; - } - - /** - * Set the name of this {@link TemplateRefByScenarioNameVersion} instance. - * - * @param name - * Name of the template - */ - public void setName( @Nonnull final String name ) - { - this.name = name; - } - - /** - * Set the version of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. - * - * @param version - * Version of the template - * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class - */ - @Nonnull - public TemplateRefByScenarioNameVersion version( @Nonnull final String version ) - { - this.version = version; - return this; - } - - /** - * Version of the template - * - * @return version The version of this {@link TemplateRefByScenarioNameVersion} instance. - */ - @Nonnull - public String getVersion() - { - return version; - } - - /** - * Set the version of this {@link TemplateRefByScenarioNameVersion} instance. - * - * @param version - * Version of the template - */ - public void setVersion( @Nonnull final String version ) - { - this.version = version; - } - - /** - * Set the scope of this {@link TemplateRefByScenarioNameVersion} instance and return the same instance. - * - * @param scope - * Defines the scope that is searched for the referenced template. 'tenant' indicates the - * template is shared across all resource groups within the tenant, while 'resource_group' - * indicates the template is only accessible within the specific resource group. - * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class - */ - @Nonnull - public TemplateRefByScenarioNameVersion scope( @Nullable final ScopeEnum scope ) - { - this.scope = scope; - return this; - } - - /** - * Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared - * across all resource groups within the tenant, while 'resource_group' indicates the template is only - * accessible within the specific resource group. - * - * @return scope The scope of this {@link TemplateRefByScenarioNameVersion} instance. - */ - @Nonnull - public ScopeEnum getScope() - { - return scope; - } - - /** - * Set the scope of this {@link TemplateRefByScenarioNameVersion} instance. - * - * @param scope - * Defines the scope that is searched for the referenced template. 'tenant' indicates the - * template is shared across all resource groups within the tenant, while 'resource_group' - * indicates the template is only accessible within the specific resource group. - */ - public void setScope( @Nullable final ScopeEnum scope ) - { - this.scope = scope; - } - - /** - * Get the names of the unrecognizable properties of the {@link TemplateRefByScenarioNameVersion}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TemplateRefByScenarioNameVersion} 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("TemplateRefByScenarioNameVersion has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link TemplateRefByScenarioNameVersion} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( scenario != null ) - declaredFields.put("scenario", scenario); - if( name != null ) - declaredFields.put("name", name); - if( version != null ) - declaredFields.put("version", version); - if( scope != null ) - declaredFields.put("scope", scope); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link TemplateRefByScenarioNameVersion} 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 TemplateRefByScenarioNameVersion templateRefByScenarioNameVersion = (TemplateRefByScenarioNameVersion) o; - return Objects.equals(this.cloudSdkCustomFields, templateRefByScenarioNameVersion.cloudSdkCustomFields) - && Objects.equals(this.scenario, templateRefByScenarioNameVersion.scenario) - && Objects.equals(this.name, templateRefByScenarioNameVersion.name) - && Objects.equals(this.version, templateRefByScenarioNameVersion.version) - && Objects.equals(this.scope, templateRefByScenarioNameVersion.scope); - } - - @Override - public int hashCode() - { - return Objects.hash(scenario, name, version, scope, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRefByScenarioNameVersion {\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java deleted file mode 100644 index d9831432d..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateRefTemplateRef.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * Reference to a template in the prompt registry by ID or by scenario, name and version - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = TemplateRefByID.class ), - @JsonSubTypes.Type( value = TemplateRefByScenarioNameVersion.class ), } ) - -public interface TemplateRefTemplateRef -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java deleted file mode 100644 index 205025c94..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TemplateResponseFormat.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; - -/** - * Response format that the model output should adhere to. This is the same as the OpenAI definition. - */ -@Beta -@JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) -@JsonSubTypes( { - @JsonSubTypes.Type( value = ResponseFormatJsonObject.class ), - @JsonSubTypes.Type( value = ResponseFormatJsonSchema.class ), - @JsonSubTypes.Type( value = ResponseFormatText.class ), } ) - -public interface TemplateResponseFormat -{ -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java deleted file mode 100644 index 96480f22f..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TextContent.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * TextContent - */ - -@Beta // CHECKSTYLE:OFF -public class TextContent implements MultiChatContent -// CHECKSTYLE:ON -{ - /** - * Gets or Sets type - */ - public enum TypeEnum - { - /** - * The TEXT option of this TextContent - */ - TEXT("text"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this TextContent - */ - 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 TextContent - */ - @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( "text" ) - private String text; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for TextContent. - */ - protected TextContent() - { - } - - /** - * Set the type of this {@link TextContent} instance and return the same instance. - * - * @param type - * The type of this {@link TextContent} - * @return The same instance of this {@link TextContent} class - */ - @Nonnull - public TextContent type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link TextContent} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link TextContent} instance. - * - * @param type - * The type of this {@link TextContent} - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the text of this {@link TextContent} instance and return the same instance. - * - * @param text - * The text of this {@link TextContent} - * @return The same instance of this {@link TextContent} class - */ - @Nonnull - public TextContent text( @Nonnull final String text ) - { - this.text = text; - return this; - } - - /** - * Get text - * - * @return text The text of this {@link TextContent} instance. - */ - @Nonnull - public String getText() - { - return text; - } - - /** - * Set the text of this {@link TextContent} instance. - * - * @param text - * The text of this {@link TextContent} - */ - public void setText( @Nonnull final String text ) - { - this.text = text; - } - - /** - * Get the names of the unrecognizable properties of the {@link TextContent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TextContent} 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("TextContent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link TextContent} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( text != null ) - declaredFields.put("text", text); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link TextContent} 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 TextContent textContent = (TextContent) o; - return Objects.equals(this.cloudSdkCustomFields, textContent.cloudSdkCustomFields) - && Objects.equals(this.type, textContent.type) - && Objects.equals(this.text, textContent.text); - } - - @Override - public int hashCode() - { - return Objects.hash(type, text, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class TextContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java deleted file mode 100644 index 585e72ad4..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ToolChatMessage.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * ToolChatMessage - */ - -@Beta // CHECKSTYLE:OFF -public class ToolChatMessage implements ChatMessage -// CHECKSTYLE:ON -{ - /** - * Gets or Sets role - */ - public enum RoleEnum - { - /** - * The TOOL option of this ToolChatMessage - */ - TOOL("tool"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this ToolChatMessage - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum( 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 ToolChatMessage - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue( @Nonnull final String value ) - { - for( RoleEnum b : RoleEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "role" ) - private RoleEnum role; - - @JsonProperty( "tool_call_id" ) - private String toolCallId; - - @JsonProperty( "content" ) - private ChatMessageContent content; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for ToolChatMessage. - */ - protected ToolChatMessage() - { - } - - /** - * Set the role of this {@link ToolChatMessage} instance and return the same instance. - * - * @param role - * The role of this {@link ToolChatMessage} - * @return The same instance of this {@link ToolChatMessage} class - */ - @Nonnull - public ToolChatMessage role( @Nonnull final RoleEnum role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link ToolChatMessage} instance. - */ - @Nonnull - public RoleEnum getRole() - { - return role; - } - - /** - * Set the role of this {@link ToolChatMessage} instance. - * - * @param role - * The role of this {@link ToolChatMessage} - */ - public void setRole( @Nonnull final RoleEnum role ) - { - this.role = role; - } - - /** - * Set the toolCallId of this {@link ToolChatMessage} instance and return the same instance. - * - * @param toolCallId - * The toolCallId of this {@link ToolChatMessage} - * @return The same instance of this {@link ToolChatMessage} class - */ - @Nonnull - public ToolChatMessage toolCallId( @Nonnull final String toolCallId ) - { - this.toolCallId = toolCallId; - return this; - } - - /** - * Get toolCallId - * - * @return toolCallId The toolCallId of this {@link ToolChatMessage} instance. - */ - @Nonnull - public String getToolCallId() - { - return toolCallId; - } - - /** - * Set the toolCallId of this {@link ToolChatMessage} instance. - * - * @param toolCallId - * The toolCallId of this {@link ToolChatMessage} - */ - public void setToolCallId( @Nonnull final String toolCallId ) - { - this.toolCallId = toolCallId; - } - - /** - * Set the content of this {@link ToolChatMessage} instance and return the same instance. - * - * @param content - * The content of this {@link ToolChatMessage} - * @return The same instance of this {@link ToolChatMessage} class - */ - @Nonnull - public ToolChatMessage content( @Nonnull final ChatMessageContent content ) - { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link ToolChatMessage} instance. - */ - @Nonnull - public ChatMessageContent getContent() - { - return content; - } - - /** - * Set the content of this {@link ToolChatMessage} instance. - * - * @param content - * The content of this {@link ToolChatMessage} - */ - public void setContent( @Nonnull final ChatMessageContent content ) - { - this.content = content; - } - - /** - * Get the names of the unrecognizable properties of the {@link ToolChatMessage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ToolChatMessage} 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("ToolChatMessage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link ToolChatMessage} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( role != null ) - declaredFields.put("role", role); - if( toolCallId != null ) - declaredFields.put("toolCallId", toolCallId); - if( content != null ) - declaredFields.put("content", content); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link ToolChatMessage} 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 ToolChatMessage toolChatMessage = (ToolChatMessage) o; - return Objects.equals(this.cloudSdkCustomFields, toolChatMessage.cloudSdkCustomFields) - && Objects.equals(this.role, toolChatMessage.role) - && Objects.equals(this.toolCallId, toolChatMessage.toolCallId) - && Objects.equals(this.content, toolChatMessage.content); - } - - @Override - public int hashCode() - { - return Objects.hash(role, toolCallId, content, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class ToolChatMessage {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java deleted file mode 100644 index 4c0723b27..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/TranslationModuleConfig.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; - -/** - * Configuration for translation module - */ - -@Beta // CHECKSTYLE:OFF -public class TranslationModuleConfig -// CHECKSTYLE:ON -{ - @JsonProperty( "input" ) - private SAPDocumentTranslationInput input; - - @JsonProperty( "output" ) - private SAPDocumentTranslationOutput output; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for TranslationModuleConfig. - */ - protected TranslationModuleConfig() - { - } - - /** - * Set the input of this {@link TranslationModuleConfig} instance and return the same instance. - * - * @param input - * The input of this {@link TranslationModuleConfig} - * @return The same instance of this {@link TranslationModuleConfig} class - */ - @Nonnull - public TranslationModuleConfig input( @Nullable final SAPDocumentTranslationInput input ) - { - this.input = input; - return this; - } - - /** - * Get input - * - * @return input The input of this {@link TranslationModuleConfig} instance. - */ - @Nonnull - public SAPDocumentTranslationInput getInput() - { - return input; - } - - /** - * Set the input of this {@link TranslationModuleConfig} instance. - * - * @param input - * The input of this {@link TranslationModuleConfig} - */ - public void setInput( @Nullable final SAPDocumentTranslationInput input ) - { - this.input = input; - } - - /** - * Set the output of this {@link TranslationModuleConfig} instance and return the same instance. - * - * @param output - * The output of this {@link TranslationModuleConfig} - * @return The same instance of this {@link TranslationModuleConfig} class - */ - @Nonnull - public TranslationModuleConfig output( @Nullable final SAPDocumentTranslationOutput output ) - { - this.output = output; - return this; - } - - /** - * Get output - * - * @return output The output of this {@link TranslationModuleConfig} instance. - */ - @Nonnull - public SAPDocumentTranslationOutput getOutput() - { - return output; - } - - /** - * Set the output of this {@link TranslationModuleConfig} instance. - * - * @param output - * The output of this {@link TranslationModuleConfig} - */ - public void setOutput( @Nullable final SAPDocumentTranslationOutput output ) - { - this.output = output; - } - - /** - * Get the names of the unrecognizable properties of the {@link TranslationModuleConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link TranslationModuleConfig} 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("TranslationModuleConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link TranslationModuleConfig} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( input != null ) - declaredFields.put("input", input); - if( output != null ) - declaredFields.put("output", output); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link TranslationModuleConfig} 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 TranslationModuleConfig translationModuleConfig = (TranslationModuleConfig) o; - return Objects.equals(this.cloudSdkCustomFields, translationModuleConfig.cloudSdkCustomFields) - && Objects.equals(this.input, translationModuleConfig.input) - && Objects.equals(this.output, translationModuleConfig.output); - } - - @Override - public int hashCode() - { - return Objects.hash(input, output, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class TranslationModuleConfig {\n"); - sb.append(" input: ").append(toIndentedString(input)).append("\n"); - sb.append(" output: ").append(toIndentedString(output)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java deleted file mode 100644 index 3d99d01a6..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessage.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * UserChatMessage - */ - -@Beta // CHECKSTYLE:OFF -public class UserChatMessage implements ChatMessage -// CHECKSTYLE:ON -{ - @JsonProperty( "content" ) - private UserChatMessageContent content; - - /** - * Gets or Sets role - */ - public enum RoleEnum - { - /** - * The USER option of this UserChatMessage - */ - USER("user"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this UserChatMessage - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum( 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 UserChatMessage - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue( @Nonnull final String value ) - { - for( RoleEnum b : RoleEnum.values() ) { - if( b.value.equals(value) ) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty( "role" ) - private RoleEnum role; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for UserChatMessage. - */ - protected UserChatMessage() - { - } - - /** - * Set the content of this {@link UserChatMessage} instance and return the same instance. - * - * @param content - * The content of this {@link UserChatMessage} - * @return The same instance of this {@link UserChatMessage} class - */ - @Nonnull - public UserChatMessage content( @Nonnull final UserChatMessageContent content ) - { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link UserChatMessage} instance. - */ - @Nonnull - public UserChatMessageContent getContent() - { - return content; - } - - /** - * Set the content of this {@link UserChatMessage} instance. - * - * @param content - * The content of this {@link UserChatMessage} - */ - public void setContent( @Nonnull final UserChatMessageContent content ) - { - this.content = content; - } - - /** - * Set the role of this {@link UserChatMessage} instance and return the same instance. - * - * @param role - * The role of this {@link UserChatMessage} - * @return The same instance of this {@link UserChatMessage} class - */ - @Nonnull - public UserChatMessage role( @Nonnull final RoleEnum role ) - { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link UserChatMessage} instance. - */ - @Nonnull - public RoleEnum getRole() - { - return role; - } - - /** - * Set the role of this {@link UserChatMessage} instance. - * - * @param role - * The role of this {@link UserChatMessage} - */ - public void setRole( @Nonnull final RoleEnum role ) - { - this.role = role; - } - - /** - * Get the names of the unrecognizable properties of the {@link UserChatMessage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link UserChatMessage} 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("UserChatMessage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link UserChatMessage} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( content != null ) - declaredFields.put("content", content); - if( role != null ) - declaredFields.put("role", role); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link UserChatMessage} 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 UserChatMessage userChatMessage = (UserChatMessage) o; - return Objects.equals(this.cloudSdkCustomFields, userChatMessage.cloudSdkCustomFields) - && Objects.equals(this.content, userChatMessage.content) - && Objects.equals(this.role, userChatMessage.role); - } - - @Override - public int hashCode() - { - return Objects.hash(content, role, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class UserChatMessage {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java deleted file mode 100644 index d9730e468..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/UserChatMessageContentItem.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Prompt Registry API - * Prompt Storage service for Design time & Runtime prompt templates. - * - * - * - * 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.cloud.sdk.datamodel.openapi.apache.sample.model; - -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; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; - -/** - * UserChatMessageContentItem - */ - -@Beta // CHECKSTYLE:OFF -public class UserChatMessageContentItem -// CHECKSTYLE:ON -{ - /** - * Gets or Sets type - */ - public enum TypeEnum - { - /** - * The TEXT option of this UserChatMessageContentItem - */ - TEXT("text"), - - /** - * The IMAGE_URL option of this UserChatMessageContentItem - */ - IMAGE_URL("image_url"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this UserChatMessageContentItem - */ - 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 UserChatMessageContentItem - */ - @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( "text" ) - private String text; - - @JsonProperty( "image_url" ) - private ImageContentUrl imageUrl; - - @JsonAnySetter - @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for UserChatMessageContentItem. - */ - protected UserChatMessageContentItem() - { - } - - /** - * Set the type of this {@link UserChatMessageContentItem} instance and return the same instance. - * - * @param type - * The type of this {@link UserChatMessageContentItem} - * @return The same instance of this {@link UserChatMessageContentItem} class - */ - @Nonnull - public UserChatMessageContentItem type( @Nonnull final TypeEnum type ) - { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link UserChatMessageContentItem} instance. - */ - @Nonnull - public TypeEnum getType() - { - return type; - } - - /** - * Set the type of this {@link UserChatMessageContentItem} instance. - * - * @param type - * The type of this {@link UserChatMessageContentItem} - */ - public void setType( @Nonnull final TypeEnum type ) - { - this.type = type; - } - - /** - * Set the text of this {@link UserChatMessageContentItem} instance and return the same instance. - * - * @param text - * The text of this {@link UserChatMessageContentItem} - * @return The same instance of this {@link UserChatMessageContentItem} class - */ - @Nonnull - public UserChatMessageContentItem text( @Nullable final String text ) - { - this.text = text; - return this; - } - - /** - * Get text - * - * @return text The text of this {@link UserChatMessageContentItem} instance. - */ - @Nonnull - public String getText() - { - return text; - } - - /** - * Set the text of this {@link UserChatMessageContentItem} instance. - * - * @param text - * The text of this {@link UserChatMessageContentItem} - */ - public void setText( @Nullable final String text ) - { - this.text = text; - } - - /** - * Set the imageUrl of this {@link UserChatMessageContentItem} instance and return the same instance. - * - * @param imageUrl - * The imageUrl of this {@link UserChatMessageContentItem} - * @return The same instance of this {@link UserChatMessageContentItem} class - */ - @Nonnull - public UserChatMessageContentItem imageUrl( @Nullable final ImageContentUrl imageUrl ) - { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get imageUrl - * - * @return imageUrl The imageUrl of this {@link UserChatMessageContentItem} instance. - */ - @Nonnull - public ImageContentUrl getImageUrl() - { - return imageUrl; - } - - /** - * Set the imageUrl of this {@link UserChatMessageContentItem} instance. - * - * @param imageUrl - * The imageUrl of this {@link UserChatMessageContentItem} - */ - public void setImageUrl( @Nullable final ImageContentUrl imageUrl ) - { - this.imageUrl = imageUrl; - } - - /** - * Get the names of the unrecognizable properties of the {@link UserChatMessageContentItem}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() - { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link UserChatMessageContentItem} 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("UserChatMessageContentItem has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link UserChatMessageContentItem} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() - { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if( type != null ) - declaredFields.put("type", type); - if( text != null ) - declaredFields.put("text", text); - if( imageUrl != null ) - declaredFields.put("imageUrl", imageUrl); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link UserChatMessageContentItem} 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 UserChatMessageContentItem userChatMessageContentItem = (UserChatMessageContentItem) o; - return Objects.equals(this.cloudSdkCustomFields, userChatMessageContentItem.cloudSdkCustomFields) - && Objects.equals(this.type, userChatMessageContentItem.type) - && Objects.equals(this.text, userChatMessageContentItem.text) - && Objects.equals(this.imageUrl, userChatMessageContentItem.imageUrl); - } - - @Override - public int hashCode() - { - return Objects.hash(type, text, imageUrl, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append("class UserChatMessageContentItem {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).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 "); - } - -} diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml b/datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml deleted file mode 100644 index dc137966e..000000000 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/resources/prompt-registry.yaml +++ /dev/null @@ -1,2026 +0,0 @@ -openapi: 3.0.0 -info: - version: 0.0.1 - title: Prompt Registry API - description: Prompt Storage service for Design time & Runtime prompt templates. -tags: - - name: prompt templates - description: Tag for prompt templates operations - - name: orchestration configs - description: Tag for orchestration configs operations -paths: - /lm/promptTemplates: - post: - operationId: registry.controller.prompt_controller.create_update_prompt_template - x-sap-cloud-sdk-operation-name: createUpdatePromptTemplate - description: Create or update a prompt template - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplatePostRequest' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplatePostResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - get: - operationId: registry.controller.prompt_controller.list_prompt_templates - x-sap-cloud-sdk-operation-name: listPromptTemplates - description: List prompt templates - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: scenario - in: query - schema: - type: string - - name: name - in: query - schema: - type: string - - name: version - in: query - schema: - type: string - - name: retrieve - in: query - schema: - type: string - default: both - - name: includeSpec - in: query - schema: - type: boolean - default: false - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - /lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/history: - get: - operationId: registry.controller.prompt_controller.list_prompt_template_history - x-sap-cloud-sdk-operation-name: listPromptTemplateHistory - description: List prompt template history - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: scenario - in: path - required: true - schema: - type: string - - name: version - in: path - required: true - schema: - type: string - - name: name - in: path - required: true - schema: - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - /lm/promptTemplates/{promptTemplateId}: - get: - operationId: registry.controller.prompt_controller.get_prompt_template_by_uuid - x-sap-cloud-sdk-operation-name: getPromptTemplateByUuid - description: Get prompt template by UUID - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: promptTemplateId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateGetResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - delete: - operationId: registry.controller.prompt_controller.delete_prompt_template - x-sap-cloud-sdk-operation-name: deletePromptTemplate - description: Delete prompt template - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: promptTemplateId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateDeleteResponse' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFound' - default: - $ref: '#/components/responses/CommonError' - /lm/promptTemplates/import: - post: - operationId: registry.controller.prompt_controller.import_prompt_template - x-sap-cloud-sdk-operation-name: importPromptTemplate - description: Import prompt template - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplatePostResponse' - '400': - $ref: '#/components/responses/BadRequest' - default: - $ref: '#/components/responses/CommonError' - /lm/promptTemplates/{promptTemplateId}/export: - get: - operationId: registry.controller.prompt_controller.export_prompt_template - x-sap-cloud-sdk-operation-name: exportPromptTemplate - description: Export prompt template - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: promptTemplateId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Successful response - content: - application/octet-stream: - schema: - type: string - format: binary - '400': - $ref: '#/components/responses/BadRequest' - default: - $ref: '#/components/responses/CommonError' - /lm/promptTemplates/{promptTemplateId}/substitution: - post: - operationId: registry.controller.prompt_controller.parse_prompt_template_by_id - x-sap-cloud-sdk-operation-name: parsePromptTemplateById - description: Parse prompt template by ID - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: promptTemplateId - in: path - required: true - schema: - type: string - format: uuid - - name: metadata - in: query - schema: - type: boolean - default: false - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateSubstitutionRequest' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateSubstitutionResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - /lm/scenarios/{scenario}/promptTemplates/{name}/versions/{version}/substitution: - post: - operationId: registry.controller.prompt_controller.parse_prompt_template_by_name_version - x-sap-cloud-sdk-operation-name: parsePromptTemplateByNameVersion - description: Parse prompt template by name and version - tags: - - prompt templates - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - $ref: '#/components/parameters/ai-resource-group-scope' - - name: scenario - in: path - required: true - schema: - type: string - - name: version - in: path - required: true - schema: - type: string - - name: name - in: path - required: true - schema: - type: string - - name: metadata - in: query - schema: - type: boolean - default: false - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateSubstitutionRequest' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptTemplateSubstitutionResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - /registry/v2/orchestrationConfigs: - post: - operationId: registry.controller.orchestration_config_controller.create_update_orchestration_config - x-sap-cloud-sdk-operation-name: createUpdateOrchestrationConfig - description: Create or update an orchestration config - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigPostRequest' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigPostResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - get: - operationId: registry.controller.orchestration_config_controller.list_orchestration_configs - x-sap-cloud-sdk-operation-name: listOrchestrationConfigs - description: List orchestration configs - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - name: scenario - in: query - schema: - type: string - - name: name - in: query - schema: - type: string - - name: version - in: query - schema: - type: string - - name: retrieve - in: query - schema: - type: string - default: both - enum: - - both - - imperative - - declarative - - name: include_spec - in: query - schema: - type: boolean - default: false - - name: resolve_template_ref - in: query - schema: - type: boolean - default: false - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - /registry/v2/scenarios/{scenario}/orchestrationConfigs/{name}/versions/{version}/history: - get: - operationId: registry.controller.orchestration_config_controller.list_orchestration_config_history - x-sap-cloud-sdk-operation-name: listOrchestrationConfigHistory - description: List orchestration config history - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - name: scenario - in: path - required: true - schema: - type: string - - name: version - in: path - required: true - schema: - type: string - - name: name - in: path - required: true - schema: - type: string - - name: include_spec - in: query - schema: - type: boolean - default: false - - name: resolve_template_ref - in: query - schema: - type: boolean - default: false - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - /registry/v2/orchestrationConfigs/{orchestrationConfigId}: - get: - operationId: registry.controller.orchestration_config_controller.get_orchestration_config_by_uuid - x-sap-cloud-sdk-operation-name: getOrchestrationConfigByUuid - description: Get orchestration config by UUID - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - name: orchestrationConfigId - in: path - required: true - schema: - type: string - format: uuid - - name: resolve_template_ref - in: query - schema: - type: boolean - default: false - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigGetResponse' - '400': - $ref: '#/components/responses/BadRequest' - '403': - $ref: '#/components/responses/ForbiddenError' - default: - $ref: '#/components/responses/CommonError' - delete: - operationId: registry.controller.orchestration_config_controller.delete_orchestration_config - x-sap-cloud-sdk-operation-name: deleteOrchestrationConfig - description: Delete orchestration config - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - name: orchestrationConfigId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigDeleteResponse' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFound' - default: - $ref: '#/components/responses/CommonError' - /registry/v2/orchestrationConfigs/import: - post: - operationId: registry.controller.orchestration_config_controller.import_orchestration_config - x-sap-cloud-sdk-operation-name: importOrchestrationConfig - description: Import orchestration config - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/OrchestrationConfigPostResponse' - '400': - $ref: '#/components/responses/BadRequest' - default: - $ref: '#/components/responses/CommonError' - /registry/v2/orchestrationConfigs/{orchestrationConfigId}/export: - get: - operationId: registry.controller.orchestration_config_controller.export_orchestration_config - x-sap-cloud-sdk-operation-name: exportOrchestrationConfig - description: Export orchestration config - tags: - - orchestration configs - parameters: - - $ref: '#/components/parameters/ai-resource-group' - - name: orchestrationConfigId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Successful response - content: - application/octet-stream: - schema: - type: string - format: binary - '400': - $ref: '#/components/responses/BadRequest' - default: - $ref: '#/components/responses/CommonError' -components: - schemas: - PromptTemplate: - oneOf: - - $ref: '#/components/schemas/SingleChatTemplate' - - $ref: '#/components/schemas/MultiChatTemplate' - SingleChatTemplate: - type: object - required: - - role - - content - additionalProperties: false - properties: - role: - type: string - content: - type: string - MultiChatTemplate: - type: object - required: - - role - - content - additionalProperties: false - properties: - role: - type: string - content: - type: array - items: - $ref: '#/components/schemas/MultiChatContent' - MultiChatContent: - oneOf: - - $ref: '#/components/schemas/ImageContent' - - $ref: '#/components/schemas/TextContent' - TextContent: - type: object - required: - - type - - text - additionalProperties: false - properties: - type: - type: string - enum: - - text - text: - type: string - ImageContent: - type: object - required: - - type - - image_url - properties: - type: - type: string - enum: - - image_url - image_url: - type: object - required: - - url - additionalProperties: false - properties: - url: - type: string - detail: - type: string - default: auto - PromptTemplateSpec: - type: object - required: - - template - additionalProperties: - type: object - properties: - template: - type: array - items: - $ref: '#/components/schemas/PromptTemplate' - defaults: - type: object - additionalFields: - type: object - description: | - DEPRECATED. Please use additional_fields instead. - deprecated: true - response_format: - description: | - Response format that the model output should adhere to. This is the same as the OpenAI definition. - Compatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. - oneOf: - - $ref: '#/components/schemas/ResponseFormatText' - - $ref: '#/components/schemas/ResponseFormatJsonObject' - - $ref: '#/components/schemas/ResponseFormatJsonSchema' - tools: - type: array - description: | - A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition. - items: - $ref: '#/components/schemas/ChatCompletionTool' - ResponseFormatText: - type: object - additionalProperties: false - properties: - type: - type: string - description: 'The type of response format being defined: `text`' - enum: - - text - required: - - type - ResponseFormatJsonObject: - type: object - additionalProperties: false - properties: - type: - type: string - description: 'The type of response format being defined: `json_object`' - enum: - - json_object - required: - - type - ResponseFormatJsonSchema: - type: object - additionalProperties: false - properties: - type: - type: string - description: 'The type of response format being defined: `json_schema`' - enum: - - json_schema - json_schema: - type: object - additionalProperties: false - properties: - description: - type: string - description: A description of what the response format is for, used by the model to determine how to respond in the format. - name: - type: string - description: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - pattern: ^[a-zA-Z0-9-_]+$ - maxLength: 64 - schema: - $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema' - strict: - type: boolean - nullable: true - default: false - description: Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - required: - - name - required: - - type - - json_schema - ResponseFormatJsonSchemaSchema: - type: object - description: The schema for the response format, described as a JSON Schema object. - additionalProperties: true - ChatCompletionTool: - type: object - additionalProperties: false - properties: - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - function: - $ref: '#/components/schemas/FunctionObject' - required: - - type - - function - FunctionObject: - type: object - additionalProperties: false - properties: - description: - type: string - description: A description of what the function does, used by the model to choose when and how to call the function. - name: - type: string - description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - pattern: ^[a-zA-Z0-9-_]+$ - maxLength: 64 - parameters: - $ref: '#/components/schemas/FunctionParameters' - strict: - type: boolean - nullable: true - default: false - description: Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling). - required: - - name - FunctionParameters: - type: object - description: The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list. - additionalProperties: true - PromptTemplatePostRequest: - type: object - required: - - name - - version - - scenario - - spec - properties: - name: - type: string - maxLength: 120 - pattern: ^[a-zA-Z0-9_-]+$ - version: - type: string - maxLength: 10 - pattern: ^[a-zA-Z0-9._-]+$ - scenario: - type: string - maxLength: 120 - pattern: ^[a-zA-Z0-9_-]+$ - spec: - $ref: '#/components/schemas/PromptTemplateSpec' - PromptTemplatePostResponse: - type: object - required: - - message - - id - - scenario - - name - - version - properties: - message: - type: string - id: - type: string - format: uuid - scenario: - type: string - name: - type: string - version: - type: string - PromptTemplateGetResponse: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - version: - type: string - scenario: - type: string - creationTimestamp: - type: string - format: timestamp - managedBy: - type: string - isVersionHead: - type: boolean - resourceGroupId: - type: string - spec: - $ref: '#/components/schemas/PromptTemplateSpec' - PromptTemplateListResponse: - type: object - required: - - count - - resources - properties: - count: - type: integer - resources: - type: array - items: - $ref: '#/components/schemas/PromptTemplateGetResponse' - PromptTemplateDeleteResponse: - type: object - required: - - message - properties: - message: - type: string - RuntimePromptTemplateFile: - type: object - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - properties: - name: - type: string - version: - type: string - scenario: - type: string - spec: - $ref: '#/components/schemas/PromptTemplateSpec' - PromptTemplateSubstitutionRequest: - type: object - properties: - inputParams: - type: object - PromptTemplateSubstitutionResponse: - type: object - properties: - parsedPrompt: - type: array - items: - $ref: '#/components/schemas/PromptTemplate' - resource: - $ref: '#/components/schemas/PromptTemplateGetResponse' - ErrorResponse: - type: object - required: - - request_id - - message - properties: - request_id: - type: string - message: - type: string - OrchestrationConfigResource: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - version: - type: string - scenario: - type: string - creation_timestamp: - type: string - format: timestamp - managed_by: - type: string - is_version_head: - type: boolean - resource_group_id: - type: string - spec: - $ref: '#/components/schemas/OrchestrationConfig' - OrchestrationConfigListResponse: - type: object - required: - - count - - resources - properties: - count: - type: integer - resources: - type: array - items: - $ref: '#/components/schemas/OrchestrationConfigGetResponse' - OrchestrationConfigPostRequest: - type: object - required: - - name - - version - - scenario - - spec - properties: - name: - type: string - maxLength: 120 - pattern: ^[a-zA-Z0-9_-]+$ - version: - type: string - maxLength: 10 - pattern: ^[a-zA-Z0-9._-]+$ - scenario: - type: string - maxLength: 120 - pattern: ^[a-zA-Z0-9_-]+$ - spec: - $ref: '#/components/schemas/OrchestrationConfig' - OrchestrationConfigPostResponse: - type: object - required: - - message - - id - - scenario - - name - - version - properties: - message: - type: string - id: - type: string - format: uuid - scenario: - type: string - name: - type: string - version: - type: string - OrchestrationConfigGetResponse: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - version: - type: string - scenario: - type: string - creation_timestamp: - type: string - format: timestamp - managed_by: - type: string - is_version_head: - type: boolean - resource_group_id: - type: string - spec: - $ref: '#/components/schemas/OrchestrationConfig' - OrchestrationConfigDeleteResponse: - type: object - required: - - message - properties: - message: - type: string - RuntimeOrchestrationConfigFile: - type: object - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - properties: - name: - type: string - version: - type: string - scenario: - type: string - spec: - $ref: '#/components/schemas/OrchestrationConfig' - ChatMessageContent: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/TextContent' - minItems: 1 - SystemChatMessage: - type: object - additionalProperties: false - properties: - role: - type: string - enum: - - system - content: - $ref: '#/components/schemas/ChatMessageContent' - required: - - role - - content - ImageContentUrl: - type: object - required: - - url - additionalProperties: false - properties: - url: - type: string - detail: - type: string - default: auto - UserChatMessageContentItem: - type: object - additionalProperties: false - properties: - type: - type: string - enum: - - text - - image_url - text: - type: string - image_url: - $ref: '#/components/schemas/ImageContentUrl' - required: - - type - UserChatMessageContent: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/UserChatMessageContentItem' - minItems: 1 - UserChatMessage: - type: object - additionalProperties: false - properties: - content: - $ref: '#/components/schemas/UserChatMessageContent' - role: - type: string - enum: - - user - required: - - content - - role - MessageToolCall: - type: object - properties: - id: - type: string - description: The ID of the tool call. - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - function: - type: object - description: The function that the model called. - properties: - name: - type: string - description: The name of the function to call. - arguments: - type: string - description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - required: - - name - - arguments - required: - - id - - type - - function - MessageToolCalls: - type: array - description: The tool calls generated by the model, such as function calls. - items: - $ref: '#/components/schemas/MessageToolCall' - AssistantChatMessage: - type: object - additionalProperties: false - properties: - role: - type: string - enum: - - assistant - content: - $ref: '#/components/schemas/ChatMessageContent' - refusal: - type: string - tool_calls: - $ref: '#/components/schemas/MessageToolCalls' - required: - - role - ToolChatMessage: - type: object - additionalProperties: false - properties: - role: - type: string - enum: - - tool - example: tool - tool_call_id: - type: string - content: - $ref: '#/components/schemas/ChatMessageContent' - required: - - role - - content - - tool_call_id - DeveloperChatMessage: - type: object - additionalProperties: false - properties: - role: - type: string - enum: - - developer - content: - $ref: '#/components/schemas/ChatMessageContent' - required: - - role - - content - ChatMessage: - oneOf: - - $ref: '#/components/schemas/SystemChatMessage' - - $ref: '#/components/schemas/UserChatMessage' - - $ref: '#/components/schemas/AssistantChatMessage' - - $ref: '#/components/schemas/ToolChatMessage' - - $ref: '#/components/schemas/DeveloperChatMessage' - TemplatingChatMessage: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/ChatMessage' - Template: - type: object - required: - - template - additionalProperties: false - properties: - template: - allOf: - - $ref: '#/components/schemas/TemplatingChatMessage' - description: A chat message array to be formatted with values from placeholder_values. Both role and content can be templated. If messages_history is provided, the templated messages will be appended. - defaults: - description: Optional default values for the template. If a parameter has no default it is required. - type: object - additionalProperties: - type: string - response_format: - description: | - Response format that the model output should adhere to. This is the same as the OpenAI definition. - oneOf: - - $ref: '#/components/schemas/ResponseFormatText' - - $ref: '#/components/schemas/ResponseFormatJsonObject' - - $ref: '#/components/schemas/ResponseFormatJsonSchema' - tools: - type: array - description: | - A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition. - items: - $ref: '#/components/schemas/ChatCompletionTool' - example: - template: - - role: user - content: How can the features of AI in SAP BTP specifically {{'{{?groundingOutput}}'}}, be applied to {{'{{?inputContext}}'}} - defaults: - inputContext: The default text that will be used in the template if inputContext is not set - TemplateRefByID: - type: object - required: - - id - additionalProperties: false - properties: - id: - type: string - description: ID of the template in prompt registry - example: template_id - scope: - type: string - description: | - Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared across all resource groups within the tenant, while 'resource_group' indicates the template is only accessible within the specific resource group. - enum: - - resource_group - - tenant - default: tenant - TemplateRefByScenarioNameVersion: - type: object - required: - - scenario - - name - - version - additionalProperties: false - properties: - scenario: - type: string - description: Scenario name - example: some-scenario - name: - type: string - description: Name of the template - example: some-template-name - version: - type: string - description: Version of the template - example: some version, can be `latest` - scope: - type: string - description: | - Defines the scope that is searched for the referenced template. 'tenant' indicates the template is shared across all resource groups within the tenant, while 'resource_group' indicates the template is only accessible within the specific resource group. - enum: - - resource_group - - tenant - default: tenant - TemplateRef: - type: object - required: - - template_ref - additionalProperties: false - properties: - template_ref: - description: Reference to a template in the prompt registry by ID or by scenario, name and version - oneOf: - - $ref: '#/components/schemas/TemplateRefByID' - - $ref: '#/components/schemas/TemplateRefByScenarioNameVersion' - LLMModelDetails: - type: object - description: | - The model and parameters to be used for the prompt templating. This is the model that will be used to generate the response. - required: - - name - additionalProperties: false - properties: - name: - type: string - description: Name of the model as in LLM Access configuration - example: gpt-4o-mini - version: - type: string - description: Version of the model to be used - default: latest - params: - type: object - description: Additional parameters for the model. Default values are used for mandatory parameters. - additionalProperties: true - example: - max_tokens: 300 - temperature: 0.1 - frequency_penalty: 0 - presence_penalty: 0 - 'n': 2 - stream_options: - include_usage: true - timeout: - description: Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. - type: integer - default: 600 - minimum: 1 - maximum: 600 - max_retries: - description: Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI models. - type: integer - default: 2 - minimum: 0 - maximum: 5 - PromptTemplatingModuleConfig: - type: object - required: - - prompt - - model - additionalProperties: false - properties: - prompt: - description: | - The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. - oneOf: - - $ref: '#/components/schemas/Template' - - $ref: '#/components/schemas/TemplateRef' - model: - $ref: '#/components/schemas/LLMModelDetails' - AzureThreshold: - type: integer - enum: - - 0 - - 2 - - 4 - - 6 - example: 0 - AzureContentSafetyInput: - description: Filter configuration for Azure Content Safety - type: object - additionalProperties: false - properties: - hate: - $ref: '#/components/schemas/AzureThreshold' - self_harm: - $ref: '#/components/schemas/AzureThreshold' - sexual: - $ref: '#/components/schemas/AzureThreshold' - violence: - $ref: '#/components/schemas/AzureThreshold' - prompt_shield: - type: boolean - description: Filter prompts for harmful content such as jailbreaks and prompt injections. - default: false - AzureContentSafetyInputFilterConfig: - type: object - required: - - type - additionalProperties: false - properties: - type: - description: Name of the filter provider type - type: string - enum: - - azure_content_safety - example: azure_content_safety - config: - $ref: '#/components/schemas/AzureContentSafetyInput' - LlamaGuard38b: - description: Filter configuration for Llama Guard 3 8B - type: object - additionalProperties: false - minProperties: 1 - properties: - violent_crimes: - type: boolean - non_violent_crimes: - type: boolean - sex_crimes: - type: boolean - child_exploitation: - type: boolean - defamation: - type: boolean - specialized_advice: - type: boolean - privacy: - type: boolean - intellectual_property: - type: boolean - indiscriminate_weapons: - type: boolean - hate: - type: boolean - self_harm: - type: boolean - sexual_content: - type: boolean - elections: - type: boolean - code_interpreter_abuse: - type: boolean - LlamaGuard38bFilterConfig: - type: object - required: - - type - - config - additionalProperties: false - properties: - type: - description: Name of the filter provider type - type: string - enum: - - llama_guard_3_8b - example: llama_guard_3_8b - config: - $ref: '#/components/schemas/LlamaGuard38b' - InputFilterConfig: - oneOf: - - $ref: '#/components/schemas/AzureContentSafetyInputFilterConfig' - - $ref: '#/components/schemas/LlamaGuard38bFilterConfig' - InputFilteringConfig: - type: object - required: - - filters - additionalProperties: false - properties: - filters: - description: Configuration for content filtering services that should be used for the given filtering step (input filtering). - type: array - minItems: 1 - items: - $ref: '#/components/schemas/InputFilterConfig' - AzureContentSafetyOutput: - description: Filter configuration for Azure Content Safety - type: object - additionalProperties: false - properties: - hate: - $ref: '#/components/schemas/AzureThreshold' - self_harm: - $ref: '#/components/schemas/AzureThreshold' - sexual: - $ref: '#/components/schemas/AzureThreshold' - violence: - $ref: '#/components/schemas/AzureThreshold' - protected_material_code: - type: boolean - description: Detect protected code content from known GitHub repositories. The scan includes software libraries, source code, algorithms, and other proprietary programming content. - default: false - AzureContentSafetyOutputFilterConfig: - type: object - required: - - type - additionalProperties: false - properties: - type: - description: Name of the filter provider type - type: string - enum: - - azure_content_safety - example: azure_content_safety - config: - $ref: '#/components/schemas/AzureContentSafetyOutput' - OutputFilterConfig: - oneOf: - - $ref: '#/components/schemas/AzureContentSafetyOutputFilterConfig' - - $ref: '#/components/schemas/LlamaGuard38bFilterConfig' - FilteringStreamOptions: - description: Stream options for output filtering. Will be ignored if stream is false. - type: object - additionalProperties: false - properties: - overlap: - type: integer - description: Number of characters that should be additionally sent to content filtering services from previous chunks as additional context. - default: 0 - minimum: 0 - maximum: 10000 - OutputFilteringConfig: - type: object - required: - - filters - additionalProperties: false - properties: - filters: - description: Configuration for content filtering services that should be used for the given filtering step (output filtering). - type: array - minItems: 1 - items: - $ref: '#/components/schemas/OutputFilterConfig' - stream_options: - $ref: '#/components/schemas/FilteringStreamOptions' - FilteringModuleConfig: - type: object - additionalProperties: false - properties: - input: - allOf: - - $ref: '#/components/schemas/InputFilteringConfig' - description: List of provider type and filters - output: - allOf: - - $ref: '#/components/schemas/OutputFilteringConfig' - description: List of provider type and filters - minProperties: 1 - DPIEntities: - description: Default entities supported by data privacy and integration service - type: string - enum: - - profile-person - - profile-org - - profile-university - - profile-location - - profile-email - - profile-phone - - profile-address - - profile-sapids-internal - - profile-sapids-public - - profile-url - - profile-username-password - - profile-nationalid - - profile-iban - - profile-ssn - - profile-credit-card-number - - profile-passport - - profile-driverlicense - - profile-nationality - - profile-religious-group - - profile-political-group - - profile-pronouns-gender - - profile-ethnicity - - profile-gender - - profile-sexual-orientation - - profile-trade-union - - profile-sensitive-data - DPIMethodConstant: - description: Replaces the entity with the specified value followed by an incrementing number - type: object - required: - - method - - value - additionalProperties: false - properties: - method: - type: string - enum: - - constant - value: - description: Value to be used for replacement - example: NAME_REDACTED - type: string - DPIMethodFabricatedData: - description: Replaces the entity with a randomly generated value appropriate to its type. - type: object - required: - - method - additionalProperties: false - properties: - method: - type: string - enum: - - fabricated_data - DPIStandardEntity: - type: object - required: - - type - additionalProperties: false - properties: - type: - $ref: '#/components/schemas/DPIEntities' - replacement_strategy: - description: Replacement strategy to be used for the entity - oneOf: - - $ref: '#/components/schemas/DPIMethodConstant' - - $ref: '#/components/schemas/DPIMethodFabricatedData' - DPICustomEntity: - type: object - required: - - regex - - replacement_strategy - additionalProperties: false - properties: - regex: - description: Regular expression to match the entity - type: string - replacement_strategy: - description: Replacement strategy to be used for the entity - oneOf: - - $ref: '#/components/schemas/DPIMethodConstant' - DPIEntityConfig: - oneOf: - - $ref: '#/components/schemas/DPIStandardEntity' - - $ref: '#/components/schemas/DPICustomEntity' - DPIConfig: - type: object - required: - - type - - method - - entities - additionalProperties: false - properties: - type: - description: Type of masking service provider - type: string - enum: - - sap_data_privacy_integration - method: - description: Type of masking method to be used - type: string - enum: - - anonymization - - pseudonymization - entities: - description: List of entities to be masked - type: array - minItems: 1 - items: - $ref: '#/components/schemas/DPIEntityConfig' - allowlist: - description: List of strings that should not be masked - type: array - example: - - SAP - - Joule - items: - type: string - mask_grounding_input: - type: object - additionalProperties: false - properties: - enabled: - type: boolean - default: false - description: controls whether the input to the grounding module will be masked with the configuration supplied in the masking module - MaskingProviderConfig: - oneOf: - - $ref: '#/components/schemas/DPIConfig' - MaskingModuleConfig: - oneOf: - - type: object - title: MaskingModuleConfigProviders - properties: - providers: - description: List of masking service providers - type: array - minItems: 1 - items: - $ref: '#/components/schemas/MaskingProviderConfig' - required: - - providers - additionalProperties: false - - type: object - title: MaskingModuleConfigMaskingProviders - properties: - masking_providers: - deprecated: true - description: 'List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` property instead.' - type: array - minItems: 1 - items: - $ref: '#/components/schemas/MaskingProviderConfig' - required: - - masking_providers - additionalProperties: false - GroundingFilterId: - title: Id - description: Identifier of this SearchFilter - unique per request. - type: string - GroundingFilterSearchConfiguration: - additionalProperties: false - properties: - max_chunk_count: - type: integer - minimum: 0 - exclusiveMinimum: true - title: Maxchunkcount - description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. - max_document_count: - type: integer - minimum: 0 - exclusiveMinimum: true - title: Maxdocumentcount - description: '[Only supports ''vector'' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used with ''maxChunkCount''. If maxDocumentCount is given, then only one chunk per document is returned.' - title: SearchConfiguration - minProperties: 0 - maxProperties: 1 - DataRepositoryType: - type: string - description: Only include DataRepositories with the given type. - enum: - - vector - - help.sap.com - title: DataRepositoryType - KeyValueListPair: - additionalProperties: false - properties: - key: - type: string - maxLength: 1024 - title: Key - value: - type: array - items: - type: string - maxLength: 1024 - title: Value - type: object - required: - - key - - value - title: KeyValueListPair - SearchSelectOptionEnum: - type: string - enum: - - ignoreIfKeyAbsent - title: SearchSelectOptionEnum - SearchDocumentKeyValueListPair: - additionalProperties: false - properties: - key: - type: string - maxLength: 1024 - title: Key - value: - type: array - items: - type: string - maxLength: 1024 - title: Value - select_mode: - type: array - items: - $ref: '#/components/schemas/SearchSelectOptionEnum' - title: Selectmode - description: Select mode for search filters - type: object - required: - - key - - value - title: SearchDocumentKeyValueListPair - DocumentGroundingFilter: - type: object - required: - - data_repository_type - additionalProperties: false - properties: - id: - $ref: '#/components/schemas/GroundingFilterId' - search_config: - $ref: '#/components/schemas/GroundingFilterSearchConfiguration' - data_repositories: - type: array - items: - type: string - title: DataRepositories - description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. - default: - - '*' - data_repository_type: - $ref: '#/components/schemas/DataRepositoryType' - data_repository_metadata: - type: array - items: - $ref: '#/components/schemas/KeyValueListPair' - title: Datarepositorymetadata - description: Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when combined with dataRepositories=['*'] - document_metadata: - type: array - items: - $ref: '#/components/schemas/SearchDocumentKeyValueListPair' - title: Documentmetadata - description: Restrict documents considered during search to those annotated with the given metadata. - chunk_metadata: - type: array - items: - $ref: '#/components/schemas/KeyValueListPair' - title: Chunkmetadata - description: Restrict chunks considered during search to those with the given metadata. - minProperties: 1 - GroundingModuleConfig: - type: object - required: - - type - - config - additionalProperties: false - properties: - type: - type: string - anyOf: - - enum: - - document_grounding_service - - {} - example: document_grounding_service - config: - type: object - required: - - placeholders - additionalProperties: false - properties: - filters: - type: array - items: - oneOf: - - $ref: '#/components/schemas/DocumentGroundingFilter' - description: Document grounding service filters to be used - placeholders: - type: object - additionalProperties: false - required: - - input - - output - properties: - input: - type: array - minItems: 1 - items: - type: string - example: groundingInput - description: Contains the input parameters used for grounding input questions - output: - type: string - description: Placeholder name for grounding output - example: groundingOutput - description: Placeholders to be used for grounding input questions and output - metadata_params: - type: array - items: - type: string - description: Parameter name used for specifying metadata parameters - SAPDocumentTranslationApplyToSelector: - type: object - description: | - This selector allows you to define the scope of translation, such as specific placeholders or messages with specific roles. For example, `{"category": "placeholders", "items": ["user_input"], "source_language": "de-DE"}` targets the value of "user_input" in `placeholder_values` specified in the request payload; and considers the value to be in German. - required: - - category - - items - additionalProperties: false - properties: - category: - type: string - description: Category to apply translation to. - enum: - - placeholders - - template_roles - items: - type: array - description: List of placeholders or roles to apply translation to - items: - type: string - example: - - groundingInput - - inputContext - source_language: - type: string - description: Language of the text to be translated. - example: de-DE - SAPDocumentTranslationInput: - type: object - required: - - type - - config - additionalProperties: false - properties: - type: - description: Type of document translation provider - type: string - enum: - - sap_document_translation - example: sap_document_translation - translate_messages_history: - type: boolean - description: If true, the messages history will be translated as well. - default: true - config: - description: Configuration for `sap_document_translation` translation provider. - type: object - additionalProperties: false - required: - - target_language - properties: - source_language: - type: string - description: Language of the text to be translated. - example: de-DE - apply_to: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/SAPDocumentTranslationApplyToSelector' - target_language: - type: string - description: Language to which the text should be translated. - example: en-US - SAPDocumentTranslationOutputTargetLanguage: - oneOf: - - type: string - description: Language to which the text should be translated. - example: en-US - - $ref: '#/components/schemas/SAPDocumentTranslationApplyToSelector' - SAPDocumentTranslationOutput: - type: object - required: - - type - - config - additionalProperties: false - properties: - type: - description: Configuration for `sap_document_translation` translation provider. - type: string - enum: - - sap_document_translation - example: sap_document_translation - config: - type: object - additionalProperties: false - required: - - target_language - properties: - source_language: - type: string - description: Language of the text to be translated. - example: de-DE - target_language: - $ref: '#/components/schemas/SAPDocumentTranslationOutputTargetLanguage' - TranslationModuleConfig: - type: object - description: Configuration for translation module - additionalProperties: false - properties: - input: - description: Configuration for input translation - oneOf: - - $ref: '#/components/schemas/SAPDocumentTranslationInput' - output: - description: Configuration for output translation - oneOf: - - $ref: '#/components/schemas/SAPDocumentTranslationOutput' - ModuleConfigs: - type: object - required: - - prompt_templating - additionalProperties: false - properties: - prompt_templating: - $ref: '#/components/schemas/PromptTemplatingModuleConfig' - filtering: - $ref: '#/components/schemas/FilteringModuleConfig' - masking: - $ref: '#/components/schemas/MaskingModuleConfig' - grounding: - $ref: '#/components/schemas/GroundingModuleConfig' - translation: - $ref: '#/components/schemas/TranslationModuleConfig' - GlobalStreamOptions: - description: Options for streaming. Will be ignored if enabled is false. - type: object - additionalProperties: false - properties: - enabled: - type: boolean - description: If true, the response will be streamed back to the client - default: false - chunk_size: - type: integer - description: Minimum number of characters per chunk that post-LLM modules operate on. - default: 100 - minimum: 1 - maximum: 10000 - delimiters: - type: array - minItems: 1 - description: List of delimiters to split the input text into chunks.Please note, this is a required parameter when `input_translation_module_config` or `output_translation_module_config` are configured. - items: - type: string - example: - - |+ - - - . - - '?' - - '!' - OrchestrationConfig: - type: object - required: - - modules - additionalProperties: false - properties: - modules: - $ref: '#/components/schemas/ModuleConfigs' - stream: - $ref: '#/components/schemas/GlobalStreamOptions' - responses: - BadRequest: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - CommonError: - description: Common Error - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - ForbiddenError: - description: Forbidden Error - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - NotFound: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - parameters: - ai-resource-group: - name: AI-Resource-Group - in: header - description: Specify a resource group id to use - required: false - schema: - type: string - ai-resource-group-scope: - name: AI-Resource-Group-Scope - in: header - description: Specify whether the resource group scope is to be used - required: false - schema: - type: string - enum: - - 'true' - - 'True' - - 'false' - - 'False' From 59fedb18913c6d1003251a0d239598594d66808b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 30 Dec 2025 15:41:15 +0100 Subject: [PATCH 22/25] Add apache/OpenApiResponse instead of void returns --- .../services/openapi/apache/ApiClient.java | 1 + .../apache/DefaultApiResponseHandler.java | 12 +++- .../openapi/apache/OpenApiResponse.java | 30 +++++++++ .../libraries/apache-httpclient/api.mustache | 63 ++++++++++--------- .../apache-httpclient/operationBody.mustache | 8 +-- 5 files changed, 79 insertions(+), 35 deletions(-) create mode 100644 datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/OpenApiResponse.java diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 78cb9a4d7..52e309180 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -486,6 +486,7 @@ private static boolean isBodyAllowed( String method ) * API exception */ @Beta + @Nonnull public T invokeAPI( String path, String method, diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java index a274d3961..c78a71c1f 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java @@ -108,11 +108,10 @@ private T processResponse( ClassicHttpResponse response ) return null; } - Map> responseHeaders = transformResponseHeaders(response.getHeaders()); - if( isSuccessfulStatus(statusCode) ) { return deserialize(response); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); String message = EntityUtils.toString(response.getEntity()); throw new OpenApiRequestException(message).statusCode(statusCode).responseHeaders(responseHeaders); } @@ -140,8 +139,15 @@ private T deserialize( ClassicHttpResponse response ) if( returnType == null ) { return null; } + + final Type valueRawType = returnType.getType(); + if( valueRawType.equals(OpenApiResponse.class) ) { + final int statusCode = response.getCode(); + Map> headers = transformResponseHeaders(response.getHeaders()); + return (T) new OpenApiResponse(statusCode, headers); + } + HttpEntity entity = response.getEntity(); - Type valueRawType = returnType.getType(); if( valueRawType.equals(byte[].class) ) { return (T) EntityUtils.toByteArray(entity); } else if( valueRawType.equals(File.class) ) { diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/OpenApiResponse.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/OpenApiResponse.java new file mode 100644 index 000000000..f4cc3c35d --- /dev/null +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/OpenApiResponse.java @@ -0,0 +1,30 @@ +package com.sap.cloud.sdk.services.openapi.apache; + +import java.util.List; +import java.util.Map; + +import javax.annotation.Nonnull; + +import lombok.Getter; + +/** + * Response object for Apache HTTP client OpenAPI calls containing status code and headers + */ +@Getter +public class OpenApiResponse +{ + + private final int statusCode; + + @Nonnull + private final Map> headers; + + /** + * Create a new OpenApiResponse with status code and headers. + */ + OpenApiResponse( final int statusCode, @Nonnull final Map> headers ) + { + this.statusCode = statusCode; + this.headers = Map.copyOf(headers); + } +} diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 1c7c2559b..57acb3098 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -9,17 +9,18 @@ package {{package}}; import com.fasterxml.jackson.core.type.TypeReference; import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import {{invokerPackage}}.ApiClient; -import {{invokerPackage}}.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.OpenApiResponse; +import com.sap.cloud.sdk.services.openapi.apache.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.Pair; + {{#models.0}} import {{modelPackage}}.*; {{/models.0}} -import {{invokerPackage}}.Pair; {{#imports}}import {{import}}; {{/imports}} - import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -106,34 +107,37 @@ public class {{classname}} extends BaseApi { *

{{summary}} *

{{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}} + *

{{code}}{{#message}} - {{message}}{{/message}} {{/responses}} {{#allParams}} - * @param {{paramName}} {{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} - {{#description}} - * {{description}} - {{/description}} - {{^description}} - * The value for the parameter {{paramName}} - {{/description}} + * @param {{paramName}} {{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + {{#description}} + * {{description}} + {{/description}} + {{^description}} + * The value for the parameter {{paramName}} + {{/description}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{returnType}} + {{/returnType}} + {{^returnType}} + * @return An OpenApiResponse containing the status code of the HttpResponse. {{/returnType}} * @throws OpenApiRequestException if an error occurs while attempting to invoke the API {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation + * {{description}} + * @see {{summary}} Documentation {{/externalDocs}} {{#isDeprecated}} - * @deprecated + * @deprecated {{/isDeprecated}} */ {{#isDeprecated}} - @Deprecated + @Deprecated {{/isDeprecated}} {{#vendorExtensions.x-return-nullable}}@Nullable{{/vendorExtensions.x-return-nullable}}{{^vendorExtensions.x-return-nullable}}@Nonnull{{/vendorExtensions.x-return-nullable}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}OpenApiResponse {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#allParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws OpenApiRequestException { {{>operationBody}} } {{/hasOptionalParams}} @@ -142,19 +146,22 @@ public class {{classname}} extends BaseApi { *

{{summary}} *

{{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}} + *

{{code}}{{#message}} - {{message}}{{/message}} {{/responses}} {{#requiredParams}} - * @param {{paramName}} - {{#description}} - * {{description}} - {{/description}} - {{^description}} - * The value for the parameter {{paramName}} - {{/description}} + * @param {{paramName}} + {{#description}} + * {{description}} + {{/description}} + {{^description}} + * The value for the parameter {{paramName}} + {{/description}} {{/requiredParams}} {{#returnType}} - * @return {{returnType}} + * @return {{returnType}} + {{/returnType}} + {{^returnType}} + * @return An OpenApiResponse containing the status code of the HttpResponse. {{/returnType}} * @throws OpenApiRequestException if an error occurs while attempting to invoke the API {{#externalDocs}} @@ -169,7 +176,7 @@ public class {{classname}} extends BaseApi { @Deprecated {{/isDeprecated}} {{#vendorExtensions.x-return-nullable}}@Nullable{{/vendorExtensions.x-return-nullable}}{{^vendorExtensions.x-return-nullable}}@Nonnull{{/vendorExtensions.x-return-nullable}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#requiredParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) throws OpenApiRequestException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}OpenApiResponse {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#requiredParams}}{{>nullable_var_annotations}} final {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) throws OpenApiRequestException { {{#hasOptionalParams}} {{#returnType}}return {{/returnType}}{{#vendorExtensions.x-sap-cloud-sdk-operation-name}}{{vendorExtensions.x-sap-cloud-sdk-operation-name}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}{{^vendorExtensions.x-sap-cloud-sdk-operation-name}}{{operationId}}{{/vendorExtensions.x-sap-cloud-sdk-operation-name}}({{#hasRequiredParams}}{{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}, {{/hasRequiredParams}}{{#optionalParams}}null{{^-last}}, {{/-last}}{{/optionalParams}}); {{/hasOptionalParams}} diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache index 8d92947dc..7f9138e97 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/operationBody.mustache @@ -74,12 +74,12 @@ final Map localVarFormParams = new HashMap(); final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); {{#returnType}} - final TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; - return apiClient.invokeAPI( + final TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; {{/returnType}} {{^returnType}} - apiClient.invokeAPI( + final TypeReference localVarReturnType = new TypeReference() {}; {{/returnType}} + return apiClient.invokeAPI( localVarPath, "{{httpMethod}}", localVarQueryParams, @@ -90,5 +90,5 @@ final Map localVarFormParams = new HashMap(); localVarFormParams, localVarAccept, localVarContentType, - {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} + localVarReturnType ); From c5cba534999cb0e12ec2440f8296e45de5aa5d41 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 30 Dec 2025 16:36:56 +0100 Subject: [PATCH 23/25] Remove guava dependency --- datamodel/openapi/openapi-api-apache-sample/pom.xml | 5 +---- .../sdk/datamodel/openapi/apache/sample/api/OrdersApi.java | 3 --- .../sdk/datamodel/openapi/apache/sample/api/SodasApi.java | 3 --- .../sdk/datamodel/openapi/apache/sample/model/AllOf.java | 4 +--- .../sdk/datamodel/openapi/apache/sample/model/AnyOf.java | 4 +--- .../cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java | 4 +--- .../sdk/datamodel/openapi/apache/sample/model/Cola.java | 4 +--- .../datamodel/openapi/apache/sample/model/ColaBarCode.java | 3 --- .../sdk/datamodel/openapi/apache/sample/model/ColaLogo.java | 3 --- .../sdk/datamodel/openapi/apache/sample/model/Fanta.java | 4 +--- .../datamodel/openapi/apache/sample/model/FantaFlavor.java | 2 -- .../datamodel/openapi/apache/sample/model/FlavorType.java | 4 +--- .../cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java | 4 +--- .../sdk/datamodel/openapi/apache/sample/model/OneOf.java | 2 -- .../openapi/apache/sample/model/OneOfWithDiscriminator.java | 2 -- .../sample/model/OneOfWithDiscriminatorAndMapping.java | 2 -- .../apache/sample/model/OneOfWithEnumDiscriminator.java | 2 -- .../sdk/datamodel/openapi/apache/sample/model/Order.java | 4 +--- .../openapi/apache/sample/model/OrderWithTimestamp.java | 4 +--- .../sdk/datamodel/openapi/apache/sample/model/Soda.java | 4 +--- .../datamodel/openapi/apache/sample/model/SodaWithId.java | 4 +--- .../libraries/apache-httpclient/api.mustache | 3 --- 22 files changed, 12 insertions(+), 62 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/pom.xml b/datamodel/openapi/openapi-api-apache-sample/pom.xml index 0092dbf29..fa4e3a803 100644 --- a/datamodel/openapi/openapi-api-apache-sample/pom.xml +++ b/datamodel/openapi/openapi-api-apache-sample/pom.xml @@ -26,10 +26,6 @@ com.sap.cloud.sdk.cloudplatform cloudplatform-connectivity - - com.google.guava - guava - com.fasterxml.jackson.core jackson-core @@ -45,6 +41,7 @@ com.sap.cloud.sdk.datamodel openapi-generator-maven-plugin + released ${project.basedir}/src/main/java true true diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java index 4b30d9a4c..65602b693 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/OrdersApi.java @@ -13,7 +13,6 @@ import javax.annotation.Nonnull; import com.fasterxml.jackson.core.type.TypeReference; -import com.google.common.annotations.Beta; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Order; import com.sap.cloud.sdk.services.openapi.apache.ApiClient; @@ -26,7 +25,6 @@ * * API for managing soda products and orders in SodaStore. */ -@Beta public class OrdersApi extends BaseApi { @@ -54,7 +52,6 @@ public OrdersApi( @Nonnull final Destination httpDestination ) * @param apiClient * ApiClient to invoke the API on */ - @Beta public OrdersApi( @Nonnull final ApiClient apiClient ) { super(apiClient); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java index a08f0f7c7..fbd776b6c 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/api/SodasApi.java @@ -15,7 +15,6 @@ import javax.annotation.Nullable; import com.fasterxml.jackson.core.type.TypeReference; -import com.google.common.annotations.Beta; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.Soda; import com.sap.cloud.sdk.datamodel.openapi.apache.sample.model.SodaWithId; @@ -29,7 +28,6 @@ * * API for managing soda products and orders in SodaStore. */ -@Beta public class SodasApi extends BaseApi { @@ -57,7 +55,6 @@ public SodasApi( @Nonnull final Destination httpDestination ) * @param apiClient * ApiClient to invoke the API on */ - @Beta public SodasApi( @Nonnull final ApiClient apiClient ) { super(apiClient); diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java index d6462cc87..ced49cf22 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AllOf.java @@ -28,13 +28,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * AllOf */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class AllOf // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java index 97f8d677f..f1f51e2d1 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/AnyOf.java @@ -28,13 +28,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * AnyOf */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class AnyOf // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java index 55111820b..d7b296253 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Bar.java @@ -30,13 +30,11 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; /** * Bar */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class Bar implements OneOfWithEnumDiscriminator // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java index 7d5bb90be..4d89ee770 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Cola.java @@ -28,13 +28,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * Cola */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class Cola implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java index 6ca5fa9dc..eb8bf12c2 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaBarCode.java @@ -20,12 +20,9 @@ import javax.annotation.Nonnull; -import com.google.common.annotations.Beta; - /** * ColaBarCode */ -@Beta public interface ColaBarCode { /** diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java index 84624d0e3..3191d9a4a 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/ColaLogo.java @@ -19,12 +19,9 @@ import javax.annotation.Nonnull; -import com.google.common.annotations.Beta; - /** * ColaLogo */ -@Beta public interface ColaLogo { /** diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java index 0215af3cb..aad7447f3 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Fanta.java @@ -28,13 +28,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * Fanta */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class Fanta implements OneOf, OneOfWithDiscriminator, OneOfWithDiscriminatorAndMapping // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java index 143119694..36883f283 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FantaFlavor.java @@ -21,12 +21,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; /** * FantaFlavor */ -@Beta public interface FantaFlavor { /** diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java index e95740c27..150bb8dc4 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/FlavorType.java @@ -28,13 +28,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * FlavorType */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class FlavorType // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java index 963d22d89..6c52ebe13 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Foo.java @@ -30,13 +30,11 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; /** * Foo */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class Foo implements OneOfWithEnumDiscriminator // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java index 491aeb64a..42b50cb7a 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOf.java @@ -17,12 +17,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; /** * OneOf */ -@Beta @JsonTypeInfo( use = JsonTypeInfo.Id.DEDUCTION ) @JsonSubTypes( { @JsonSubTypes.Type( value = Cola.class ), @JsonSubTypes.Type( value = Fanta.class ), } ) diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java index f71818d41..eefc01778 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminator.java @@ -17,12 +17,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; /** * OneOfWithDiscriminator */ -@Beta @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true ) @JsonSubTypes( { @JsonSubTypes.Type( value = Cola.class, name = "Cola" ), diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java index f9742cbd8..8a6ff0271 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithDiscriminatorAndMapping.java @@ -17,12 +17,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; /** * OneOfWithDiscriminatorAndMapping */ -@Beta @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "sodaType", visible = true ) @JsonSubTypes( { @JsonSubTypes.Type( value = Cola.class, name = "cool_cola" ), diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java index c8657f4cb..4414cd99b 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OneOfWithEnumDiscriminator.java @@ -17,12 +17,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.common.annotations.Beta; /** * OneOfWithEnumDiscriminator */ -@Beta @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "disc", visible = true ) @JsonSubTypes( { @JsonSubTypes.Type( value = Bar.class, name = "disc_bar" ), diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java index dfae11431..87df617d1 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Order.java @@ -28,13 +28,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * Order */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class Order // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java index 709b90bb9..a36dee610 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/OrderWithTimestamp.java @@ -29,13 +29,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; /** * OrderWithTimestamp */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class OrderWithTimestamp // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java index 3f334cdf3..8898b95c2 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/Soda.java @@ -30,13 +30,11 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; /** * Soda */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class Soda // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java index efe0b425e..cb5b7a12f 100644 --- a/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java +++ b/datamodel/openapi/openapi-api-apache-sample/src/main/java/com/sap/cloud/sdk/datamodel/openapi/apache/sample/model/SodaWithId.java @@ -30,13 +30,11 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.annotations.Beta; /** * SodaWithId */ - -@Beta // CHECKSTYLE:OFF +// CHECKSTYLE:OFF public class SodaWithId // CHECKSTYLE:ON { diff --git a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache index 57acb3098..e6a5a6b92 100644 --- a/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache +++ b/datamodel/openapi/openapi-generator/src/main/resources/openapi-generator/mustache-templates/libraries/apache-httpclient/api.mustache @@ -31,7 +31,6 @@ import java.util.StringJoiner; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import com.google.common.annotations.Beta; {{^aiSdkConstructor}}import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; {{/aiSdkConstructor}} @@ -50,7 +49,6 @@ import com.google.common.annotations.Beta; * {{#appDescription}}{{{appDescription}}}{{/appDescription}}{{^appDescription}}No description provided.{{/appDescription}} */ {{!>generatedAnnotation}} -{{^isReleased}}@Beta{{/isReleased}} {{#operations}} public class {{classname}} extends BaseApi { @@ -76,7 +74,6 @@ public class {{classname}} extends BaseApi { * @param apiClient * ApiClient to invoke the API on */ - @Beta public {{classname}}(@Nonnull final ApiClient apiClient) { super(apiClient); } From e6ec8b96ac864c241b5130c5f55a4b78d65b0088 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 2 Jan 2026 10:55:45 +0100 Subject: [PATCH 24/25] Update apache pom for general and generator configuration --- .../openapi/openapi-api-apache-sample/pom.xml | 58 +++++++++++++------ datamodel/openapi/openapi-api-sample/pom.xml | 1 - 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/datamodel/openapi/openapi-api-apache-sample/pom.xml b/datamodel/openapi/openapi-api-apache-sample/pom.xml index fa4e3a803..595c907ce 100644 --- a/datamodel/openapi/openapi-api-apache-sample/pom.xml +++ b/datamodel/openapi/openapi-api-apache-sample/pom.xml @@ -8,15 +8,28 @@ openapi-parent 5.26.0-SNAPSHOT - openapi-api-apache-sample - - - 22 - 22 - UTF-8 - - + Data Model - OpenAPI Services - Sample API + Sample generated API classes of the OpenAPI VDM + https://sap.github.io/cloud-sdk/docs/java/getting-started + + SAP SE + https://www.sap.com + + + + The Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + SAP + cloudsdk@sap.com + SAP SE + https://www.sap.com + + com.sap.cloud.sdk.datamodel @@ -43,12 +56,23 @@ released ${project.basedir}/src/main/java - true true - sample-generation + sample-apache-swagger-v2 + generate-sources + + generate + + + ${project.basedir}/src/main/resources/petstore-swagger2.json + com.sap.cloud.sdk.datamodel.openapi.petstore.api + com.sap.cloud.sdk.datamodel.openapi.petstore.model + + + + sample-apache-openapi-v3 generate @@ -58,19 +82,17 @@ com.sap.cloud.sdk.datamodel.openapi.apache.sample.api com.sap.cloud.sdk.datamodel.openapi.apache.sample.model - true - com.sap.cloud.sdk.services.openapi.apache apache-httpclient false - true - true - true - \. - 3 - + create protected + true true + true + true + true + true diff --git a/datamodel/openapi/openapi-api-sample/pom.xml b/datamodel/openapi/openapi-api-sample/pom.xml index 1bff0e213..251db764b 100644 --- a/datamodel/openapi/openapi-api-sample/pom.xml +++ b/datamodel/openapi/openapi-api-sample/pom.xml @@ -126,7 +126,6 @@ File=byte[] create - protected true true From eb214537014c23cff4378fd60da52dedd8a5013b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 8 Jan 2026 11:52:58 +0100 Subject: [PATCH 25/25] Borrow downstream PR changes - Make ApiClient almost `@Value` - fix url building with "//" - Fix vulnerabilities of payload leak in exception messages --- .../services/openapi/apache/ApiClient.java | 25 ++++++++++++------- .../apache/DefaultApiResponseHandler.java | 12 +++++++-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java index 52e309180..24682ece6 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/ApiClient.java @@ -66,31 +66,33 @@ import com.sap.cloud.sdk.services.openapi.apiclient.RFC3339DateFormat; import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import lombok.AccessLevel; import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.ToString; import lombok.Value; import lombok.With; -@Value -@Getter( AccessLevel.NONE ) @AllArgsConstructor( access = PRIVATE ) +@EqualsAndHashCode +@ToString public class ApiClient { @Nonnull - CloseableHttpClient httpClient; + private final CloseableHttpClient httpClient; @With + @Getter @Nonnull - String basePath; + private final String basePath; @With( onMethod_ = @Beta ) @Nonnull - ObjectMapper objectMapper; + private final ObjectMapper objectMapper; @With @Nullable - String tempFolderPath; + private final String tempFolderPath; // Methods that can have a request body private static final Set BODY_METHODS = Set.of("POST", "PUT", "DELETE", "PATCH"); @@ -404,7 +406,12 @@ private HttpEntity serialize( Object obj, Map formParams, Conten buildUrl( String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject ) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if( basePath.endsWith("/") && path != null && path.startsWith("/") ) { + url.append(basePath, 0, basePath.length() - 1); + } else { + url.append(basePath); + } + url.append(path); if( queryParams != null && !queryParams.isEmpty() ) { // support (constant) query string in `path`, e.g. "/posts?draft=1" @@ -486,7 +493,7 @@ private static boolean isBodyAllowed( String method ) * API exception */ @Beta - @Nonnull + @Nullable public T invokeAPI( String path, String method, diff --git a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java index c78a71c1f..fac2b4f61 100644 --- a/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java +++ b/datamodel/openapi/openapi-core/src/main/java/com/sap/cloud/sdk/services/openapi/apache/DefaultApiResponseHandler.java @@ -36,6 +36,7 @@ import org.apache.hc.core5.http.ParseException; import org.apache.hc.core5.http.io.HttpClientResponseHandler; import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.message.StatusLine; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -98,6 +99,7 @@ public T handleResponse( ClassicHttpResponse response ) * @throws ParseException * if response parsing fails */ + @SuppressWarnings( "unchecked" ) private T processResponse( ClassicHttpResponse response ) throws OpenApiRequestException, IOException, @@ -105,6 +107,9 @@ private T processResponse( ClassicHttpResponse response ) { int statusCode = response.getCode(); if( statusCode == HttpStatus.SC_NO_CONTENT ) { + if( returnType.getType().equals(OpenApiResponse.class) ) { + return (T) new OpenApiResponse(statusCode, transformResponseHeaders(response.getHeaders())); + } return null; } @@ -112,8 +117,11 @@ private T processResponse( ClassicHttpResponse response ) return deserialize(response); } else { Map> responseHeaders = transformResponseHeaders(response.getHeaders()); - String message = EntityUtils.toString(response.getEntity()); - throw new OpenApiRequestException(message).statusCode(statusCode).responseHeaders(responseHeaders); + String message = new StatusLine(response).toString(); + throw new OpenApiRequestException(message) + .statusCode(statusCode) + .responseHeaders(responseHeaders) + .responseBody(EntityUtils.toString(response.getEntity())); } }