com.azure.resourcemanager.cosmos.implementation.SqlResourcesClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-cosmos Show documentation
Show all versions of azure-resourcemanager-cosmos Show documentation
This package contains Microsoft Azure CosmosDB SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.cosmos.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.cosmos.fluent.SqlResourcesClient;
import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner;
import com.azure.resourcemanager.cosmos.fluent.models.ClientEncryptionKeyGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlContainerGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlDatabaseGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleDefinitionGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlStoredProcedureGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlTriggerGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.SqlUserDefinedFunctionGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner;
import com.azure.resourcemanager.cosmos.models.ClientEncryptionKeyCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.ClientEncryptionKeysListResult;
import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation;
import com.azure.resourcemanager.cosmos.models.SqlContainerCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlContainerListResult;
import com.azure.resourcemanager.cosmos.models.SqlDatabaseCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlDatabaseListResult;
import com.azure.resourcemanager.cosmos.models.SqlRoleAssignmentCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlRoleAssignmentListResult;
import com.azure.resourcemanager.cosmos.models.SqlRoleDefinitionCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlRoleDefinitionListResult;
import com.azure.resourcemanager.cosmos.models.SqlStoredProcedureCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlStoredProcedureListResult;
import com.azure.resourcemanager.cosmos.models.SqlTriggerCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlTriggerListResult;
import com.azure.resourcemanager.cosmos.models.SqlUserDefinedFunctionCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.SqlUserDefinedFunctionListResult;
import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.ByteBuffer;
/**
* An instance of this class provides access to all the operations defined in SqlResourcesClient.
*/
public final class SqlResourcesClientImpl implements SqlResourcesClient {
/**
* The proxy service used to perform REST calls.
*/
private final SqlResourcesService service;
/**
* The service client containing this operation class.
*/
private final CosmosDBManagementClientImpl client;
/**
* Initializes an instance of SqlResourcesClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
SqlResourcesClientImpl(CosmosDBManagementClientImpl client) {
this.service
= RestProxy.create(SqlResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for CosmosDBManagementClientSqlResources to be used by the proxy service
* to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "CosmosDBManagementCl")
public interface SqlResourcesService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlDatabases(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlDatabase(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlDatabase(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlDatabase(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlDatabaseThroughput(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateSqlDatabaseThroughput(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> migrateSqlDatabaseToAutoscale(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> migrateSqlDatabaseToManualThroughput(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlContainers(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlContainer(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlContainer(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlContainer(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlContainerThroughput(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateSqlContainerThroughput(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> migrateSqlContainerToAutoscale(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> migrateSqlContainerToManualThroughput(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listClientEncryptionKeys(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getClientEncryptionKey(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName,
@PathParam("clientEncryptionKeyName") String clientEncryptionKeyName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateClientEncryptionKey(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName,
@PathParam("clientEncryptionKeyName") String clientEncryptionKeyName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlStoredProcedures(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlStoredProcedure(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("storedProcedureName") String storedProcedureName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlStoredProcedure(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("storedProcedureName") String storedProcedureName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlStoredProcedure(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("storedProcedureName") String storedProcedureName, @QueryParam("api-version") String apiVersion,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlUserDefinedFunctions(
@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlUserDefinedFunction(
@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("userDefinedFunctionName") String userDefinedFunctionName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlUserDefinedFunction(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("userDefinedFunctionName") String userDefinedFunctionName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlUserDefinedFunction(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("userDefinedFunctionName") String userDefinedFunctionName,
@QueryParam("api-version") String apiVersion, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlTriggers(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlTrigger(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("triggerName") String triggerName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlTrigger(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("triggerName") String triggerName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlTrigger(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@PathParam("triggerName") String triggerName, @QueryParam("api-version") String apiVersion,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlRoleDefinition(@HostParam("$host") String endpoint,
@PathParam("roleDefinitionId") String roleDefinitionId, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlRoleDefinition(@HostParam("$host") String endpoint,
@PathParam("roleDefinitionId") String roleDefinitionId, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlRoleDefinition(@HostParam("$host") String endpoint,
@PathParam("roleDefinitionId") String roleDefinitionId, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlRoleDefinitions(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSqlRoleAssignment(@HostParam("$host") String endpoint,
@PathParam("roleAssignmentId") String roleAssignmentId, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createUpdateSqlRoleAssignment(@HostParam("$host") String endpoint,
@PathParam("roleAssignmentId") String roleAssignmentId, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSqlRoleAssignment(@HostParam("$host") String endpoint,
@PathParam("roleAssignmentId") String roleAssignmentId, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSqlRoleAssignments(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> retrieveContinuousBackupInformation(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ContinuousBackupRestoreLocation location,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Lists the SQL databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the SQL databases and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlDatabasesSinglePageAsync(String resourceGroupName,
String accountName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listSqlDatabases(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the SQL databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the SQL databases and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlDatabasesSinglePageAsync(String resourceGroupName,
String accountName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listSqlDatabases(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), null, null));
}
/**
* Lists the SQL databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the SQL databases and their properties as paginated response
* with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listSqlDatabasesAsync(String resourceGroupName, String accountName) {
return new PagedFlux<>(() -> listSqlDatabasesSinglePageAsync(resourceGroupName, accountName));
}
/**
* Lists the SQL databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the SQL databases and their properties as paginated response
* with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listSqlDatabasesAsync(String resourceGroupName, String accountName,
Context context) {
return new PagedFlux<>(() -> listSqlDatabasesSinglePageAsync(resourceGroupName, accountName, context));
}
/**
* Lists the SQL databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the SQL databases and their properties as paginated response
* with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listSqlDatabases(String resourceGroupName, String accountName) {
return new PagedIterable<>(listSqlDatabasesAsync(resourceGroupName, accountName));
}
/**
* Lists the SQL databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the SQL databases and their properties as paginated response
* with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listSqlDatabases(String resourceGroupName, String accountName,
Context context) {
return new PagedIterable<>(listSqlDatabasesAsync(resourceGroupName, accountName, context));
}
/**
* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL database under an existing Azure Cosmos DB database account with the provided name along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getSqlDatabaseWithResponseAsync(String resourceGroupName,
String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getSqlDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL database under an existing Azure Cosmos DB database account with the provided name along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getSqlDatabaseWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getSqlDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, this.client.getApiVersion(), accept, context);
}
/**
* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL database under an existing Azure Cosmos DB database account with the provided name on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getSqlDatabaseAsync(String resourceGroupName, String accountName,
String databaseName) {
return getSqlDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL database under an existing Azure Cosmos DB database account with the provided name along with
* {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getSqlDatabaseWithResponse(String resourceGroupName, String accountName,
String databaseName, Context context) {
return getSqlDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context).block();
}
/**
* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL database under an existing Azure Cosmos DB database account with the provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlDatabaseGetResultsInner getSqlDatabase(String resourceGroupName, String accountName,
String databaseName) {
return getSqlDatabaseWithResponse(resourceGroupName, accountName, databaseName, Context.NONE).getValue();
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB SQL database along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createUpdateSqlDatabaseWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (createUpdateSqlDatabaseParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateSqlDatabaseParameters is required and cannot be null."));
} else {
createUpdateSqlDatabaseParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createUpdateSqlDatabase(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName,
this.client.getApiVersion(), createUpdateSqlDatabaseParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB SQL database along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createUpdateSqlDatabaseWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (createUpdateSqlDatabaseParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateSqlDatabaseParameters is required and cannot be null."));
} else {
createUpdateSqlDatabaseParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createUpdateSqlDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(),
createUpdateSqlDatabaseParameters, accept, context);
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, SqlDatabaseGetResultsInner>
beginCreateUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName,
SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) {
Mono>> mono = createUpdateSqlDatabaseWithResponseAsync(resourceGroupName, accountName,
databaseName, createUpdateSqlDatabaseParameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), SqlDatabaseGetResultsInner.class, SqlDatabaseGetResultsInner.class,
this.client.getContext());
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, SqlDatabaseGetResultsInner>
beginCreateUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName,
SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createUpdateSqlDatabaseWithResponseAsync(resourceGroupName, accountName,
databaseName, createUpdateSqlDatabaseParameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), SqlDatabaseGetResultsInner.class, SqlDatabaseGetResultsInner.class, context);
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, SqlDatabaseGetResultsInner> beginCreateUpdateSqlDatabase(
String resourceGroupName, String accountName, String databaseName,
SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) {
return this
.beginCreateUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName,
createUpdateSqlDatabaseParameters)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, SqlDatabaseGetResultsInner> beginCreateUpdateSqlDatabase(
String resourceGroupName, String accountName, String databaseName,
SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, Context context) {
return this
.beginCreateUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName,
createUpdateSqlDatabaseParameters, context)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB SQL database on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName,
String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) {
return beginCreateUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName,
createUpdateSqlDatabaseParameters).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB SQL database on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName,
String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, Context context) {
return beginCreateUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName,
createUpdateSqlDatabaseParameters, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlDatabaseGetResultsInner createUpdateSqlDatabase(String resourceGroupName, String accountName,
String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) {
return createUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName,
createUpdateSqlDatabaseParameters).block();
}
/**
* Create or update an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlDatabaseGetResultsInner createUpdateSqlDatabase(String resourceGroupName, String accountName,
String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, Context context) {
return createUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName,
createUpdateSqlDatabaseParameters, context).block();
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> deleteSqlDatabaseWithResponseAsync(String resourceGroupName,
String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
return FluxUtil
.withContext(
context -> service.deleteSqlDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteSqlDatabaseWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service.deleteSqlDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, this.client.getApiVersion(), context);
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, Void> beginDeleteSqlDatabaseAsync(String resourceGroupName, String accountName,
String databaseName) {
Mono>> mono
= deleteSqlDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteSqlDatabaseAsync(String resourceGroupName, String accountName,
String databaseName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteSqlDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteSqlDatabase(String resourceGroupName, String accountName,
String databaseName) {
return this.beginDeleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteSqlDatabase(String resourceGroupName, String accountName,
String databaseName, Context context) {
return this.beginDeleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName, context).getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) {
return beginDeleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName,
Context context) {
return beginDeleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteSqlDatabase(String resourceGroupName, String accountName, String databaseName) {
deleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).block();
}
/**
* Deletes an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteSqlDatabase(String resourceGroupName, String accountName, String databaseName, Context context) {
deleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName, context).block();
}
/**
* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided
* name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the
* provided name along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>
getSqlDatabaseThroughputWithResponseAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.getSqlDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided
* name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the
* provided name along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getSqlDatabaseThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getSqlDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context);
}
/**
* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided
* name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the
* provided name on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getSqlDatabaseThroughputAsync(String resourceGroupName,
String accountName, String databaseName) {
return getSqlDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided
* name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the
* provided name along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getSqlDatabaseThroughputWithResponse(String resourceGroupName,
String accountName, String databaseName, Context context) {
return getSqlDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context).block();
}
/**
* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided
* name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner getSqlDatabaseThroughput(String resourceGroupName, String accountName,
String databaseName) {
return getSqlDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE)
.getValue();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> updateSqlDatabaseThroughputWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateSqlDatabaseThroughput(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName,
this.client.getApiVersion(), updateThroughputParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateSqlDatabaseThroughputWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateSqlDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), updateThroughputParameters,
accept, context);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ThroughputSettingsGetResultsInner>
beginUpdateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
Mono>> mono = updateSqlDatabaseThroughputWithResponseAsync(resourceGroupName,
accountName, databaseName, updateThroughputParameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, this.client.getContext());
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ThroughputSettingsGetResultsInner>
beginUpdateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName,
ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateSqlDatabaseThroughputWithResponseAsync(resourceGroupName,
accountName, databaseName, updateThroughputParameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, context);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginUpdateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return this
.beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName,
updateThroughputParameters)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginUpdateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName,
ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
return this
.beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName,
updateThroughputParameters, context)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono updateSqlDatabaseThroughputAsync(String resourceGroupName,
String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName,
updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateSqlDatabaseThroughputAsync(String resourceGroupName,
String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName,
updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String resourceGroupName, String accountName,
String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName,
updateThroughputParameters).block();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String resourceGroupName, String accountName,
String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
return updateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName,
updateThroughputParameters, context).block();
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> migrateSqlDatabaseToAutoscaleWithResponseAsync(String resourceGroupName,
String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.migrateSqlDatabaseToAutoscale(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> migrateSqlDatabaseToAutoscaleWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.migrateSqlDatabaseToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context);
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) {
Mono>> mono
= migrateSqlDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, this.client.getContext());
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= migrateSqlDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, context);
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) {
return this.beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName,
Context context) {
return this.beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName,
String accountName, String databaseName) {
return beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
return beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName,
String databaseName) {
return migrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).block();
}
/**
* Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName,
String databaseName, Context context) {
return migrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).block();
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> migrateSqlDatabaseToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.migrateSqlDatabaseToManualThroughput(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> migrateSqlDatabaseToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.migrateSqlDatabaseToManualThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context);
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName,
String databaseName) {
Mono>> mono
= migrateSqlDatabaseToManualThroughputWithResponseAsync(resourceGroupName, accountName, databaseName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, this.client.getContext());
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName,
String databaseName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = migrateSqlDatabaseToManualThroughputWithResponseAsync(resourceGroupName,
accountName, databaseName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, context);
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) {
return this.beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName,
Context context) {
return this
.beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName,
String accountName, String databaseName) {
return beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
return beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String resourceGroupName,
String accountName, String databaseName) {
return migrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block();
}
/**
* Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String resourceGroupName,
String accountName, String databaseName, Context context) {
return migrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context).block();
}
/**
* Lists the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the containers and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlContainersSinglePageAsync(String resourceGroupName,
String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listSqlContainers(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the containers and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlContainersSinglePageAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listSqlContainers(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), null, null));
}
/**
* Lists the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the containers and their properties as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listSqlContainersAsync(String resourceGroupName, String accountName,
String databaseName) {
return new PagedFlux<>(() -> listSqlContainersSinglePageAsync(resourceGroupName, accountName, databaseName));
}
/**
* Lists the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the containers and their properties as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listSqlContainersAsync(String resourceGroupName, String accountName,
String databaseName, Context context) {
return new PagedFlux<>(
() -> listSqlContainersSinglePageAsync(resourceGroupName, accountName, databaseName, context));
}
/**
* Lists the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the containers and their properties as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listSqlContainers(String resourceGroupName, String accountName,
String databaseName) {
return new PagedIterable<>(listSqlContainersAsync(resourceGroupName, accountName, databaseName));
}
/**
* Lists the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the containers and their properties as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listSqlContainers(String resourceGroupName, String accountName,
String databaseName, Context context) {
return new PagedIterable<>(listSqlContainersAsync(resourceGroupName, accountName, databaseName, context));
}
/**
* Gets the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL container under an existing Azure Cosmos DB database account along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getSqlContainerWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL container under an existing Azure Cosmos DB database account along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getSqlContainerWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, containerName, this.client.getApiVersion(), accept, context);
}
/**
* Gets the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL container under an existing Azure Cosmos DB database account on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getSqlContainerAsync(String resourceGroupName, String accountName,
String databaseName, String containerName) {
return getSqlContainerWithResponseAsync(resourceGroupName, accountName, databaseName, containerName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL container under an existing Azure Cosmos DB database account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getSqlContainerWithResponse(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return getSqlContainerWithResponseAsync(resourceGroupName, accountName, databaseName, containerName, context)
.block();
}
/**
* Gets the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL container under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlContainerGetResultsInner getSqlContainer(String resourceGroupName, String accountName,
String databaseName, String containerName) {
return getSqlContainerWithResponse(resourceGroupName, accountName, databaseName, containerName, Context.NONE)
.getValue();
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB container along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createUpdateSqlContainerWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (createUpdateSqlContainerParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateSqlContainerParameters is required and cannot be null."));
} else {
createUpdateSqlContainerParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createUpdateSqlContainer(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), createUpdateSqlContainerParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB container along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createUpdateSqlContainerWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (createUpdateSqlContainerParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateSqlContainerParameters is required and cannot be null."));
} else {
createUpdateSqlContainerParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createUpdateSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(),
createUpdateSqlContainerParameters, accept, context);
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB container.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, SqlContainerGetResultsInner>
beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) {
Mono>> mono = createUpdateSqlContainerWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, createUpdateSqlContainerParameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), SqlContainerGetResultsInner.class, SqlContainerGetResultsInner.class,
this.client.getContext());
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB container.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, SqlContainerGetResultsInner>
beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createUpdateSqlContainerWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, createUpdateSqlContainerParameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), SqlContainerGetResultsInner.class, SqlContainerGetResultsInner.class,
context);
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB container.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, SqlContainerGetResultsInner>
beginCreateUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName,
String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) {
return this
.beginCreateUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName,
createUpdateSqlContainerParameters)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB container.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, SqlContainerGetResultsInner>
beginCreateUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName,
String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters,
Context context) {
return this
.beginCreateUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName,
createUpdateSqlContainerParameters, context)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB container on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createUpdateSqlContainerAsync(String resourceGroupName, String accountName,
String databaseName, String containerName,
SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) {
return beginCreateUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName,
createUpdateSqlContainerParameters).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB container on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createUpdateSqlContainerAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context context) {
return beginCreateUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName,
createUpdateSqlContainerParameters, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB container.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName,
String databaseName, String containerName,
SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) {
return createUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName,
createUpdateSqlContainerParameters).block();
}
/**
* Create or update an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB container.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName,
String databaseName, String containerName,
SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context context) {
return createUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName,
createUpdateSqlContainerParameters, context).block();
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> deleteSqlContainerWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
return FluxUtil
.withContext(
context -> service.deleteSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteSqlContainerWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service.deleteSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, containerName, this.client.getApiVersion(), context);
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, Void> beginDeleteSqlContainerAsync(String resourceGroupName, String accountName,
String databaseName, String containerName) {
Mono>> mono
= deleteSqlContainerWithResponseAsync(resourceGroupName, accountName, databaseName, containerName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteSqlContainerAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteSqlContainerWithResponseAsync(resourceGroupName, accountName, databaseName, containerName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteSqlContainer(String resourceGroupName, String accountName,
String databaseName, String containerName) {
return this.beginDeleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName)
.getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteSqlContainer(String resourceGroupName, String accountName,
String databaseName, String containerName, Context context) {
return this.beginDeleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName, context)
.getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName,
String containerName) {
return beginDeleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, Context context) {
return beginDeleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName,
String containerName) {
deleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName).block();
}
/**
* Deletes an existing Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName,
String containerName, Context context) {
deleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName, context).block();
}
/**
* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getSqlContainerThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getSqlContainerThroughput(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getSqlContainerThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String containerName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getSqlContainerThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), accept, context);
}
/**
* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getSqlContainerThroughputAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return getSqlContainerThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, containerName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with
* {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getSqlContainerThroughputWithResponse(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return getSqlContainerThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, containerName,
context).block();
}
/**
* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner getSqlContainerThroughput(String resourceGroupName, String accountName,
String databaseName, String containerName) {
return getSqlContainerThroughputWithResponse(resourceGroupName, accountName, databaseName, containerName,
Context.NONE).getValue();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateSqlContainerThroughput(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), updateThroughputParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateSqlContainerThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(),
updateThroughputParameters, accept, context);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ThroughputSettingsGetResultsInner>
beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
Mono>> mono = updateSqlContainerThroughputWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, updateThroughputParameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, this.client.getContext());
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ThroughputSettingsGetResultsInner>
beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateSqlContainerThroughputWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, updateThroughputParameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, context);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName,
String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return this
.beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
updateThroughputParameters)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName,
String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
return this
.beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
updateThroughputParameters, context)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono updateSqlContainerThroughputAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateSqlContainerThroughputAsync(String resourceGroupName,
String accountName, String databaseName, String containerName,
ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) {
return beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName,
String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
updateThroughputParameters).block();
}
/**
* Update RUs per second of an Azure Cosmos DB SQL container.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName,
String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
updateThroughputParameters, context).block();
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.migrateSqlContainerToAutoscale(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.migrateSqlContainerToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), accept, context);
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName,
String containerName) {
Mono>> mono = migrateSqlContainerToAutoscaleWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, this.client.getContext());
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = migrateSqlContainerToAutoscaleWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, context);
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName,
String containerName) {
return this
.beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName,
String containerName, Context context) {
return this
.beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName,
context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName,
context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).block();
}
/**
* Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, context)
.block();
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> migrateSqlContainerToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> migrateSqlContainerToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String containerName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), accept, context);
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName,
String databaseName, String containerName) {
Mono>> mono = migrateSqlContainerToManualThroughputWithResponseAsync(
resourceGroupName, accountName, databaseName, containerName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, this.client.getContext());
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName,
String databaseName, String containerName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = migrateSqlContainerToManualThroughputWithResponseAsync(
resourceGroupName, accountName, databaseName, containerName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class, context);
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName,
String containerName) {
return this
.beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName,
containerName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ThroughputSettingsGetResultsInner>
beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName,
String containerName, Context context) {
return this
.beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName,
containerName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName,
containerName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName,
containerName, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName)
.block();
}
/**
* Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName,
context).block();
}
/**
* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the client encryption keys and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listClientEncryptionKeysSinglePageAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listClientEncryptionKeys(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the client encryption keys and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listClientEncryptionKeysSinglePageAsync(
String resourceGroupName, String accountName, String databaseName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listClientEncryptionKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), null, null));
}
/**
* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the client encryption keys and their properties as paginated
* response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listClientEncryptionKeysAsync(String resourceGroupName,
String accountName, String databaseName) {
return new PagedFlux<>(
() -> listClientEncryptionKeysSinglePageAsync(resourceGroupName, accountName, databaseName));
}
/**
* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the client encryption keys and their properties as paginated
* response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listClientEncryptionKeysAsync(String resourceGroupName,
String accountName, String databaseName, Context context) {
return new PagedFlux<>(
() -> listClientEncryptionKeysSinglePageAsync(resourceGroupName, accountName, databaseName, context));
}
/**
* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the client encryption keys and their properties as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listClientEncryptionKeys(String resourceGroupName,
String accountName, String databaseName) {
return new PagedIterable<>(listClientEncryptionKeysAsync(resourceGroupName, accountName, databaseName));
}
/**
* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the client encryption keys and their properties as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listClientEncryptionKeys(String resourceGroupName,
String accountName, String databaseName, Context context) {
return new PagedIterable<>(
listClientEncryptionKeysAsync(resourceGroupName, accountName, databaseName, context));
}
/**
* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getClientEncryptionKeyWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String clientEncryptionKeyName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (clientEncryptionKeyName == null) {
return Mono.error(
new IllegalArgumentException("Parameter clientEncryptionKeyName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getClientEncryptionKey(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, clientEncryptionKeyName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getClientEncryptionKeyWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String clientEncryptionKeyName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (clientEncryptionKeyName == null) {
return Mono.error(
new IllegalArgumentException("Parameter clientEncryptionKeyName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getClientEncryptionKey(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, clientEncryptionKeyName, this.client.getApiVersion(), accept,
context);
}
/**
* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getClientEncryptionKeyAsync(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName) {
return getClientEncryptionKeyWithResponseAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getClientEncryptionKeyWithResponse(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName, Context context) {
return getClientEncryptionKeyWithResponseAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, context).block();
}
/**
* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ClientEncryptionKeyGetResultsInner getClientEncryptionKey(String resourceGroupName, String accountName,
String databaseName, String clientEncryptionKeyName) {
return getClientEncryptionKeyWithResponse(resourceGroupName, accountName, databaseName, clientEncryptionKeyName,
Context.NONE).getValue();
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return client Encryption Key along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createUpdateClientEncryptionKeyWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (clientEncryptionKeyName == null) {
return Mono.error(
new IllegalArgumentException("Parameter clientEncryptionKeyName is required and cannot be null."));
}
if (createUpdateClientEncryptionKeyParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateClientEncryptionKeyParameters is required and cannot be null."));
} else {
createUpdateClientEncryptionKeyParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createUpdateClientEncryptionKey(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, clientEncryptionKeyName,
this.client.getApiVersion(), createUpdateClientEncryptionKeyParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return client Encryption Key along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createUpdateClientEncryptionKeyWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (clientEncryptionKeyName == null) {
return Mono.error(
new IllegalArgumentException("Parameter clientEncryptionKeyName is required and cannot be null."));
}
if (createUpdateClientEncryptionKeyParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateClientEncryptionKeyParameters is required and cannot be null."));
} else {
createUpdateClientEncryptionKeyParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createUpdateClientEncryptionKey(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, clientEncryptionKeyName, this.client.getApiVersion(),
createUpdateClientEncryptionKeyParameters, accept, context);
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of client Encryption Key.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ClientEncryptionKeyGetResultsInner>
beginCreateUpdateClientEncryptionKeyAsync(String resourceGroupName, String accountName, String databaseName,
String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) {
Mono>> mono = createUpdateClientEncryptionKeyWithResponseAsync(resourceGroupName,
accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ClientEncryptionKeyGetResultsInner.class,
ClientEncryptionKeyGetResultsInner.class, this.client.getContext());
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of client Encryption Key.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ClientEncryptionKeyGetResultsInner>
beginCreateUpdateClientEncryptionKeyAsync(String resourceGroupName, String accountName, String databaseName,
String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createUpdateClientEncryptionKeyWithResponseAsync(resourceGroupName,
accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ClientEncryptionKeyGetResultsInner.class,
ClientEncryptionKeyGetResultsInner.class, context);
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of client Encryption Key.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ClientEncryptionKeyGetResultsInner>
beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName,
String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) {
return this
.beginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters)
.getSyncPoller();
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of client Encryption Key.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ClientEncryptionKeyGetResultsInner>
beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName,
String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) {
return this
.beginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, context)
.getSyncPoller();
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return client Encryption Key on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createUpdateClientEncryptionKeyAsync(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) {
return beginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return client Encryption Key on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createUpdateClientEncryptionKeyAsync(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) {
return beginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return client Encryption Key.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ClientEncryptionKeyGetResultsInner createUpdateClientEncryptionKey(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) {
return createUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters).block();
}
/**
* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell
* (instead of directly).
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param clientEncryptionKeyName Cosmos DB ClientEncryptionKey name.
* @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return client Encryption Key.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ClientEncryptionKeyGetResultsInner createUpdateClientEncryptionKey(String resourceGroupName,
String accountName, String databaseName, String clientEncryptionKeyName,
ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) {
return createUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName,
clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, context).block();
}
/**
* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the storedProcedures and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlStoredProceduresSinglePageAsync(
String resourceGroupName, String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listSqlStoredProcedures(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the storedProcedures and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlStoredProceduresSinglePageAsync(
String resourceGroupName, String accountName, String databaseName, String containerName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listSqlStoredProcedures(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, databaseName, containerName, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), null, null));
}
/**
* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the storedProcedures and their properties as paginated
* response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listSqlStoredProceduresAsync(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return new PagedFlux<>(
() -> listSqlStoredProceduresSinglePageAsync(resourceGroupName, accountName, databaseName, containerName));
}
/**
* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the storedProcedures and their properties as paginated
* response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listSqlStoredProceduresAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return new PagedFlux<>(() -> listSqlStoredProceduresSinglePageAsync(resourceGroupName, accountName,
databaseName, containerName, context));
}
/**
* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the storedProcedures and their properties as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listSqlStoredProcedures(String resourceGroupName,
String accountName, String databaseName, String containerName) {
return new PagedIterable<>(
listSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName));
}
/**
* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the storedProcedures and their properties as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listSqlStoredProcedures(String resourceGroupName,
String accountName, String databaseName, String containerName, Context context) {
return new PagedIterable<>(
listSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName, context));
}
/**
* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL storedProcedure under an existing Azure Cosmos DB database account along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getSqlStoredProcedureWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String containerName,
String storedProcedureName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (storedProcedureName == null) {
return Mono
.error(new IllegalArgumentException("Parameter storedProcedureName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getSqlStoredProcedure(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL storedProcedure under an existing Azure Cosmos DB database account along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getSqlStoredProcedureWithResponseAsync(
String resourceGroupName, String accountName, String databaseName, String containerName,
String storedProcedureName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (storedProcedureName == null) {
return Mono
.error(new IllegalArgumentException("Parameter storedProcedureName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getSqlStoredProcedure(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, storedProcedureName,
this.client.getApiVersion(), accept, context);
}
/**
* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL storedProcedure under an existing Azure Cosmos DB database account on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getSqlStoredProcedureAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName) {
return getSqlStoredProcedureWithResponseAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL storedProcedure under an existing Azure Cosmos DB database account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getSqlStoredProcedureWithResponse(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName, Context context) {
return getSqlStoredProcedureWithResponseAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, context).block();
}
/**
* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the SQL storedProcedure under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlStoredProcedureGetResultsInner getSqlStoredProcedure(String resourceGroupName, String accountName,
String databaseName, String containerName, String storedProcedureName) {
return getSqlStoredProcedureWithResponse(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, Context.NONE).getValue();
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB storedProcedure along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createUpdateSqlStoredProcedureWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (storedProcedureName == null) {
return Mono
.error(new IllegalArgumentException("Parameter storedProcedureName is required and cannot be null."));
}
if (createUpdateSqlStoredProcedureParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateSqlStoredProcedureParameters is required and cannot be null."));
} else {
createUpdateSqlStoredProcedureParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createUpdateSqlStoredProcedure(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, this.client.getApiVersion(), createUpdateSqlStoredProcedureParameters, accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB storedProcedure along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createUpdateSqlStoredProcedureWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (storedProcedureName == null) {
return Mono
.error(new IllegalArgumentException("Parameter storedProcedureName is required and cannot be null."));
}
if (createUpdateSqlStoredProcedureParameters == null) {
return Mono.error(new IllegalArgumentException(
"Parameter createUpdateSqlStoredProcedureParameters is required and cannot be null."));
} else {
createUpdateSqlStoredProcedureParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createUpdateSqlStoredProcedure(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, storedProcedureName,
this.client.getApiVersion(), createUpdateSqlStoredProcedureParameters, accept, context);
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB storedProcedure.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, SqlStoredProcedureGetResultsInner>
beginCreateUpdateSqlStoredProcedureAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) {
Mono>> mono = createUpdateSqlStoredProcedureWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), SqlStoredProcedureGetResultsInner.class,
SqlStoredProcedureGetResultsInner.class, this.client.getContext());
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of an Azure Cosmos DB storedProcedure.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, SqlStoredProcedureGetResultsInner>
beginCreateUpdateSqlStoredProcedureAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createUpdateSqlStoredProcedureWithResponseAsync(resourceGroupName, accountName, databaseName,
containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), SqlStoredProcedureGetResultsInner.class,
SqlStoredProcedureGetResultsInner.class, context);
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB storedProcedure.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, SqlStoredProcedureGetResultsInner>
beginCreateUpdateSqlStoredProcedure(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) {
return this
.beginCreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, createUpdateSqlStoredProcedureParameters)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of an Azure Cosmos DB storedProcedure.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, SqlStoredProcedureGetResultsInner>
beginCreateUpdateSqlStoredProcedure(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, Context context) {
return this
.beginCreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, createUpdateSqlStoredProcedureParameters, context)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB storedProcedure on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createUpdateSqlStoredProcedureAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) {
return beginCreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, createUpdateSqlStoredProcedureParameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB storedProcedure on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createUpdateSqlStoredProcedureAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, Context context) {
return beginCreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, createUpdateSqlStoredProcedureParameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB storedProcedure.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlStoredProcedureGetResultsInner createUpdateSqlStoredProcedure(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) {
return createUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, createUpdateSqlStoredProcedureParameters).block();
}
/**
* Create or update an Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL storedProcedure.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB storedProcedure.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SqlStoredProcedureGetResultsInner createUpdateSqlStoredProcedure(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName,
SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, Context context) {
return createUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, createUpdateSqlStoredProcedureParameters, context).block();
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> deleteSqlStoredProcedureWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (storedProcedureName == null) {
return Mono
.error(new IllegalArgumentException("Parameter storedProcedureName is required and cannot be null."));
}
return FluxUtil
.withContext(context -> service.deleteSqlStoredProcedure(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, this.client.getApiVersion(), context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteSqlStoredProcedureWithResponseAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
if (storedProcedureName == null) {
return Mono
.error(new IllegalArgumentException("Parameter storedProcedureName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service.deleteSqlStoredProcedure(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, databaseName, containerName, storedProcedureName,
this.client.getApiVersion(), context);
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, Void> beginDeleteSqlStoredProcedureAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName) {
Mono>> mono = deleteSqlStoredProcedureWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, storedProcedureName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteSqlStoredProcedureAsync(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteSqlStoredProcedureWithResponseAsync(resourceGroupName,
accountName, databaseName, containerName, storedProcedureName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteSqlStoredProcedure(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName) {
return this
.beginDeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName)
.getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteSqlStoredProcedure(String resourceGroupName,
String accountName, String databaseName, String containerName, String storedProcedureName, Context context) {
return this
.beginDeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, context)
.getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono deleteSqlStoredProcedureAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName) {
return beginDeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteSqlStoredProcedureAsync(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName, Context context) {
return beginDeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName,
storedProcedureName, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteSqlStoredProcedure(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName) {
deleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName)
.block();
}
/**
* Deletes an existing Azure Cosmos DB SQL storedProcedure.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param storedProcedureName Cosmos DB storedProcedure name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteSqlStoredProcedure(String resourceGroupName, String accountName, String databaseName,
String containerName, String storedProcedureName, Context context) {
deleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName,
context).block();
}
/**
* Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the userDefinedFunctions and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSqlUserDefinedFunctionsSinglePageAsync(
String resourceGroupName, String accountName, String databaseName, String containerName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (databaseName == null) {
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
if (containerName == null) {
return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listSqlUserDefinedFunctions(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName,
this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param containerName Cosmos DB container name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List operation response, that contains the userDefinedFunctions and their properties along with
* {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono