cookieParams) {
+ for (String authName : authNames) {
+ Authentication auth = authentications.get(authName);
+ if (auth == null) {
+ throw new RestClientException("Authentication undefined: " + authName);
+ }
+ auth.applyToParams(queryParams, headerParams, cookieParams);
+ }
+ }
+
+ /**
+ * Formats the specified collection path parameter to a string value.
+ *
+ * @param collectionFormat The collection format of the parameter.
+ * @param values The values of the parameter.
+ * @return String representation of the parameter
+ */
+ public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection> values) {
+ // create the value based on the collection format
+ if (CollectionFormat.MULTI.equals(collectionFormat)) {
+ // not valid for path params
+ return parameterToString(values);
+ }
+
+ // collectionFormat is assumed to be "csv" by default
+ if(collectionFormat == null) {
+ collectionFormat = CollectionFormat.CSV;
+ }
+
+ return collectionFormat.collectionToString(values);
+ }
+}
diff --git a/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/JavaTimeFormatter.java b/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/JavaTimeFormatter.java
new file mode 100644
index 00000000..8f7ca6d6
--- /dev/null
+++ b/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/JavaTimeFormatter.java
@@ -0,0 +1,68 @@
+/*
+ * Snowflake Warehouse API
+ * The Snowflake Warehouse API is a REST API that you can use to access, customize and manage virtual warehouse in a Snowflake account.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ * Contact: support@snowflake.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package eu.openanalytics.containerproxy.backend.spcs.client;
+
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+
+/**
+ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
+ * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-03-02T16:42:29.597406700+08:00[Australia/Perth]", comments = "Generator version: 7.17.0")
+public class JavaTimeFormatter {
+ private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+
+ /**
+ * Get the date format used to parse/format {@code OffsetDateTime} parameters.
+ *
+ * @return DateTimeFormatter
+ */
+ public DateTimeFormatter getOffsetDateTimeFormatter() {
+ return offsetDateTimeFormatter;
+ }
+
+ /**
+ * Set the date format used to parse/format {@code OffsetDateTime} parameters.
+ *
+ * @param offsetDateTimeFormatter {@code DateTimeFormatter}
+ */
+ public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) {
+ this.offsetDateTimeFormatter = offsetDateTimeFormatter;
+ }
+
+ /**
+ * Parse the given string into {@code OffsetDateTime} object.
+ *
+ * @param str String
+ * @return {@code OffsetDateTime}
+ */
+ public OffsetDateTime parseOffsetDateTime(String str) {
+ try {
+ return OffsetDateTime.parse(str, offsetDateTimeFormatter);
+ } catch (DateTimeParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Format the given {@code OffsetDateTime} object into string.
+ *
+ * @param offsetDateTime {@code OffsetDateTime}
+ * @return {@code OffsetDateTime} in string format
+ */
+ public String formatOffsetDateTime(OffsetDateTime offsetDateTime) {
+ return offsetDateTimeFormatter.format(offsetDateTime);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/RFC3339DateFormat.java b/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/RFC3339DateFormat.java
new file mode 100644
index 00000000..cbfe8696
--- /dev/null
+++ b/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/RFC3339DateFormat.java
@@ -0,0 +1,58 @@
+/*
+ * Snowflake Warehouse API
+ * The Snowflake Warehouse API is a REST API that you can use to access, customize and manage virtual warehouse in a Snowflake account.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ * Contact: support@snowflake.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package eu.openanalytics.containerproxy.backend.spcs.client;
+
+import com.fasterxml.jackson.databind.util.StdDateFormat;
+
+import java.text.DateFormat;
+import java.text.FieldPosition;
+import java.text.ParsePosition;
+import java.util.Date;
+import java.text.DecimalFormat;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-03-02T16:42:29.597406700+08:00[Australia/Perth]", comments = "Generator version: 7.17.0")
+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/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/api/ServiceApi.java b/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/api/ServiceApi.java
new file mode 100644
index 00000000..66563373
--- /dev/null
+++ b/src/main/java/eu/openanalytics/containerproxy/backend/spcs/client/api/ServiceApi.java
@@ -0,0 +1,2295 @@
+package eu.openanalytics.containerproxy.backend.spcs.client.api;
+
+import eu.openanalytics.containerproxy.backend.spcs.client.ApiClient;
+
+import eu.openanalytics.containerproxy.backend.spcs.client.model.ErrorResponse;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.FetchServiceLogs200Response;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.FetchServiceStatus200Response;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.GrantOf;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.JobService;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.Service;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.ServiceContainer;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.ServiceEndpoint;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.ServiceInstance;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.ServiceRole;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.ServiceRoleGrantTo;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.SuccessAcceptedResponse;
+import eu.openanalytics.containerproxy.backend.spcs.client.model.SuccessResponse;
+import java.util.UUID;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
+import org.springframework.web.reactive.function.client.WebClientResponseException;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-03-02T16:41:25.529847700+08:00[Australia/Perth]", comments = "Generator version: 7.17.0")
+public class ServiceApi {
+ private ApiClient apiClient;
+
+ public ServiceApi() {
+ this(new ApiClient());
+ }
+
+ public ServiceApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Create a (or alter an existing) service.
+ * Create a (or alter an existing) service. Even if the operation is just an alter, the full property set must be provided.
+ * 200 - Successful request
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param name Identifier (i.e. name) for the resource.
+ * @param service The service parameter
+ * @return SuccessResponse
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ private ResponseSpec createOrAlterServiceRequestCreation(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull Service service) throws WebClientResponseException {
+ Object postBody = service;
+ // verify the required parameter 'database' is set
+ if (database == null) {
+ throw new WebClientResponseException("Missing the required parameter 'database' when calling createOrAlterService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'schema' is set
+ if (schema == null) {
+ throw new WebClientResponseException("Missing the required parameter 'schema' when calling createOrAlterService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new WebClientResponseException("Missing the required parameter 'name' when calling createOrAlterService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'service' is set
+ if (service == null) {
+ throw new WebClientResponseException("Missing the required parameter 'service' when calling createOrAlterService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // create path and map variables
+ final Map pathParams = new HashMap();
+
+ pathParams.put("database", database);
+ pathParams.put("schema", schema);
+ pathParams.put("name", name);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "ExternalOAuth", "KeyPair", "SnowflakeOAuth" };
+
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/api/v2/databases/{database}/schemas/{schema}/services/{name}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ * Create a (or alter an existing) service.
+ * Create a (or alter an existing) service. Even if the operation is just an alter, the full property set must be provided.
+ * 200 - Successful request
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param name Identifier (i.e. name) for the resource.
+ * @param service The service parameter
+ * @return SuccessResponse
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public Mono createOrAlterService(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull Service service) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return createOrAlterServiceRequestCreation(database, schema, name, service).bodyToMono(localVarReturnType);
+ }
+
+ /**
+ * Create a (or alter an existing) service.
+ * Create a (or alter an existing) service. Even if the operation is just an alter, the full property set must be provided.
+ * 200 - Successful request
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param name Identifier (i.e. name) for the resource.
+ * @param service The service parameter
+ * @return ResponseEntity<SuccessResponse>
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public Mono> createOrAlterServiceWithHttpInfo(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull Service service) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return createOrAlterServiceRequestCreation(database, schema, name, service).toEntity(localVarReturnType);
+ }
+
+ /**
+ * Create a (or alter an existing) service.
+ * Create a (or alter an existing) service. Even if the operation is just an alter, the full property set must be provided.
+ * 200 - Successful request
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param name Identifier (i.e. name) for the resource.
+ * @param service The service parameter
+ * @return ResponseSpec
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseSpec createOrAlterServiceWithResponseSpec(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull Service service) throws WebClientResponseException {
+ return createOrAlterServiceRequestCreation(database, schema, name, service);
+ }
+
+ /**
+ * Create a service
+ * Create a service, with standard create modifiers as query parameters. See the Service component definition for what is required to be provided in the request body.
+ *
200 - Successful request.
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
408 - Request Timeout. This indicates that the request from the client timed out and was not completed by the server.
+ *
409 - Conflict. The requested operation could not be performed due to a conflicting state that could not be resolved. This usually happens when a CREATE request was performed when there is a pre-existing resource with the same name, and also without one of the options orReplace/ifNotExists.
+ *
429 - Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param service The service parameter
+ * @param createMode Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource.
+ * @return SuccessResponse
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ private ResponseSpec createServiceRequestCreation(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull Service service, @javax.annotation.Nullable String createMode) throws WebClientResponseException {
+ Object postBody = service;
+ // verify the required parameter 'database' is set
+ if (database == null) {
+ throw new WebClientResponseException("Missing the required parameter 'database' when calling createService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'schema' is set
+ if (schema == null) {
+ throw new WebClientResponseException("Missing the required parameter 'schema' when calling createService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'service' is set
+ if (service == null) {
+ throw new WebClientResponseException("Missing the required parameter 'service' when calling createService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // create path and map variables
+ final Map pathParams = new HashMap();
+
+ pathParams.put("database", database);
+ pathParams.put("schema", schema);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(null, "createMode", createMode));
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "ExternalOAuth", "KeyPair", "SnowflakeOAuth" };
+
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/api/v2/databases/{database}/schemas/{schema}/services", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ * Create a service
+ * Create a service, with standard create modifiers as query parameters. See the Service component definition for what is required to be provided in the request body.
+ * 200 - Successful request.
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
408 - Request Timeout. This indicates that the request from the client timed out and was not completed by the server.
+ *
409 - Conflict. The requested operation could not be performed due to a conflicting state that could not be resolved. This usually happens when a CREATE request was performed when there is a pre-existing resource with the same name, and also without one of the options orReplace/ifNotExists.
+ *
429 - Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param service The service parameter
+ * @param createMode Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource.
+ * @return SuccessResponse
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public Mono createService(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull Service service, @javax.annotation.Nullable String createMode) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return createServiceRequestCreation(database, schema, service, createMode).bodyToMono(localVarReturnType);
+ }
+
+ /**
+ * Create a service
+ * Create a service, with standard create modifiers as query parameters. See the Service component definition for what is required to be provided in the request body.
+ * 200 - Successful request.
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
408 - Request Timeout. This indicates that the request from the client timed out and was not completed by the server.
+ *
409 - Conflict. The requested operation could not be performed due to a conflicting state that could not be resolved. This usually happens when a CREATE request was performed when there is a pre-existing resource with the same name, and also without one of the options orReplace/ifNotExists.
+ *
429 - Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param service The service parameter
+ * @param createMode Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource.
+ * @return ResponseEntity<SuccessResponse>
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public Mono> createServiceWithHttpInfo(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull Service service, @javax.annotation.Nullable String createMode) throws WebClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return createServiceRequestCreation(database, schema, service, createMode).toEntity(localVarReturnType);
+ }
+
+ /**
+ * Create a service
+ * Create a service, with standard create modifiers as query parameters. See the Service component definition for what is required to be provided in the request body.
+ * 200 - Successful request.
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
408 - Request Timeout. This indicates that the request from the client timed out and was not completed by the server.
+ *
409 - Conflict. The requested operation could not be performed due to a conflicting state that could not be resolved. This usually happens when a CREATE request was performed when there is a pre-existing resource with the same name, and also without one of the options orReplace/ifNotExists.
+ *
429 - Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param service The service parameter
+ * @param createMode Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource.
+ * @return ResponseSpec
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseSpec createServiceWithResponseSpec(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull Service service, @javax.annotation.Nullable String createMode) throws WebClientResponseException {
+ return createServiceRequestCreation(database, schema, service, createMode);
+ }
+
+ /**
+ * Delete a service
+ * Delete a service with the given name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful.
+ *
200 - Successful request.
+ *
202 - Successfully accepted the request, but it is not completed yet.
+ *
400 - Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
+ *
401 - Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
+ *
403 - Forbidden. The request is forbidden. This can also happen if the request is made even if the API is not enabled.
+ *
404 - Not Found. The request endpoint is not valid. This happens if the API endpoint does not exist, or if the API is not enabled.
+ *
405 - Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST.
+ *
429 - Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
+ *
500 - Internal Server Error. The server hit an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
+ *
503 - Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ *
504 - Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended.
+ * @param database Identifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases.
+ * @param schema Identifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database.
+ * @param name Identifier (i.e. name) for the resource.
+ * @param ifExists Parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist.
+ * @return SuccessResponse
+ * @throws WebClientResponseException if an error occurs while attempting to invoke the API
+ */
+ private ResponseSpec deleteServiceRequestCreation(@javax.annotation.Nonnull String database, @javax.annotation.Nonnull String schema, @javax.annotation.Nonnull String name, @javax.annotation.Nullable Boolean ifExists) throws WebClientResponseException {
+ Object postBody = null;
+ // verify the required parameter 'database' is set
+ if (database == null) {
+ throw new WebClientResponseException("Missing the required parameter 'database' when calling deleteService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'schema' is set
+ if (schema == null) {
+ throw new WebClientResponseException("Missing the required parameter 'schema' when calling deleteService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new WebClientResponseException("Missing the required parameter 'name' when calling deleteService", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // create path and map variables
+ final Map pathParams = new HashMap();
+
+ pathParams.put("database", database);
+ pathParams.put("schema", schema);
+ pathParams.put("name", name);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(null, "ifExists", ifExists));
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "ExternalOAuth", "KeyPair", "SnowflakeOAuth" };
+
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/api/v2/databases/{database}/schemas/{schema}/services/{name}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ * Delete a service
+ * Delete a service with the given name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful.
+ *